get_fft.m 155 B

1234
  1. function [X,freq]=get_fft(x,Fs)
  2. N=(length(x)); k=0:N-1; T=N/Fs; freq=k/T; cutOff = ceil(N/2);
  3. freq = freq(1:cutOff); X=fft(x)/N*2; X = X(1:cutOff);
  4. end