Filtering signal with Python lfilter
问题 I'm new with Python and I'm completely stuck when filtering a signal. This is the code: import numpy as np import matplotlib.pyplot as plt from scipy import signal fs=105e6 fin=70.1e6 N=np.arange(0,21e3,1) # Create a input sin signal of 70.1 MHz sampled at 105 MHz x_in=np.sin(2*np.pi*(fin/fs)*N) # Define the "b" and "a" polynomials to create a CIC filter (R=8,M=2,N=6) b=np.zeros(97) b[[0,16,32,48,64,80,96]]=[1,-6,15,-20,15,-6,1] a=np.zeros(7) a[[0,1,2,3,4,5,6]]=[1,-6,15,-20,15,-6,1] w,h