How to obtain the Fourier transform of a filtered signal?

1 view (last 30 days)
I am working on a project in which i have to analyze the walking signals of the person. I obtained the signals with the help of an accelerometer. Then I applied low pass butterworth filter of cut-off frequency 0.2Hz and sampling frequency 1Hz. I have obtained the filtered signals in time domain, but i need the signals in frequency domain. From the help of this site I got to know the syntax of fft i.e Y = fft(x) I applied it to my filtered signals and obtained a very unusual result. Please help me in performing fourier transform on the signals. I am attaching my results below.
the fig attached consists of the x component of my filtered signal(i have three columns of readings-x,y and z) and the signal achieved after fft.

Answers (2)

Adam
Adam on 1 Aug 2014
Edited: Adam on 1 Aug 2014
fft gives a complex result. That is what you are seeing in that figure - real vs imaginary on the x and y axes. You can view the spectrum using the abs function.
e.g.
y = fft(x, nFFT);
plot( 2*abs(Y(1:nFFT/2+1) ) );
Obviously you can also calculate the frequencies to plot those on the x-axis. The Matlab help page for fft gives an example of this.

Rick Rosson
Rick Rosson on 1 Aug 2014
N = length(x);
X = fftshift(fft(x))/N;
figure;
plot(abs(X));
  1 Comment
NIHARIKA
NIHARIKA on 2 Aug 2014
I am attaching the signals obtained by applying the code that you have given. Can you please suggest if the signals obtained are right or not. I am attaching both time domain and the frequency domain signals. a3,b3,c3 = filtered signals (in time domain) X,X1,X2 = corresponding signals in frequency domain.
I will be highly thankful to you.

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!