Monthly Archives: November 2015

On hackrf_transfer -c

Just a quick post on hackrf_transfer’s CW mode (-c). I’ve recently taken a HackRF One to a signal analyzer in order to make sense of how its DAC and gain values correspond to output power. In order to make use of this in GNU Radio one needs to know what byte sequence going into the DAC this corresponds to. Luckily this was easy to find out

hackrf_transfer.c has a line that reads “transfer->buffer[i] = amplitude;”, which implies the I/Q values sent are {amplitude,amplitude}. This means the actual samples have values of amplitude*(1+i), which is 40% larger or twice the amount of power than what you’d expect if say all the Qs were zero. You can see something similar to this in GNURadio if you feed a rectangular windowed FFT with “1″ vs “1+1j” constant sources (throttled). The former will have a 0 dBFS power while the latter will have +3 dBFS. Sort of a “turning it up to eleven” kind of thing :)

A recent commit to the git repository I have for this thing addresses this, such that you can use the same parameters for my CW transmitter as hackrf_transfer uses in its CW mode. Hopefully convenient!