airspy / airspyhf

Code repository for AirspyHF+
BSD 3-Clause "New" or "Revised" License
146 stars 39 forks source link

Supported Samplerates #9

Closed dh1tw closed 6 years ago

dh1tw commented 6 years ago

Hi, I was searching on the Internet for the supported samplerates of the Airspy HF+. Unfortunately, I couldn't find any information. Could you provide a list of supported samplerates?

Thanks, Tobias

ghost commented 6 years ago

When you call airspyhf_open_init, the device pointer returns the supported sample rates: https://github.com/airspy/airspyhf/blob/master/libairspyhf/src/airspyhf.c#L97 You could print device->supported_samplerates[i], while looping through device->supported_samplerate_count But it is dynamic.

dh1tw commented 6 years ago

Understood :-)

I was actually just looking for a list of the supported samplerates. Writing a small application just to retrieve the supported samplerates seems to be a bit overkill. I actually just want to use my Airspy HF+ with Gnuradio.

touil commented 6 years ago

Please use the forums for this type of questions. The issue tracker is a development tool, not a support tool. From the official product page: "Up to 660 kHz alias and image free output for 768 ksps IQ"

https://airspy.com/airspy-hf-plus/

dh1tw commented 6 years ago

Well, actually the question is related to the library's API. I'm happy to document the supported samplerates in the Wiki once I know them.

I tried to use the library (via Gnuradio) with samplerates different than 768 ksps but without success. So all I'm asking for is a list of valid samplerates which the library accepts.

touil commented 6 years ago

The library transparently reflects the sample rates proposed by the device. The same API will be used later with other HF+ versions supporting different sample rates. In general, the correct way to get the supported sample rates is to query the device. The library is just a wrapper. This is not something new. GNU Radio knows how to list the sample rates dynamically from all the other SDRs. Maybe the effort should go to develop a proper GR source for the HF+.

csete commented 6 years ago

Hi,

Not sure which GNU Radio source or interface is being referenced here, but the gr-osmosdr backend I implemented, and which is based on the original Airspy backend, does read the sample rates from the driver when the object is created: https://github.com/csete/gr-osmosdr-gqrx/blob/airspyhf/lib/airspyhf/airspyhf_source_c.cc#L81

So the correct list of sample rates is available for GNU Radio applications written in C++ and Python.

The problem is when you use the graphical flowgraph editor gnuradio-companion where the user has to manually enter a valid sample rate. It is static and can not (or at least it does not) read the sample rates from the backed, since there is no interaction between the GUI and the C++ code until you press "run". I do not know whether this is a limitation in the framework or the generated API; that's for the python/GRC people to find out.

dh1tw commented 6 years ago

correct. I'm currently working with the gnuradio-companion where the sampling rate has to be introduced by hand. Therefore it would be handy to have a list of supported sampling rates somewhere documented.