hackrf icon indicating copy to clipboard operation
hackrf copied to clipboard

hackrf_sweep: more flexible frequency stepping and result cropping

Open gozu42 opened this issue 3 years ago • 1 comments

(mainly a tracking issue to keep my thoughts/code and potential feedback on this in one place, not sure i can tag it enhancement myself)

hackrf_sweep currently uses hardcoded parameters for the way it is stepping across spectrum. the baseband filter is set to 15MHz, it then tunes to 7.5MHz above the frequency, and uses 0-5 and 10-15 MHz from that block for output. this means it crops 12.5% at the top+bottom, and 25% in the middle. then it repeats the same with the base frequency 5MHz up (so the "lower data block" of step2 is the "middle gap" if step1). there are a lot of hardcoded and rather opaque values involved in this.

exposing the full details on this as commandline options seems no good, but it should be possible to have some different selectable profiles that contain working combinations of parameters. as an example using the 12MHz filter setting, the derived/related values would be a tune offset of 10MHz, ignoring 20% (4MHz) each top and bottom and in the middle, and a step width of 16MHz.

i would use the available baseband filter settings as a starting point for the profiles otoh it might be useful to allow the baseband setting to be wider than the data actualy used, it depends a bit on how good the baseband filter is on the edges. so perhaps a separate option for the filter bandwidth, and just have it default to a sweep-profile value.

while at it, i might expose / bring back LINEAR sweep mode (which is implemented in firmware but not host side).

gozu42 avatar Mar 23 '21 23:03 gozu42

What sample rate does it use, 20MSPS? Staying 12.5% away from top, bottom (avoiding aliasing) and either side of the centre (DC null) seems like a sensible default. Sample rate needs to be > filter bandwidth by some margin.

cjheath avatar Mar 24 '21 02:03 cjheath