Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Absolute value of FFT results looks strange

Subject: Absolute value of FFT results looks strange

From: Sebastian Gatzka

Date: 4 Mar, 2011 19:32:22

Message: 1 of 6

Hello World.

I did a FFT of large timedata.

When plotting the abs valued of the FFT output over frequency I get a really strange result.
The values are not located near zero amplitude, but are shiftet vertically.
Have a look:
http://img651.imageshack.us/i/fftkulitenr06.png/

Any ideas what can cause this kind of behaviour?

I have to say that other signals result in a more "expected" way. Like this:
http://img97.imageshack.us/i/fftkulitenr11.png/

sega

Subject: Absolute value of FFT results looks strange

From: Matt J

Date: 4 Mar, 2011 20:15:19

Message: 2 of 6

"Sebastian Gatzka" <sebastian.gatzka.NOSPAM@stud.tu-darmstadt.de> wrote in message <ikreo6$jla$1@fred.mathworks.com>...
>
> Any ideas what can cause this kind of behaviour?

The vertical shift is due to an impulse in your time domain data located at t=0.
Your time domain data is obviously very noisy. In one case, this results in a very large spike at t=0. In the second case, it does not.

Subject: Absolute value of FFT results looks strange

From: Sebastian Gatzka

Date: 4 Mar, 2011 22:38:22

Message: 3 of 6

"Matt J" wrote in message <ikrh8n$3c0$1@fred.mathworks.com>...
>
> The vertical shift is due to an impulse in your time domain data located at t=0.
> Your time domain data is obviously very noisy. In one case, this results in a very large spike at t=0. In the second case, it does not.

Indeed I do have an impulse located at t = 0.
If I cut this section of the time signal I get results I do like more.
Thanks!

But, can you explain how an impulse or noisy environment can lead to this problem?

Subject: Absolute value of FFT results looks strange

From: Matt J

Date: 4 Mar, 2011 23:46:19

Message: 4 of 6

"Sebastian Gatzka" <sebastian.gatzka.NOSPAM@stud.tu-darmstadt.de> wrote in message <ikrpku$b1g$1@fred.mathworks.com>...
>
> Indeed I do have an impulse located at t = 0.
> If I cut this section of the time signal I get results I do like more.
> Thanks!
>
> But, can you explain how an impulse or noisy environment can lead to this problem?

What's the FFT of an impulse? A flat spectrum, right. So, if you add an impulse/spike discontinuity to your signal at t=0, you will effectively be adding a flat component to the spectrum, resulting in a vertical shift.

Noise can introduce this if you have a noise spike at t=0 whose amplitude deviates significantly from its neighbours. You'll have to do some pre-smoothing to get rid of these...

Subject: Absolute value of FFT results looks strange

From: Sebastian Gatzka

Date: 5 Mar, 2011 09:11:05

Message: 5 of 6

"Matt J" wrote in message <ikrtkb$r63$1@fred.mathworks.com>...
>
> What's the FFT of an impulse? A flat spectrum, right. So, if you add an impulse/spike discontinuity to your signal at t=0, you will effectively be adding a flat component to the spectrum, resulting in a vertical shift.
>
> Noise can introduce this if you have a noise spike at t=0 whose amplitude deviates significantly from its neighbours. You'll have to do some pre-smoothing to get rid of these...

Well this sounds convincing. Thank you!
In the meantime I simply cut the spike from the time signal.
What do you mean by pre-smoothing?
Application of a filter?

Subject: Absolute value of FFT results looks strange

From: Matt J

Date: 5 Mar, 2011 13:28:14

Message: 6 of 6

"Sebastian Gatzka" <sebastian.gatzka.NOSPAM@stud.tu-darmstadt.de> wrote in message <iksun9$t0h$1@fred.mathworks.com>...
> "Matt J" wrote in message <ikrtkb$r63$1@fred.mathworks.com>...
>
> What do you mean by pre-smoothing?
> Application of a filter?
===============

Yes. Maybe a median filter. You could also apply polyfit(x,y,0) to your spectrum to find the magnitude of the vertical shift, and then subtract it off (either as a constant in frequency domain, or as in impulse of this magnitude in the time domain). You would want to exclude the large pulse-like deviations in the spectrum from the fit, of course.

Tags for this Thread

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.

Contact us