Bandpass Filter Design
restart:
This transfer function defines the response of a Bandpass filter.
G≔sR Cs2+sR C+1L C:
The product L C controls the bandpass frequency while R C controls how narrow the passing band is. To build a bandpass filter tuned to the frequency 1 rad/s, set L=C=1 and use R to tune the filter band.
First define a transfer function object.
withDynamicSystems:
sysTF≔TransferFunctionG
sysTF≔Transfer Functioncontinuous1 output(s); 1 input(s)inputvariable=u1⁡soutputvariable=y1⁡s
Now generate a Magnitude plot
MagnitudePlotsysTF,size=800,400,parameters=R=1,L=1,C=1,background=ColorTools:-ColorRGB,221/255,231/255,240/255,thickness=0
As expected, the RLC filter has maximum gain at the frequency 1 rad/s. However, the attenuation is only -10dB half a decade away from this frequency. To get a narrower passing band, try increasing values of R.
MagnitudePlotsysTF,size=800,400,parameters=R=20, L=1,C=1,background=ColorTools:-ColorRGB,221/255,231/255,240/255,thickness=0
The resistor value R=20 gives a filter narrowly tuned around the target frequency of 1 rad/s.
We can confirm the attenuation properties of the circuit (R=20) by simulating how this filter transforms sine waves with frequency 0.9, 1, and 1.1 rad/s.
Create two response plots for the filter at R=20 with two inputs: sin(0.9 t) and sin(t).
p1≔ResponsePlotsysTF,sin0.9⋅t,duration=100, parameters=R=20,L=1,C=1:
p2≔ResponsePlotsysTF,sint,duration=100, parameters=R=20,L=1,C=1,color=black:
plots:-displayp1,p2
Download Help Document