[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Discuss-gnuradio] IFFT block output incorrect?
From: |
rear1019 |
Subject: |
Re: [Discuss-gnuradio] IFFT block output incorrect? |
Date: |
Thu, 8 Feb 2018 20:06:28 +0100 |
On Fri, 02 Feb 2018 at 20:14:44 -0500, Weihan Chen wrote:
> I was trying to compare the output of the IFFT block and that from Matlab.
> Here's what I get:
> My input: [1,2,3,4]
> output from Matlab: [2.5+0j, -0.5-0.5j, -0.5+0j, -0.5+0.5j]
> output from gnuradio: [10+0j, 2+2j, -2+0j, 2-2j]
> parameter for the FFT block: fft.fft_vcc(4, False, (()), True, 1)
> It seems like the output is not correct. Do I miss something here?
There are two thing to consider:
- The scaling. GNU Radio uses the FFTW library which does not perform
any scaling [1]. GNU Radio also does not scale the output produced by
FFTW (as far as I can tell).
- Your parameters enable shifting of data. The shifting is performed
/before/ the IFFT process [2]. Disable shifting and you should get the
same result as in Matlab.
[1]
http://www.fftw.org/doc/The-1d-Discrete-Fourier-Transform-_0028DFT_0029.html#The-1d-Discrete-Fourier-Transform-_0028DFT_0029
[2]
https://github.com/gnuradio/gnuradio/blob/master/gr-fft/lib/fft_vcc_fftw.cc#L101