Thread Subject: Normalization for DFT (fft in MATLAB)

Subject: Normalization for DFT (fft in MATLAB)

From: "A.E lover

Date: 10 Jul, 2007 15:21:09

Message: 1 of 9

Hi all,

is it correct that to normalize the output of fft such that a unit
sinusoid in the time domain corresponds to unit amplitude in the
frequency domain, I simply divide the DFT by the length of data.
for example data is x(n), I take N point DFT so the normalized output
is abs(fft(x,N))/N.

Can you please tell me how to prove this?

Thanks

AELOVER

Subject: Normalization for DFT (fft in MATLAB)

From: Tim Wescott

Date: 10 Jul, 2007 15:40:15

Message: 2 of 9

A.E lover wrote:
> Hi all,
>
> is it correct that to normalize the output of fft such that a unit
> sinusoid in the time domain corresponds to unit amplitude in the
> frequency domain, I simply divide the DFT by the length of data.
> for example data is x(n), I take N point DFT so the normalized output
> is abs(fft(x,N))/N.
>
> Can you please tell me how to prove this?
>
> Thanks
>
> AELOVER
>
Not in general. It seems like everyone and his brother has a different
way of normalizing the FFT and IFFT internally -- you need to check to
see what your software package does and go with the flow.

Do an FFT on a vector of ones. Your result should be non-zero for the
first bin, and darn close to zero everywhere else. Use the value of the
non-zero bin to scale your results.

--

Tim Wescott
Wescott Design Services
http://www.wescottdesign.com

Do you need to implement control loops in software?
"Applied Control Theory for Embedded Systems" gives you just what it says.
See details at http://www.wescottdesign.com/actfes/actfes.html

Subject: Normalization for DFT (fft in MATLAB)

From: Clay

Date: 10 Jul, 2007 15:36:47

Message: 3 of 9

On Jul 10, 6:21 pm, "A.E lover" <aelove...@gmail.com> wrote:
> Hi all,
>
> is it correct that to normalize the output of fft such that a unit
> sinusoid in the time domain corresponds to unit amplitude in the
> frequency domain, I simply divide the DFT by the length of data.
> for example data is x(n), I take N point DFT so the normalized output
> is abs(fft(x,N))/N.
>
> Can you please tell me how to prove this?
>
> Thanks
>
> AELOVER


Actually there are several ways discrete fourier transforms may be
normalized. Essentialy you like for DFT_inverse ( DFT ( f(x) ) ) to
be f(x) without any extra scaling. Two common ways are:


DFT inverse DFT

1 1/N

---------------------------------------------
1/sqrt(N) 1/sqrt(N)


(There are some adjustments needed for the DC term and for the "half
sampling rate term" if the length is even)

Try finding Rick Lyons' book and looking up the specific details.

Clay






Subject: Normalization for DFT (fft in MATLAB)

From: "A.E lover

Date: 10 Jul, 2007 15:55:27

Message: 4 of 9

Thanks Wescott, however I have a specific requirement to normalize
fft: " normalize the FFT output such that a sinusoid with amplitude 1
will correspond to an FFT magnitude of unity". I think for this
specific requirement we will have unique way to do that, right? So in
your opinion, in this case, how should I do to normalize FFT output?

Thank you very much.

Regards,


> Not in general. It seems like everyone and his brother has a different
> way of normalizing the FFT and IFFT internally -- you need to check to
> see what your software package does and go with the flow.
>
>
> Tim Wescott
> Wescott Design Serviceshttp://www.wescottdesign.com


v

Subject: Normalization for DFT (fft in MATLAB)

From: Jerry Avins

Date: 10 Jul, 2007 23:01:52

Message: 5 of 9

A.E lover wrote:
> Thanks Wescott, however I have a specific requirement to normalize
> fft: " normalize the FFT output such that a sinusoid with amplitude 1
> will correspond to an FFT magnitude of unity". I think for this
> specific requirement we will have unique way to do that, right? So in
> your opinion, in this case, how should I do to normalize FFT output?

That depends on the details of the FFT routine you use. Write your own
and know, or use Tim's approach to find out.

Jerry
--
Engineering is the art of making what you want from things you can get.
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

Subject: Normalization for DFT (fft in MATLAB)

From: "A.E lover

Date: 10 Jul, 2007 21:31:32

Message: 6 of 9

On Jul 10, 11:01 pm, Jerry Avins <j...@ieee.org> wrote:
> A.E lover wrote:
I am using fft of MATLAB, I am still confused with Tim's method.
In Tim 's method, the testing input is a vector of ones. I am
confused, I guess it should be a sinusoidal with amplitude of 1
because my objective is to normalize fft such that the sinusoidal with
applitude of 1 in time domain will correspond with fft amplitude of
unity.
I have tested two cases, using Tim's method, the scale value is the
length of the input vector. while if the input is a sinusoidal
signal, the scale value is half of signal length. So which one is
correct for my case?



Thanks



> > Thanks Wescott, however I have a specific requirement to normalize
> > fft: " normalize the FFT output such that a sinusoid with amplitude 1
> > will correspond to an FFT magnitude of unity". I think for this
> > specific requirement we will have unique way to do that, right? So in
> > your opinion, in this case, how should I do to normalize FFT output?
>
> That depends on the details of the FFT routine you use. Write your own
> and know, or use Tim's approach to find out.
>
> Jerry
> --
> Engineering is the art of making what you want from things you can get.
> =AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=
=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=
=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF


Subject: Normalization for DFT (fft in MATLAB)

From: NZTideMan

Date: 10 Jul, 2007 22:47:41

Message: 7 of 9

On Jul 11, 4:31 pm, "A.E lover" <aelove...@gmail.com> wrote:
> On Jul 10, 11:01 pm, Jerry Avins <j...@ieee.org> wrote:> A.E lover wrote:
>
> I am using fft of MATLAB, I am still confused with Tim's method.
> In Tim 's method, the testing input is a vector of ones. I am
> confused, I guess it should be a sinusoidal with amplitude of 1
> because my objective is to normalize fft such that the sinusoidal with
> applitude of 1 in time domain will correspond with fft amplitude of
> unity.
> I have tested two cases, using Tim's method, the scale value is the
> length of the input vector. while if the input is a sinusoidal
> signal, the scale value is half of signal length. So which one is
> correct for my case?
>
> Thanks
>
>
>
> > > Thanks Wescott, however I have a specific requirement to normalize
> > > fft: " normalize the FFT output such that a sinusoid with amplitude 1
> > > will correspond to an FFT magnitude of unity". I think for this
> > > specific requirement we will have unique way to do that, right? So in
> > > your opinion, in this case, how should I do to normalize FFT output?
>
> > That depends on the details of the FFT routine you use. Write your own
> > and know, or use Tim's approach to find out.
>
> > Jerry
> > --
> > Engineering is the art of making what you want from things you can get.
> > =AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=
=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=
=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF- Hide=
 quoted text -
>
> - Show quoted text -

You can scale the FFT to be whatever you like.
For a power spectral density (PSD) spectrum, the convention is for the
area under the spectrum to be the variance of the time series, but for
a normalised spectrum the area is unity, by convention.
If you have to divide by N/2 to get unit amplitude, so be it.
Different strokes for different folks.

Subject: Normalization for DFT (fft in MATLAB)

From: dbd

Date: 11 Jul, 2007 02:35:25

Message: 8 of 9

On Jul 10, 3:21 pm, "A.E lover" <aelove...@gmail.com> wrote:
> Hi all,
>
> is it correct that to normalize the output of fft such that a unit
> sinusoid in the time domain corresponds to unit amplitude in the
> frequency domain, I simply divide the DFT by the length of data.
> for example data is x(n), I take N point DFT so the normalized output
> is abs(fft(x,N))/N.
>
> Can you please tell me how to prove this?
>
> Thanks
>
> AELOVER

As often happens here, your question is underspecified, but that
hasn't kept people from throwing out answers.

If your 'unit sinusoid in the time domain' is a constant unit
amplitude
complex vector rotating at a bin centered frequency, the N-point FFT
in
Matlab will produce an output bin with amplitude N.

If your 'unit sinusoid in the time domain' is a unit peak amplitude
real sinusoid oscillating between positive and negative peaks at a
bin centered frequency, the N-point FFT in
Matlab will produce two output bins with amplitude N/2 at what
can be interpreted as positive and negative frequency positions.

Note that Tim Wescott's vector of 1's is in the complex vector case.

If you are using real input and want to use only non-negative
frequencies
from the FFT, you will have to scale the DC bin differently from the
positive frequency bins.

Good Luck,

Dale B. Dalrymple
http://dbdimages.com




Subject: Normalization for DFT (fft in MATLAB)

From: NZTideMan

Date: 11 Jul, 2007 03:07:16

Message: 9 of 9

On Jul 11, 9:35 pm, dbd <d...@ieee.org> wrote:
> On Jul 10, 3:21 pm, "A.E lover" <aelove...@gmail.com> wrote:
>
> > Hi all,
>
> > is it correct that to normalize the output of fft such that a unit
> > sinusoid in the time domain corresponds to unit amplitude in the
> > frequency domain, I simply divide the DFT by the length of data.
> > for example data is x(n), I take N point DFT so the normalized output
> > is abs(fft(x,N))/N.
>
> > Can you please tell me how to prove this?
>
> > Thanks
>
> > AELOVER
>
> As often happens here, your question is underspecified, but that
> hasn't kept people from throwing out answers.
>
> If your 'unit sinusoid in the time domain' is a constant unit
> amplitude
> complex vector rotating at a bin centered frequency, the N-point FFT
> in
> Matlab will produce an output bin with amplitude N.
>
> If your 'unit sinusoid in the time domain' is a unit peak amplitude
> real sinusoid oscillating between positive and negative peaks at a
> bin centered frequency, the N-point FFT in
> Matlab will produce two output bins with amplitude N/2 at what
> can be interpreted as positive and negative frequency positions.
>
> Note that Tim Wescott's vector of 1's is in the complex vector case.
>
> If you are using real input and want to use only non-negative
> frequencies
> from the FFT, you will have to scale the DC bin differently from the
> positive frequency bins.
>
> Good Luck,
>
> Dale B. Dalrymplehttp://dbdimages.com

Normalisation:
When I use a word,' Humpty Dumpty said, in a rather scornful tone,' it
means just what I choose it to mean, neither more nor less.

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
fft Matthew Simoneau 11 Jul, 2007 13:42:06
math Matthew Simoneau 11 Jul, 2007 13:42:06
rssFeed for this Thread
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com