×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Problems with mathlab FFS

Problems with mathlab FFS

Problems with mathlab FFS

(OP)
Hello,

Im making research on humans gait and I found some troubles with matlab. I need given data in file pass through Fast fourier transformation. In given file taken column as X axe are samples of acceleration (which varies depending on movement). Frequence of device is 120Hz. In figure1 X axe is Time(s), Y axe is Acceleration(m/s^2) The main matter is how to make Spectrum of this Acceleration wave that in X axe would be Frequence and in Y axe would be Acceleration.



I inlcuded data text file named MTbeapsisukimo2:

http://www.megafileupload.com/en/file/434206/MTbea...

Theres the code where I was trying to make X axe - as a frequence and Y axe as a Power:



accX=MTbeapsisukimo2(:,9); %X Acceleration

accX=single(accX); % One Array


Fs=120; % Sampling frequency

t=0:1/Fs:22.945; % Time vector of 22.945 seconds

x=accX;

nfft=2754; % Length of FFT

% Take fft, padding with zeros so that length(X)is equal to nfft

X=fft(x,nfft);

% Take the magnitude of fft of x

mx=abs(X);

% Frequency vector

f=(0:nfft-1)*Fs/nfft;

% Generate the plot, title and labels.

figure(1)

plot(t,x)

title('Acceleration Wave Signal');

xlabel('Time (s)');

ylabel('Acceleration');

figure(2)

plot(f,mx)

title('Power Spectrum of a Acceleration Wave');

xlabel('Frequency (Hz)');

ylabel('Power');



I would be very thankfull for any consultation :)

RE: Problems with mathlab FFS

Well that seems to work reasonably well, what is the issue?

You haven't calculated power by the way, that's linear units. power would be abs(X).*abs(X)

If you are puzzled by the calibration of the y axis read the help on fft, I'll admit I can't immediately tell you why it is exactly what it is. It is to do with the frequency resolution, and because half the energy in a double ended spectrum is above the Nyquist frequency

You seem to have worked out the frequency scaling correctly.

Cheers

Greg Locock


New here? Try reading these, they might help FAQ731-376: Eng-Tips.com Forum Policies http://eng-tips.com/market.cfm?

RE: Problems with mathlab FFS

Here's the correctly scaled fft

X=fft(x,nfft)/nfft*2;

nfft compensates for the way the energy is spread between bins, and the 2 is because of the Nyquist mirroring.

If you are going to do much of this I strongly recommend you read up on signal processing theory.

Cheers

Greg Locock


New here? Try reading these, they might help FAQ731-376: Eng-Tips.com Forum Policies http://eng-tips.com/market.cfm?

RE: Problems with mathlab FFS

(OP)
Thank You very much ;)

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members! Already a Member? Login



News


Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close