Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

fft of a periodic signal?

Status
Not open for further replies.

dhruvkumar

Newbie level 3
Joined
Mar 14, 2010
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,315
I was trying out the fft function in matlab. I applied the fft function to a periodic function, and I found that the spectrum had a number of peaks in it, instead of just one that I would have expected.
Does anyone know why this is happening?
Disclaimer: I am very much an newbie to Fourier theory and signal processing in general!
 

can you show your matlab code, it would help to help you... My first guess is that you do not use an integer number of cycles of your periodic signal, therefore your actual signal is not periodic from the fft point of view.
 

Hello!

I was trying out the fft function in matlab. I applied the fft function to a
periodic function, and I found that the spectrum had a number of peaks in it,
instead of just one that I would have expected.
Does anyone know why this is happening?
Disclaimer: I am very much an newbie to Fourier theory and signal processing
in general!

Unlike JoannesPaulus wrote, I think the explanation has nothing to do with
MatLab code itself, but with the fourier transform itself.
What the Fourier transform gives you is a series of functions that you may
add to restore the function you were analyzing. For instance the fourier of a
square wave of frequency f will be a series of peaks with tje following amplitudes:
1, 1/3, 1/5, 1/7, etc…

Now there is more: for the discrete Fourier transform (and also FFT which is only
a calculation method for the discrete Fourier transform), the spectrum is
symmetric aroumd fs/2/. So if you enter a sine wave with a normalizef
frequency of 0.1, then your spectrum will show one peak a 0.1 and another
at 0.9.

Dora

[Edit] I meant 0.1 fs and 0.9 fs. Sorry for the confusion.
 

doraemon said:
Now there is more: for the discrete Fourier transform (and also FFT which is only
a calculation method for the discrete Fourier transform), the spectrum is
symmetric aroumd fs/2/. So if you enter a sine wave with a normalizef
frequency of 0.1, then your spectrum will show one peak a 0.1 and another
at 0.9.

Dora

Can you please post some MATLAB images to explain this?

Discrete time fourier transform is periodic with periodic 2 pi, so if sinwave has freq of 0.1 has one peak at 0.1, why would the other spectrum repeat at 0.9?
 

Hello!

No, I cannot post matlab sinc I don't use it.

Discrete time fourier transform is periodic with periodic 2 pi, so if sinwave has freq of 0.1 has one peak at 0.1, why would the other spectrum repeat at 0.9?

I was not talking about period, but about aliases.

Imeant 0.1fs and 0.9 fs.
I'm always using normalized frequency which is more convenient. So Fs = 1.
You cannot sample frequencies above 0.5, I guess you agree with this.

So if you sample a signal of frequency 0.1, you will get an alias at 0.9.
As the discrete Fourier transform is the product of the real one with a Dirac
pulse sequence, then in the frequency world, you get the convolution of
the Dirac sequence transform and the input signal transform.

Dora
 

doraemon said:
Unlike JoannesPaulus wrote, I think the explanation has nothing to do with MatLab code itself, but with the fourier transform itself.
I believe you misunderstood my statement and request to see the code.

If you have a periodic signal, suppose a sinewave of frequency f0, after the fft you will see the signal power in only one bin at the sinewave frequency f0 and the other at -f0 (matlab shows it at fs-f0, if you do not apply the fftshift function) IF and only IF your samples include an integer number of cycles of the sinewave.
If you do not have an integer number of cycles, you need to apply a window function to smoothen the edges of your signal. If you do not use windowing, you will create artificial non-linearities in the signal that will show as skirts at f0 and harmonic distortion. This is why I believe dhruvkumar sees unexpected peaks in his fft (unless his signal is periodic but multi-tone, of course - that's why I want to see his code).
 

Hello!

JoannesPaulus said:
If you have a periodic signal, suppose a sinewave of frequency f0, after the fft you will see the signal power in only one bin at the sinewave frequency f0 and the other at -f0 (matlab shows it at fs-f0, if you do not apply the fftshift function) IF and only IF your samples include an integer number of cycles of the sinewave.

I agree with this. You will have a peal at f0, another at -f0 (or fs - f0). But you will
not have other peaks. In case of non-integer number of cycles, there will be
non-zero values, but these values will be around the peaks only (i.e. you will not
have _PEAKS_ other than f0 and -f0 (modulo 1 period).

What was said in the original post is "I found that the spectrum had a number of
peaks in it" that he sees other _PEAKS_, He does not say that there are no-zero
values around the peaks, but that he observes unexpected peaks. Therefore I
guessed he was wondering what that -f0 (or 0.9 f0) peak is.

Dora.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top