Convert into FFT solution

2 visualizzazioni (ultimi 30 giorni)
nur yusof
nur yusof il 16 Feb 2015
Hi all,
I got the time domain signal from experimental work as per below. The blue is x-direction,green is z-direction and red is y-direction.
When i convert the signal into FFT using matlab, I got as per below
The problem is, the peak should happen in z-direction(Ch3) but happen in x-direction(ch1). The coding as per below:-
clc; y1 = Ch1; y2= Ch2; y3 = Ch3; N=6678; Fs=512;
%Plot FFT Moving Vehicle signal Ch1 NFFT1 = 2^nextpow2(N); Y1 = fft(y1,NFFT1)/N; % the division by N is to scale the amplitude f_plot = Fs/2*linspace(0,1,NFFT1/2+1); % vector of frequencies for the plot subplot(311), plot(f_plot,2*abs(Y1(1:NFFT1/2+1))) % multiplicated by 2 to recover the energy related % to the negative frequencies since in this way only half spectrum is plotted title('FFT Moving Vehicle Ch1'); xlabel('Frequency [Hertz]');
%Plot FFT Moving Vehicle signal Ch2 NFFT2 = 2^nextpow2(N); Y2 = fft(y2,NFFT2)/N; % the division by N is to scale the amplitude f_plot2 = Fs/2*linspace(0,1,NFFT1/2+1); % vector of frequencies for the plot subplot(312), plot(f_plot2,2*abs(Y2(1:NFFT2/2+1))) % multiplicated by 2 to recover the energy related % to the negative frequencies since in this way only half spectrum is plotted title('FFT Moving Vehicle Ch2'); xlabel('Frequency [Hertz]');
%Plot FFT Moving Vehicle signal Ch3 NFFT3 = 2^nextpow2(N); Y3 = fft(y2,NFFT3)/N; % the division by N is to scale the amplitude f_plot3 = Fs/2*linspace(0,1,NFFT3/2+1); % vector of frequencies for the plot subplot(313), plot(f_plot3,2*abs(Y3(1:NFFT3/2+1))) % multiplicated by 2 to recover the energy related % to the negative frequencies since in this way only half spectrum is plotted title('FFT Moving Vehicle Ch3'); xlabel('Frequency [Hertz]');
For information,when the sensor do the measurement,the reading for y-direction will fall at-1 to 1 G due to the gravity.
Is there anything i need to do before convert it into FFT?shift maybe?
Thank you in advance.

Risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by