Borrar filtros
Borrar filtros

FFT conversion

2 visualizaciones (últimos 30 días)
divijesh puninchathaya
divijesh puninchathaya el 26 de Jun. de 2011
We want to take fft of time domain data of acceleration between 0 to 3 sec in 30000 samlpes.How to include time into fft like x= fft(t,a)where a= matrix of acceleration data of 30000x 1 size.Suppose if the same data is collected in 5 secs for 30 000 samples how it affects fft.wether fft depends only on 30000 accelearation data or also on the time duration in which this data is collected.How to get that.

Respuestas (1)

Rick Rosson
Rick Rosson el 26 de Jun. de 2011
The first thing you need to do is to compute the sampling rate Fs, which is simply the number of samples per second that you have in your time domain data. You can compute Fs very easily in MATLAB using the information you have provided:
N = size(a,1);
startTime = 0;
stopTime = 3;
Fs = N/(stopTime - startTime);
In this example, Fs should have a value of 10,000 samples per second.
Once you have the sampling rate Fs, you can then compute the frequency domain for the Fourier spectrum. From the Nyquist theorem, the frequency domain that corresponds to the Fourier transform will range from 0 hertz to Fs hertz in increments of Fs/N hertz:
x = fft(a);
dF = Fs/N;
f = 0:dF:Fs-dF;
figure;
plot(f,abs(x));
Notice that you actually have a two-sided spectrum. It is often convenient to flip the two-sides of the spectrum using the fftshift function, and view the frequency domain from -Fs/2 to +Fs/2 instead:
x = fftshift(fft(a));
dF = Fs/N;
f = -Fs/2:dF:Fs/2-dF;
figure;
plot(f,abs(x));
HTH.
Rick
  2 comentarios
osman yurdakul
osman yurdakul el 26 de Jun. de 2011
so how can i something by fft like in this image?
link : http://imageshack.us/photo/my-images/841/ekil2.jpg/
please help me
Rick Rosson
Rick Rosson el 26 de Jun. de 2011
If you want help, please submit a question instead of a comment.

Iniciar sesión para comentar.

Categorías

Más información sobre Spectral Measurements en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by