Digital Low Pass Butterworth Filter in Python
In this article, we are going to discuss how to design a Digital Low Pass Butterworth Filter using Python. The Butterworth filter is a type of signal processing filter designed to have a frequency response as flat as possible in the pass band. Let us take the below specifications to design the filter and observe the Magnitude, Phase & Impulse Response of the Digital Butterworth Filter.
The specifications are as follows:
- Sampling rate of 40 kHz
- Pass band edge frequency of 4 kHz
- Stop band edge frequency of 8kHz
- Pass band ripple of 0.5 dB
- Minimum stop band attenuation of40 dB
We will plot the magnitude, phase, and impulse response of the filter.
Step 1: Importing all the necessary libraries.
Step 2: Define variables with the given specifications of the filter.
Step3: Building the filter using signal.buttord function.
Step 4: Plotting the Magnitude Response.
Step 5: Plotting the Impulse Response.
Step 6: Plotting the Phase Response.
Below is the complete program based on the above approach:
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning – Basic Level Course