# FFT Scaling

**URL:** <https://www.ruby-forum.com/t/fft-scaling/242980>\
**Category:** GNU Radio\
**Created:** [August 12, 2015, 4:52pm UTC](https://www.ruby-forum.com/t/fft-scaling/242980 "2015-08-12T16:52:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rafa\_F](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/958977/32.png) [@Rafa\_F](https://www.ruby-forum.com/u/Rafa_F)\
**Post date:** [August 12, 2015, 4:52pm UTC](https://www.ruby-forum.com/t/fft-scaling/242980/1 "2015-08-12T16:52:31Z")

</div>

There is an internal scaling effect of fftlen (the length of your FFT)  
in  
the FFT block. How do I unscale or remove the scaling factor in the  
python  
generated by thr GRC? I tried the one suggested in the faq,

… forward FFT --\> multiply\_const\_cc(fftlen\*[1.0/fftlen,]) --\> reverse  
FFT  
…

but it doesn’t seem to work. I know I am missing something. How do I  
insert  
this into this line of code in my python?

1. self.fft\_vxx\_0 = fft.fft\_vcc(1024, True, (window.rectangular(1024)),  
True, 1)  
or here?
2. self.blocks\_complex\_to\_mag\_squared\_0 =  
blocks.complex\_to\_mag\_squared(1024)

Thank you in advance.

Attached is my flow graph.

Best,

\*Gerome Jan M. Llames \*

“Design is not just what it looks like and feels like. Design is how it  
works.” - Steve Jobs

---

<div class="post-metadata">

**Author:** ![Gerome\_Jan\_L](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/ee59a6/32.png) [@Gerome\_Jan\_L](https://www.ruby-forum.com/u/Gerome_Jan_L)\
**Post date:** [August 12, 2015, 6:32pm UTC](https://www.ruby-forum.com/t/fft-scaling/242980/2 "2015-08-12T18:32:25Z")

</div>

On Wed, Aug 12, 2015 at 10:51 AM, Gerome Jan L  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> 1. self.fft\_vxx\_0 = fft.fft\_vcc(1024, True, (window.rectangular(1024)),
> 
> Best,
> 
> \*Gerome Jan M. Llames \*
> 
> “Design is not just what it looks like and feels like. Design is how it  
> works.” - Steve Jobs

What do you expect the constant to be? fftlen\*[1.0/fftlen,] = [1],  
unless  
I’m having a really slow day.

---

<div class="post-metadata">

**Author:** ![Gerome\_Jan\_L](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/ee59a6/32.png) [@Gerome\_Jan\_L](https://www.ruby-forum.com/u/Gerome_Jan_L)\
**Post date:** [August 12, 2015, 11:40pm UTC](https://www.ruby-forum.com/t/fft-scaling/242980/3 "2015-08-12T23:40:21Z")

</div>

On Wed, Aug 12, 2015 at 12:31 PM, West, Nathan  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> > but it doesn’t seem to work. I know I am missing something. How do I  
> > Attached is my flow graph.
> 
> What do you expect the constant to be? fftlen\*[1.0/fftlen,] = [1], unless  
> I’m having a really slow day.

It’s been pointed out to me that I am having a slow day. Taking a step  
back… when you say “it doesn’t seem to work”, what exactly does that  
mean? What do you observer that is different from what you expect?

---

<div class="post-metadata">

**Author:** ![Gerome\_Jan\_L](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/ee59a6/32.png) [@Gerome\_Jan\_L](https://www.ruby-forum.com/u/Gerome_Jan_L)\
**Post date:** [August 14, 2015, 3:05am UTC](https://www.ruby-forum.com/t/fft-scaling/242980/4 "2015-08-14T03:05:27Z")

</div>

On 08/12/2015 05:39 PM, West, Nathan wrote:

> ```
> |or here?
> 
> ```
> 
> * * *
> 
> Discuss-gnuradio mailing list  
> [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> [Discuss-gnuradio Info Page](https://lists.gnu.org/mailman/listinfo/discuss-gnuradio)

Try multiply\_const\_cc( 1.0/fftlen, vlen=fftlen )

- Jeff
