3

I have signal output values recorded by a Software-defined radio whose center frequency was 162.550 MHz & sample rate of 1,000,000. Now to analyse the data in frequency domain I calculated FFT which was straight forward.

#Calculating FFT of signal 
fourier=np.fft.fft(RadioData)

Since for Amplitude vs Frequency plot I need to calculate frequencies present in the signal too. I used Numpy fftfreq for that.

freq=np.fft.fftfreq(fourier.shape[0])

The output was in the range of [-0.5 0.4999995]. I am confused how to interpret this result or alternatively how to calculate frequencies present in the data ?

hotpaw2
  • 70,107
  • 14
  • 90
  • 153
  • [`fftfreq`](https://docs.scipy.org/doc/numpy/reference/generated/numpy.fft.fftfreq.html) accepts a sampling interval. Just call `freq=np.fft.fftfreq(fourier.shape[0], d=1/1e6)` (where I assume you’re sampling at one megasamples-per-second, so your samples are separated by one microsecond). `freq` should run from 0 to 500 KHz and then a jump to -500 KHz to 0. Now just `plot(freq, np.abs(fourier))`. – Ahmed Fasih Mar 31 '17 at 17:09
  • If your data is real (not complex-valued), consider [`rfftfreq`](https://docs.scipy.org/doc/numpy/reference/generated/numpy.fft.rfftfreq.html) and [`rfft`](https://docs.scipy.org/doc/numpy/reference/generated/numpy.fft.rfft.html). – Ahmed Fasih Mar 31 '17 at 17:11
  • Uh, just to double-check—you say the carrier was 162 MHz and you sampled at 1 MHz. I assume the hardware has already demodulated the signal to baseband, and low-pass-filtered it to <500 KHz? If not, then you’ll see some very strange results :) – Ahmed Fasih Mar 31 '17 at 17:13
  • No the data is complex – Andre Smith Mar 31 '17 at 19:42
  • @hotpaw2 Can you explain it bit more & why the answer below is wrong(might be add your answer below) ? – Andre Smith Apr 01 '17 at 20:09
  • IQ samples have twice the bandwidth of strictly real samples, both taken at the same sample rate. An FFT of strictly real input is conjugate symmetric, thus rendering the FFT spectrum result partially redundant. IQ sampling allow both the real and imaginary components of an FFT input to be non-zero, thus doubling the potential bandwidth by removing the conjugate redundancy necessity. – hotpaw2 Apr 02 '17 at 15:30

1 Answers1

1

When SDR samples are baseband IQ (or complex, or cosine/sine), then the bandwidth is equal to the IQ sample rate. This is because baseband IQ samples (unlike single_channel strictly real samples) can contain both positive and negative frequency spectrum, independently, half the bandwidth above and half the bandwidth below an RTL-SDR's (et.al.) tuned RF frequency setting (unless a frequency offset is selected).

Thus, the frequency range of the FFT of IQ data will be from Fcenter - (indicated_bandwidth/2) to almost Fcenter + (indicated_bandwidth/2). Or for your example: 162.050 to (a bit below) 163.050 MHz. (the "bit below" value depends on the FFT size.) The step size, dF, with be the IQ sample rate divided by the FFT length.

(Note that the data rate in scalar samples is twice the IQ sample rate because each IQ sample contains two samples (real and imaginary components, or cosine and sine mixer outputs). Thus, because each IQ sample contains more information, the information bandwidth can be greater. But SDR apps usually indicate the IQ sample rate, not the higher raw data rate.)

hotpaw2
  • 70,107
  • 14
  • 90
  • 153
  • I got your point that frequency axis will contain (2*sampling rate). But as written by you the range will be 165.050 to (a bit below) 163.050 MHz while my center freq is 162.550 is it a typo ? – Andre Smith Apr 02 '17 at 07:32
  • Yes, there was a typo. Now fixed I think. – hotpaw2 Apr 02 '17 at 15:25