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).



  • \$\begingroup\$ en.wikipedia.org/wiki/Fast_Fourier_transform \$\endgroup\$ – jippie May 4 '14 at 19:04
  • \$\begingroup\$ Well thats not gonna be helpful if you think that.. \$\endgroup\$ – draaknar May 4 '14 at 19:26
  • \$\begingroup\$ 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. \$\endgroup\$ – Matt Young May 4 '14 at 20:49
  • \$\begingroup\$ I think this is more related to signal processing, Fourrier math or Matlab programming than electronics design. \$\endgroup\$ – Blup1980 May 5 '14 at 10:42

If it's anything like my old washing machine, 100 data values collected over 100 seconds isn't worth the paper you might print it on. Nyquist "says" the highest frequency you can extract (based on 1Hz sampling) will be 0.5Hz and for sure, when the machine is spinning, it's going to be several Hz and this will produce aliasing in your sampled results rendering them near-useless.

| improve this answer | |
  • \$\begingroup\$ It was an example, i will read values for like 2 hours, to show the washing cycle, i was expecting a formula or something.. so i can simulate the values in matlab or simulink, it doesnt need to be values from the sensor. \$\endgroup\$ – draaknar May 4 '14 at 20:38
  • \$\begingroup\$ @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 \$\endgroup\$ – Andy aka May 4 '14 at 20:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.