# A problem to the FFT Block

**URL:** <https://www.ruby-forum.com/t/a-problem-to-the-fft-block/224480>\
**Category:** GNU Radio\
**Created:** [November 13, 2012, 4:44pm UTC](https://www.ruby-forum.com/t/a-problem-to-the-fft-block/224480 "2012-11-13T16:44:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![aris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/258eb7/32.png) [@aris](https://www.ruby-forum.com/u/aris)\
**Post date:** [November 13, 2012, 4:44pm UTC](https://www.ruby-forum.com/t/a-problem-to-the-fft-block/224480/1 "2012-11-13T16:44:20Z")

</div>

hello all,

When I use the fft blcok, it seems not right.

I build the test system like this: Square source -\> IFFT -\> FFT -\>  
File  
Sink, when the input is 1, the output in the file sink is 1, and when  
the  
intput is 0, the output is random, sometimes 0, sometimes between -1 and  
1.

Like this:

input:

0 0 0 0 0 0 0

0 0 0 0 0 0 0

0 0 0 0 0 0 0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0 0 0 0 0 0 0 0

0 0 0 0 0 0 0 0

0 0 0 0 0 0 0 0

0  
output:

0 0 0 0 0 0 0

0 0 0 0 0 0 0

0 0 0 0 0 0 0

0

0

0

0

0

0  
0

0

0

0

0

0

0 0

0

0

0

0

0

0

0

0  
0 0

0  
0  
0

0

0  
0

0

0

0  
0  
0

0 0

0 0 0

0 0  
0 0 0  
0

0

0

0

0

0

0 0

0

How should I do, so that the source data is the same as the sink data?

Thanks.

Heyutu

---

<div class="post-metadata">

**Author:** ![Zhiwen\_He](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/2bfe46/32.png) [@Zhiwen\_He](https://www.ruby-forum.com/u/Zhiwen_He)\
**Post date:** [November 14, 2012, 4:40am UTC](https://www.ruby-forum.com/t/a-problem-to-the-fft-block/224480/2 "2012-11-14T04:40:11Z")

</div>

On Tue, Nov 13, 2012 at 10:43 AM, Zhiwen He [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> 0 0 0 0 0 0 0
> 
> 0  
> 0  
> 0 0
> 
> 0
> 
> 0 0 0
> 
> 0 0
> 
> Thanks.
> 
> Heyutu

Hi Heyutu,

I just tried this right now and don’t have a problem. This is my full  
graph:

sig\_source (square wave) → throttle → stream\_to\_vector(fftsize) →   
fft(fftsize, reverse) → multiply\_const(fftsize\*[1/fftsize], fftsize) →   
fft(fftsize, forward) → vector\_to\_stream → time sink

Tom

---

<div class="post-metadata">

**Author:** ![Zhiwen\_He](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/2bfe46/32.png) [@Zhiwen\_He](https://www.ruby-forum.com/u/Zhiwen_He)\
**Post date:** [November 15, 2012, 4:11am UTC](https://www.ruby-forum.com/t/a-problem-to-the-fft-block/224480/3 "2012-11-15T04:11:59Z")

</div>

Thank you very much. I have solved the problem, I find that, I didn’t  
use  
the multiply\_const block. But there is another question, when I see the  
data in Matlab with plot function, the figure before fft and after ifft  
is  
not same, there are something wrong on the position, where the valueis 0  
in  
the square source. why?

Thanks

Zhiwen He

---

<div class="post-metadata">

**Author:** ![Zhiwen\_He](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/2bfe46/32.png) [@Zhiwen\_He](https://www.ruby-forum.com/u/Zhiwen_He)\
**Post date:** [November 20, 2012, 4:48pm UTC](https://www.ruby-forum.com/t/a-problem-to-the-fft-block/224480/4 "2012-11-20T16:48:21Z")

</div>

On Wed, Nov 14, 2012 at 5:08 AM, Zhiwen He [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Thank you very much. I have solved the problem, I find that, I didn’t use  
> the multiply\_const block. But there is another question, when I see the  
> data in Matlab with plot function, the figure before fft and after ifft is  
> not same, there are something wrong on the position, where the valueis 0 in  
> the square source. why?
> 
> Thanks
> 
> Zhiwen He

I feel like there’s a representational issue here. Why is your scale  
x10^9  
(before the FFT) when the amplitude of the signal generator is 1? I’m  
also  
not clear what I’m looking at in the plotted figures. Can you label  
them?

Tom
