Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2017
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. %For vibration analysis of signal without any trial mass.
  2.  
  3. filename = '2400RPM.xlsx';
  4. sheet = 1;
  5. xlRange = 'C40:C516039';
  6. x = xlsread(filename,sheet,xlRange);
  7. T=1/100000;
  8. L=length(x);
  9. Fs=1/T;
  10. t=(0:L-1)*T;
  11. Y = fft(x);
  12. mag1 = abs(Y/L);
  13. mag = mag1(1:L/2+1);
  14. mag(2:end-1) = 2*mag(2:end-1);
  15. ph1 = rad2deg(Y/L);
  16. ph = ph1(1:L/2+1);
  17. ph(2:end-1) = 2*ph(2:end-1);
  18. f=Fs*(0:(L/2))/L;
  19.  
  20. %PLOTTING RESULTS
  21. %--------------------------------------
  22.  
  23. subplot(2,2,[1,2])
  24. plot(t,x);
  25. title('Vibration Signal: 2400RPM');
  26. xlabel('Time (seconds)');
  27. ylabel('Amplitude (voltage)');
  28.  
  29. subplot(2,2,3)
  30. plot(f,mag);
  31. title('Magnituge Plot');
  32. xlabel('Frequency (Hz)');
  33. ylabel('Amplitude');
  34.  
  35. subplot(2,2,4)
  36. plot(f,ph);
  37. title('Phase Plot');
  38. xlabel('Frequency (Hz)');
  39. ylabel('Phase (degree)');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement