[Hackrf-dev] Parameter's range for osmocom block

Kevin Reid kpreid at switchb.org
Sat Oct 4 11:27:37 EDT 2014


On Oct 2, 2014, at 20:02, Pierre Talbot <pirtalbot at gmail.com> wrote:

> I would like to know what are the parameter's range for the Hackrf in the Osmocom Source block.

This information is actually known by the osmosdr block itself. Unfortunately, it's not available when you're working in GRC because the block doesn't exist yet. If you're willing to browse the source code, almost all the answers are here:

http://cgit.osmocom.org/gr-osmosdr/tree/lib/hackrf/hackrf_source_c.cc

> - Sample rate (sps): 2 Msps to 20 Msps, right?  what makes the gnuradio-companion to go in overflow if we select something like 200K ?

Per hackrf_source_c::get_sample_rates: 8 MHz, 10 MHz, 12.5 MHz, 16 MHz, 20 MHz -- or anything in between, but with slightly worse noise.

2 MHz is also supported per https://github.com/mossmann/hackrf/wiki/HackRF-One and my own tests; it's not listed here for some reason.

> - Ch0: Frequency (Hz): 10 Mhz to 6Ghz

Can actully be set all the way down to 0 meaningfully, but the RF performance will be worse.

> - Ch0: Freq. Corr. (ppm): ???

See hackrf_source_c::set_center_freq for how this is used; it is an adjustment for error in the clock, in parts-per-million. You set it empirically by seeing how far off frequency a known signal appears to be.

> - Ch0: DC Offset Mode: not supported by the HackRF, right?
> - Ch0: IQ Balance Mode: Supported ?  Should we set it to Off or Automatic ?
> - Ch0: Gain Mode: not supported by the HackRF, right?

All of these do nothing.

> - Ch0: RF Gain (dB): Does this override the next two gain control or there are 3 parameters for the gain? what is the range?
> - Ch0: IF Gain (dB): Does the range is 15 to 30?
> - Ch0: BB Gain (dB): Does the range is 15 to 30?

To answer these, see hackrf_source_c::get_gain_range. All of these independently control separate parameters in the RF hardware.

"RF Gain" is actually the LNA switch, and can only be 0 or 14 dB.
"IF Gain" is 0 to 40 dB.
"BB Gain" is 0 to 62 dB.

> - Ch0: Bandwidth (Hz): Should this be set to zero for automatic? what is the range?

See hackrf_source_c::get_bandwidth_range. If you set it to zero it will choose the filter bandwidth automatically based on the sample rate.

> What device arguments could be useful?

See hackrf_source_c::hackrf_source_c (the constructor). There's only one, which controls the number of sample buffers used.

-- 
Kevin Reid                                  <http://switchb.org/kpreid/>



More information about the HackRF-dev mailing list