Acceleration vs Time data into FFT

I have acceleration vs time data. I want to get FFT value from the data.Can someone show me the way?

 Respuesta aceptada

Image Analyst
Image Analyst el 17 de En. de 2015
spectrum = fft(signal);

8 comentarios

nur yusof
nur yusof el 17 de En. de 2015
I have tried the given coding but the value is an unreasonable. Can you suggest another coding?
Image Analyst
Image Analyst el 18 de En. de 2015
Why do you say it's unreasonable? Maybe you want to use pwelch() in the Signal Processing Toolbox instead. There is a webinar about spectral processing that covers pwelch.
nur yusof
nur yusof el 18 de En. de 2015
Attached is the figure when I am using the given code. Maybe you can tell me why.Or do i need further coding since you said your code and Shoaibur are essentially the same or very similar code. Please enlighten me.Thank you.
Image Analyst
Image Analyst el 18 de En. de 2015
Editada: Image Analyst el 18 de En. de 2015
Why are you getting a signal like that for my code and a 1D signal for Shoaibur's? It doesn't make sense to me. Please attach your data and code so I can see how you got the plot here, and the plot in Shoaibur's answer. Did you call plot in the same way for both of them? Like plot(abs(y))???
nur yusof
nur yusof el 18 de En. de 2015
Editada: Image Analyst el 18 de En. de 2015
Ok.Attached excel data sheet.Just use time diff column for time history and ch1 for acceleration respond.
Here the coding for your code
spectrum = fft(signal);
>> plot(spectrum)
While shoaibur's is:
signal = CH1;
N=7574;
t=Time;
% Plot Original signal in Time Domain
subplot(211), plot(t,CH1);
title('Original signal in Time Domain');
xlabel('Time [s]');
ylabel('Acceleration [m/s^2]');
% Plot FFT signal
N = pow2(nextpow2(length(signal)));
y = fft(signal,N);
subplot(212),plot(1:N,abs(y));
title('FFT');
xlabel('Frequency [Hertz]');
ylabel('Magnitude');
Hope you can solve it.Really appreciate your concern.
Image Analyst
Image Analyst el 18 de En. de 2015
How are you reading in the workbook? With xlsread()? And why did you plot the absolute value of his "y", but not for my "spectrum"? The fft will be complex in general so you should plot the real, imaginary, or magnitude of the spectrum.
nur yusof
nur yusof el 18 de En. de 2015
I import the data into matlab. Thats means the coding should be spectrum = fft(signal); plot(1:N,abs (spectrum));
Is it true??
nur yusof
nur yusof el 21 de En. de 2015
I got the FFT value from your coding image analyst.Is the bandwidth of FFT data according to my time history domain data?If not,how to ensure the bandwidth is within the interval?Can you brief me about the coding? My bandwidth range is 50Hz-500Hz from time domain history data.

Iniciar sesión para comentar.

Más respuestas (1)

Shoaibur Rahman
Shoaibur Rahman el 17 de En. de 2015
Define the number of DFT points N, and then perform the fft.
N = pow2(nextpow2(length(signal)));
y = fft(signal,N);
plot(1:N,abs(y))
If the length of your signal is a big number then set the value of N manually to a lower value, like N = 64, 128, 256, etc. This will make your figure to look better sometime, but note that that may not be accurate always from the computational point of view.

8 comentarios

nur yusof
nur yusof el 17 de En. de 2015
Thank you so much.You are helping me out.Solve.
nur yusof
nur yusof el 17 de En. de 2015
But, can I ask another question. I have x,y,z signal.How to plot it in 1 graph?I mean the FFT value.How to use the coding repeatedly but with different signal?
Kirthi Devleker
Kirthi Devleker el 17 de En. de 2015
Editada: Kirthi Devleker el 17 de En. de 2015
You can watch "Spectral Analysis with MATLAB" webinar. Your question about plotting the FFT value is answered there
Image Analyst
Image Analyst el 18 de En. de 2015
How is this helping? It's the same as the code I gave you and you said it was unreasonable. Except his code somehow changes the length of the signal to a power of 2 which is not necessary.
nur yusof
nur yusof el 18 de En. de 2015
Editada: Image Analyst el 18 de En. de 2015
The figure is unreasonable.The FFt should be around two or three digit. Please look at the figure i attached.Can someone tell me why
Image Analyst
Image Analyst el 18 de En. de 2015
I don't know what 2 or 3 digits means in this context. And it doesn't look unreasonable to me.
I still say my and Shoaibur's code are essentially the same or very similar code. So show the results of Shoaibur's code and tell me how it helped you solve it.
By the way, you might want to call fftshift().
nur yusof
nur yusof el 18 de En. de 2015
Attached previous figure is solve by Shoaibur's coding. While, attached figure solve by image analyst.I dont know why the figure look like that.I think the frequency solve by Shoaibur is high maybe due to the the vibration of bridge,vehicle and noise from environment.So, it has high value.
nur yusof
nur yusof el 21 de En. de 2015
I got the FFT value from the coding.Is the bandwidth of FFT data according to my time history domain data?If not,how to ensure the bandwidth is within the interval?Can you brief me about the coding? My bandwidth range is 50Hz-500Hz from time domain history data.

Iniciar sesión para comentar.

Categorías

Más información sobre Fourier Analysis and Filtering en Centro de ayuda y File Exchange.

Preguntada:

el 17 de En. de 2015

Comentada:

el 21 de En. de 2015

Community Treasure Hunt

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

Start Hunting!

Translated by