# Accelerometer raw data output to measure vibration,and do a frequency spectrum/ amplitude spectrum?

Ive used an Arduino to measure vibration on a washing machine and have up to 100 raw data out putvalues. I want to present an amplitude/frequency spectrum with these values, i have matlab and simulink , but dont know how to start?

And example of how i think

Ax=[1 0 6 25 1 51 51 81 81 51 1 51 51 511 1 551 51 1 1 51 51 10 51 05 1510 15 5 8 0 8 0...]

time= 0-100 seconds.

plot(freq/amp specturm).

Regards,

Volkan

• en.wikipedia.org/wiki/Fast_Fourier_transform – jippie May 4 '14 at 19:04
• Well thats not gonna be helpful if you think that.. – draaknar May 4 '14 at 19:26
• Dude, jippie's comment is helpful, and the answer. The FFT is such a common function that MathWorks builds it into the main package, no add-ons required. Now go into Matlab's documentation and figure out how to use the FFT function. – Matt Young May 4 '14 at 20:49
• I think this is more related to signal processing, Fourrier math or Matlab programming than electronics design. – Blup1980 May 5 '14 at 10:42

• @draaknar I can't give you FFT formulas but if you wanted to "test" the presence for say 0.1Hz, you multiply and integrate the samples you have with a 0.1Hz sinewave and 0.1Hz cosinewave. This gives you two numbers (A and B) and the measure of 0.1Hz in your samples is $\sqrt{A^2 + B^2}$. That's standard numerical fourier analysis – Andy aka May 4 '14 at 20:58