Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. order =5
  2. fs = 500.0
  3. cutoff =0.5
  4. nyq = 0.5 * fs
  5. normal_cutoff = cutoff / nyq
  6. b, a = signal.butter(order,normal_cutoff,btype='high',analog=False)
  7.  
  8. plt.figure()
  9.  
  10.  
  11. w, h = freqz(b, a, worN=8000)
  12. plt.subplot(2, 1, 1)
  13. plt.plot(0.5*fs*w/np.pi, np.abs(h), 'b')
  14. plt.plot(cutoff, 0.5*np.sqrt(2), 'ko')
  15. plt.axvline(cutoff, color='k')
  16. plt.xlim(0,20)
  17. plt.ylabel('Amplitude [dB]')
  18. plt.title("Highpass Filter Frequency Response")
  19. plt.xlabel('Frequency [Hz]')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement