Digital Filter Designer Back
DSP Tool

Digital Filter Designer (IIR/FIR)

Design Butterworth, Chebyshev Type I, and moving-average FIR filters. Visualize frequency response, filter coefficients, and test signal output in real time.

Parameters
Filter Type
Design Method
Sampling Rate f_s
Hz
Cutoff Frequency f_c
Normalized (0 to 0.5 × f_s)
Filter Order N
Results
-3dB Frequency
Stopband @ 2f_c [dB]
4
Filter Order
Group Delay [samples]
Phase Delay @ f_c
Magnitude Response [dB]
Phase Response [rad]
Test Signal (noisy sine wave) — Before & After Filter
Computing coefficients...
Theory & Key Formulas

Butterworth squared magnitude response:

$$|H(j\Omega)|^2 = \frac{1}{1+\left(\Omega/\Omega_c\right)^{2N}}$$

Bilinear transform (analog → digital):

$$s = \frac{2}{T}\frac{z-1}{z+1}$$

Group delay: $\tau_g(\omega) = -\dfrac{d\angle H(e^{j\omega})}{d\omega}$

Chebyshev Type I: equiripple passband enables steeper rolloff than Butterworth at the same order.

What is a Digital Filter?

🙋
What exactly is a digital filter, and why would I use one instead of an analog circuit?
🎓
Basically, it's a mathematical algorithm that processes a stream of numbers (your sampled signal) to remove unwanted parts. In practice, they're software-defined, so you can change a "Butterworth" to a "Chebyshev" filter instantly—no soldering required! Try changing the "Filter Type" dropdown in the simulator to see different design methods.
🙋
Wait, really? So the "Filter Order N" slider is like choosing how many components are in my imaginary circuit? What does a higher order do?
🎓
Exactly! A higher order (N) makes the filter's transition from passband to stopband much sharper. For instance, in an audio equalizer, a high-order filter can precisely cut bass without affecting mid-tones. Slide the "Filter Order N" control and watch the red frequency response line get steeper near the cutoff frequency.
🙋
I see the "Passband Ripple ε" parameter for Chebyshev filters. What's the trade-off there? Is ripple bad?
🎓
Great observation! Ripple is small, intentional wiggles in the passband. The trade-off is that for the same order N, a Chebyshev filter with ripple has a sharper cutoff than a flat Butterworth. A common case is in communication systems, where you accept a little ripple to better reject adjacent channel noise. Adjust ε in the simulator to see how ripple allows a steeper roll-off.

Physical Model & Key Equations

The core of an IIR (Infinite Impulse Response) filter design starts with an analog prototype. For a Butterworth filter, the goal is a maximally flat passband, described by its squared magnitude response in the analog (s) domain:

$$|H(j\Omega)|^2 = \frac{1}{1+\left(\Omega/\Omega_c\right)^{2N}}$$

Here, $\Omega$ is the analog frequency (rad/s), $\Omega_c$ is the cutoff frequency, and $N$ is the filter order. This equation shows why a higher $N$ makes the denominator grow faster, creating a sharper drop-off after $\Omega_c$.

Since we need a digital filter that runs on a processor, we must transform this analog design to the digital (z) domain. The Bilinear Transform maps the analog s-plane to the digital z-plane, preserving stability but warping the frequency axis:

$$s = \frac{2}{T}\frac{z-1}{z+1}$$

Here, $T$ is the sampling period ($1/f_s$). This substitution is applied to the analog transfer function $H(s)$ to get the digital $H(z)$. The warping effect is why you specify your digital cutoff frequency $f_c$ in the simulator—the tool automatically pre-warps the analog $\Omega_c$ to compensate.

Frequently Asked Questions

The horizontal axis represents frequency, and the vertical axis represents gain (dB). In the passband, the gain is around 0 dB, while in the stopband, it attenuates. The cutoff frequency is typically the point where the gain is -3 dB, and the slope (steepness) of the transition band can be used to judge the appropriateness of the filter order.
Butterworth has a flat passband with no ripple, making it suitable for applications requiring smooth frequency characteristics. Chebyshev Type I has ripple in the passband but offers a steeper cutoff characteristic for the same order. If ripple is acceptable, choose Chebyshev; if you want to avoid waveform distortion, choose Butterworth.
A larger number of taps N removes high-frequency noise more effectively, but it also slows the response and blunts sharp signal changes. Generally, set N larger relative to the period of the noise you want to remove. For example, to remove 50 Hz noise, adjust N based on the sampling frequency and confirm by checking the frequency response graph.
Yes, it is necessary. The bilinear transform introduces a nonlinear relationship between analog and digital frequencies, causing the cutoff frequency to shift. This tool automatically performs pre-warping to accurately reflect the specified cutoff frequency. No manual correction is needed.

Real-World Applications

Vibration & Acoustic Sensor Denoising: In industrial condition monitoring, sensors on motors pick up both the machine's vibration and background noise. A bandpass filter designed here can isolate the specific frequency of a bearing defect, allowing for early failure prediction.

Control System Signal Pre-processing: Feedback signals in robotics or flight control are often noisy. A low-pass filter with a carefully chosen cutoff frequency (using the $f_c$ and $f_s$ parameters) removes high-frequency sensor noise without introducing a lag that would destabilize the control loop.

Biomedical Signal Conditioning (ECG/EEG): An electrocardiogram (ECG) signal has crucial components below 100 Hz but is contaminated with 50/60 Hz powerline interference. A designer would use this tool to create a sharp notch filter or a high-order low-pass filter to clean the signal for diagnosis.

Audio Effect Prototyping: Before building hardware guitar pedals, audio engineers prototype "wah-wah" or equalizer effects digitally. They can quickly iterate by adjusting filter type, order, and cutoff in a simulator like this, hearing the effect in real-time on the test signal.

Common Misconceptions and Points to Note

First, there is a misconception that "a higher filter order N is always better." While increasing the order does sharpen the cutoff characteristics, the trade-off is significant. For IIR filters, phase distortion increases, and for FIR filters, computational load (the required number of taps) grows explosively. For example, when designing an FIR filter with a 1kHz sampling frequency and a 100Hz cutoff frequency, doubling the order from 100 to 200 also roughly doubles the processing delay. This can be fatal in control systems requiring real-time performance. You should start with a low order (around 4th to 8th order) and aim for a design that meets the minimum necessary performance.

Next is underestimating the sampling theorem. While it's obvious not to exceed the Nyquist frequency (half the sampling frequency) when setting the cutoff frequency in a tool, the issue lies in the "margin." For instance, with a 10kHz sampling frequency, the Nyquist frequency is 5kHz. If you try to remove a 4.8kHz signal here, there's almost no room to set the filter's transition band, requiring a very high-order filter. As a practical rule, you should ensure a sampling frequency at least 2 to 2.5 times higher than the maximum frequency you want to handle, building in design margin.

Finally, overlooking coefficient quantization error. The filter coefficients output by tools are high-precision, but when you actually implement them on a microcontroller or FPGA, they are represented using fixed-point or finite bit lengths. At this stage, if small coefficient values are rounded to "0," the intended characteristics can degrade significantly. This is especially risky for IIR filters due to their feedback, which can allow errors to accumulate or even diverge. After designing, make it a habit to re-quantize the coefficients with the intended bit length and always verify via simulation that the frequency response remains within acceptable limits.