question on data format

73 views
Skip to first unread message

Paulh002

unread,
Aug 11, 2021, 8:38:38 AM8/11/21
to Radioberry
Hi,

Is the data coming from the radioberry and probably also from hermes lite 2 inverted?
If I perform a FFT on the data then the low frequencies are in the top of the array, where I expect it in the beginning of the FFT array. Also USB decoding seem to decode LSB and visa versa. 
Maybe this is how it is, otherwise it is somewhere in my code.

73,
Paul

pa3gsb

unread,
Aug 11, 2021, 10:15:21 AM8/11/21
to Radioberry
Paul,

The data from the gateware is a stream of samples ; your block FFT will revert it i assume...

73 Johan
PA3GSB

Op woensdag 11 augustus 2021 om 14:38:38 UTC+2 schreef paul.hol...@gmail.com:

Ronald Nicholson

unread,
Aug 11, 2021, 12:38:51 PM8/11/21
to Radioberry
If you FFT baseband IQ signals into an result array indexed from 0 to N-1, the upper half of the array, N/2 to N-1, contains frequencies with a negative frequency offset.  Only the lower half of the FFT result vector contains spectrum above the frequency that the radio slice (HL2 or Radioberry) is configured to receive.  This is the same as with most other IQ SDR receivers, including RTL-SDRs, et.al.  
If you want to center the displayed spectrum, you can rotate the FFT result data so that the 0th result bin is in the center.
73,
Ron
n6ywu

Paulh002

unread,
Aug 11, 2021, 3:40:45 PM8/11/21
to Radioberry
Yes, that is exactly what i get. I use liquid dsp. Which in fact uses fftw. But the documentation does not explains this effect.
I think also Adlam pluto does the same.  I had to configure the FFT to LIQUID_FFT_BACKWARD but also move the data from the center of the array.
But I was surprised that USB and LSB are swapped.  I assume it is just how it is. Just rename USB to LSB :) and 
Thanks for the information
Paul
Op woensdag 11 augustus 2021 om 18:38:51 UTC+2 schreef ron.ni...@gmail.com:

Clifford Heath

unread,
Aug 11, 2021, 8:53:28 PM8/11/21
to Radioberry
The USB/LSB reversal happens when one of I & Q is inverted. If you look "along" the time axis with I&Q as horizontal and vertical, positive frequencies spiral clockwise and negative frequencies spiral anti-clockwise - or vice versa depending on phase inversion.

The zero bin from the FFT contains the DC spike. The fundamental is bin[1] and the negative fundamental is the last bin - these correspond to a single cycle at the length of the FFT.

If one of I or Q is disabled (set to zero) then the negative frequencies are a mirror of the positive ones. Likewise if the gain on I is different from the gain on Q; you get a partial image in the negative half of frequencies that are positive, and vice versa. This is a serious factor to consider in the design of an I/Q demodulator.

softerh...@gmail.com

unread,
Aug 17, 2021, 2:34:43 AM8/17/21
to Radioberry
Hi Paul,

There is a long-standing bug in the openhpsdr gateware RTL where the Q is inverted. This bug predates the radioberry and the Hermes-Lite. There is just too much software inertia out there to try and fix it. 

73,

Steve
kf7o
Reply all
Reply to author
Forward
0 new messages