0
$\begingroup$

Ok, I'm new to the whole Dsp thing, so sorry if the question is a lame one

I'm trying to extract frequencies from a signal provided by a radio Device (Win Radio G31DDC- IFstream).

The radio provides a 16-bit signal stream with 50MHz bandwidth and 100MHz sample rate. when I set my FFT length to 32768 everything seems to work fine and the spectrum view is very similar to bundled application with radio, however the precision of 3051.75Hz (100Mhz/32768) is not enough for my needs, so I increased FFT length to 65536, but at this length I got mirrored data in real part of FFT result.

I suppose I should be able to increase the length to provided sample rate

I'm using NAudio.DSP library for FFT calculations and using Hamming window with length of FFT

Here is the code:

_fftLength=32768;
_m = (int) Math.Log(_fftLength, 2.0);

for (var n = 0; n < e.RawData.Length; n ++)
{
   var r=e.RawData[n];
   var i=0;

   _fftBuffer[n].X = (float) (r*FastFourierTransform.HammingWindow(n,_fftLength));
   _fftBuffer[n].Y=i;
}

FastFourierTransform.FFT(true, _m, _fftBuffer);

FFT with length 32768

FFT with length 65536

Can someone explain what I'm doing wrong here, please?

$\endgroup$
  • $\begingroup$ What exactly do you mean by "mirrored data"? What do the figures show? Did you increase the size of _fftBuffer or just the _fftLength? $\endgroup$ – Deve Aug 25 '14 at 7:24
  • $\begingroup$ @Deve _fftBuffer length and _fftLength are the same, both images are taken from the same signal, the first one with FFT length of 32768 and the second one with 65536, I believe the signal should get more detailed but the result is like I'm using full FFT result not the first half (real) part $\endgroup$ – hessamj Aug 25 '14 at 9:00
  • $\begingroup$ If the input signal is real-valued, its discrete Fourier transform is symmetric like in the lower figure. I would rather ask why the spectrum shown in the upper figure is not. Are you sure that you plot the complete FFT result in both cases? $\endgroup$ – Deve Aug 25 '14 at 11:36
  • $\begingroup$ yes I'm Definitely sure, actually both spectrum figures are generated with the same source code, the only difference is _fftLength value, Is it possible that the real sample rate to be much lower than reported value from radio device (down-sampled) and 100 MHz sample rate is used internally? $\endgroup$ – hessamj Aug 25 '14 at 16:14
  • $\begingroup$ Actually, you're analyzing two different signals, so it is to be expected that their spectra look different. The one spectrum looks symmetric which is just normal if you plot the complete FFT output and the input signal is real-valued. But without the rest of the code we can only guess what is going on. Unfortunately, this is not the right place for asking programming questions. $\endgroup$ – Deve Aug 25 '14 at 17:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.