Thread Subject: Amplitude in the Frequency Domain

Subject: Amplitude in the Frequency Domain

From: Madhu Shurpali

Date: 10 Feb, 2009 08:55:04

Message: 1 of 4

Hello,

  I am looking for the relationship between amplitude in the freq domain and time domain.

For example consider a sine wave with freq 2Hz and amplitude 20 in the time domain. When I FFT it, I get an impuse in the Freq at 2 Hz with a peak different from 20. How are these two related and how can I get them to be equal ?

Thanks for all the help.

Subject: Amplitude in the Frequency Domain

From: Rune Allnor

Date: 10 Feb, 2009 11:10:09

Message: 2 of 4

On 10 Feb, 09:55, "Madhu Shurpali" <madhu.shurp...@cvgrp.com> wrote:
> Hello,
>
> =A0 I am looking for the relationship between amplitude in the freq domai=
n and time domain.
>
> For example consider a sine wave with freq 2Hz and amplitude 20 in the ti=
me domain. When I FFT it, I get an impuse in the Freq at 2 Hz with a peak d=
ifferent from 20. How are these two related

First of all, the FFT used by matlab is not unitary.
That is, the energy is not preserved. To preserve
energy you need to scale the spectrum by sqrt(N)
where N is the FFT lengh.

The second issue is spectrum leakage. You will only
recognize one spectrum coefficient with the correct
amplitude (after scaling) iff the frequency is
an integer fraction of the sampling frequency.

x =3D sin(2*pi*f*t)
f =3D n/N n integer such that n < N/2

where N is the length of the signal.

If this is *not* the case, the energy in the signal
will be distributed across almost all the spectrum
coefficients. This is known as 'spectrum leakage'.

> and how can I get them to be equal ?

In general, you can't.

Rune

Subject: Amplitude in the Frequency Domain

From: Madhu Shurpali

Date: 10 Feb, 2009 13:38:02

Message: 3 of 4

Thanks Rune for the help. To implement your suggestions in the post, I tried the following script:

t= [0:0.01:9.99];

y= 10*sin(2*pi*t) + 20*sin(2*pi*3*t) + 50*cos(2*pi*5*t);

y1=abs(fftshift(fft(y)));

N_fft = length(t);

F2 = [-N_fft/2: N_fft/2-1]*100/N_fft;

plot(F2, y1);
axis([0 10 0 max(y1)*1.25])

The amplitudes in this case were much bigger that what I expected. Please suggest as to whats diff in this script as compared to your reply.

Thanks and Regards
Madhu V. Shurpali

Subject: Amplitude in the Frequency Domain

From: David

Date: 10 Feb, 2009 13:59:02

Message: 4 of 4

"Madhu Shurpali" <madhu.shurpall@cvgrp.com> wrote in message <gmrvvp$i3d$1@fred.mathworks.com>...
> Thanks Rune for the help. To implement your suggestions in the post, I tried the following script:
>
> t= [0:0.01:9.99];
>
> y= 10*sin(2*pi*t) + 20*sin(2*pi*3*t) + 50*cos(2*pi*5*t);
>
> y1=abs(fftshift(fft(y)));
>
> N_fft = length(t);
>
> F2 = [-N_fft/2: N_fft/2-1]*100/N_fft;
>
> plot(F2, y1);
> axis([0 10 0 max(y1)*1.25])
>
> The amplitudes in this case were much bigger that what I expected. Please suggest as to whats diff in this script as compared to your reply.
>
> Thanks and Regards
> Madhu V. Shurpali

but you didn't scale the amplitude like he said. divide y1 by N_fft to get the proper amplitudes.

Tags for this Thread

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.

rssFeed for this Thread

Contact us at files@mathworks.com