{"id":20912501,"url":"https://github.com/fogleman/go-airspy","last_synced_at":"2025-05-13T08:31:00.982Z","repository":{"id":144925990,"uuid":"159266515","full_name":"fogleman/go-airspy","owner":"fogleman","description":"Go wrapper for the libairspy library.","archived":false,"fork":false,"pushed_at":"2018-11-27T03:16:35.000Z","size":6,"stargazers_count":10,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-01T20:11:59.561Z","etag":null,"topics":["airspy","dsp","go","golang","radio","sdr"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fogleman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-11-27T02:51:31.000Z","updated_at":"2024-01-24T05:13:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"d75d49b0-0a03-4e9e-b86a-6b8d4cf54382","html_url":"https://github.com/fogleman/go-airspy","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fogleman%2Fgo-airspy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fogleman%2Fgo-airspy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fogleman%2Fgo-airspy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fogleman%2Fgo-airspy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fogleman","download_url":"https://codeload.github.com/fogleman/go-airspy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253903665,"owners_count":21981729,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["airspy","dsp","go","golang","radio","sdr"],"created_at":"2024-11-18T14:27:51.827Z","updated_at":"2025-05-13T08:31:00.976Z","avatar_url":"https://github.com/fogleman.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-airspy\n\nThis is a simple Go wrapper for the [libairspy](https://github.com/airspy/airspyone_host) library.\n\n[Airspy](https://airspy.com/products/) is a suite of low-cost, high-performance Software Defined Radios (SDR).\n\n### Installation\n\n```sh\n$ brew install airspy # homebrew on mac, else install libairspy as appropriate for your OS\n$ go get -u github.com/fogleman/go-airspy/airspy\n```\n\n### Documentation\n\nhttps://godoc.org/github.com/fogleman/go-airspy/airspy\n\n### Example\n\n```go\nfunc main() {\n\t// print the libairspy library version, e.g.\n\t// \"1.0.9\"\n\tfmt.Println(airspy.LibVersion())\n\n\t// open the airspy device\n\tdevice, err := airspy.Open()\n\tcheck(err)\n\n\t// print the device version, e.g.\n\t// \"AirSpy NOS v1.0.0-rc10-3-g7120e77 2018-04-28\"\n\tversion, err := device.VersionString()\n\tcheck(err)\n\tfmt.Println(version)\n\n\t// set some parameters\n\tcheck(device.SetSampleType(airspy.SampleFloat32IQ))\n\tcheck(device.SetSampleRate(10000000))\n\tcheck(device.SetFrequency(98700000))\n\tcheck(device.SetLNAGain(11))\n\tcheck(device.SetMixerGain(7))\n\tcheck(device.SetVGAGain(7))\n\n\t// create a channel to receive transfers\n\ttransfers := make(chan airspy.Transfer, 16)\n\n\t// kick off a goroutine to process the samples (see below)\n\tgo handler(transfers)\n\n\t// start sampling\n\tcheck(device.StartRx(transfers))\n\n\t// wait a bit\n\ttime.Sleep(100 * time.Millisecond)\n\n\t// stop sampling\n\tcheck(device.StopRx())\n\n\t// close the device\n\tcheck(device.Close())\n}\n\nfunc handler(transfers chan airspy.Transfer) {\n\t// process samples\n\tvar maxMagnitude float64\n\tfor transfer := range transfers {\n\t\tsamples := transfer.Samples.([]float32)\n\t\tfmt.Println(len(samples), \"samples\")\n\t\tfor i := 0; i \u003c len(samples); i += 2 {\n\t\t\tI := float64(samples[i])\n\t\t\tQ := float64(samples[i+1])\n\t\t\tx := complex(I, Q)\n\t\t\tm := cmplx.Abs(x)\n\t\t\tif m \u003e maxMagnitude {\n\t\t\t\tmaxMagnitude = m\n\t\t\t\tfmt.Println(maxMagnitude)\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc check(err error) {\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffogleman%2Fgo-airspy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffogleman%2Fgo-airspy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffogleman%2Fgo-airspy/lists"}