Advertisement
Guest User

Untitled

a guest
Feb 20th, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. Fs = 25600 # Hz
  2. sampling_period = 0.1
  3. N = int(Fs * sampling_period)
  4.  
  5. fc = 1000 # Cut-off frequency of the filter
  6. w = fc / (Fs / 2) # Normalize the frequency
  7. b, a = signal.butter(10, w)
  8. filter_out = signal.filtfilt(b, a, bearing1_1["horiz_acc"])
  9.  
  10. f = np.fft.fftfreq(int(N), 1/Fs)
  11. window = np.hanning(int(N))
  12. X = 1/N * np.abs(np.fft.fft(filter_out * window)) * 2 # Multiply by 2 for hann window power correction?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement