SHARE
TWEET

Untitled

a guest Oct 16th, 2019 85 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. % Carga el registro
  2. data = detrend(load('accRoca.txt'), 0);
  3. FS = 200; % Muestreo, 200 datos por segundo
  4.  
  5. % Encuentra la potencia que mas se ajusta al numero de datos
  6. n = 2^nextpow2(length(data));
  7.  
  8. % Crea el vector temporal
  9. tdata = zeros(n, 1);
  10. for j = 2:n
  11.     tdata(j) = tdata(j-1) + 1 / FS;
  12. end
  13. w = FS * (0:(n / 2)) / n; % Vector de frecuencias
  14.  
  15. % Calcula la fft del registro
  16. fft_ = fft(data, n);
  17. fft_registro = fft_(1:n/2+1); % Selecciona la mitad
  18. tdata = tdata(1:n/2);
  19. fig = figure(1);
  20. set(gcf, 'name', 'FFT registro');
  21. movegui(fig, 'center');
  22. plot(w, abs(fft_registro), 'k');
  23. xlabel('Frecuencia (hz)');
  24. ylabel('FFT (g\cdot s)');
  25. title('FFT Registro');
  26. hold off;
  27. grid on;
  28. grid minor;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top