Guest User

Untitled

a guest
Oct 27th, 2016
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. % Simulated data to mimic your signal
  2. timeSamp = 1/64;
  3. nSample = 64;
  4. xAxis = linspace(0,1,nSample)';
  5. dataClean = sin(2*pi*xAxis*6);
  6. distAmpl = 1/10*( medfilt1(rand(nSample,1),3)+0.15);
  7. dataDist = data.*distAmpl + 0.01*(rand+10);
  8.  
  9. % Half-axis FFT for a real signal
  10. [fftR,fftAxe] = FFTR(dataDist-mean(dataDist),timeSamp);
  11.  
  12. % Display
  13. subplot(2,1,1)
  14. plot(xAxis,dataDist,'.-');grid on;axis tight
  15. xlabel('Time');ylabel('Amplitude');
  16. subplot(2,1,2)
  17. plot(fftAxe,fftR,'.-');
  18. xlabel('Frequency');ylabel('Amplitude');
  19. axis tight;;grid on
Add Comment
Please, Sign In to add comment