Skip to main content
Share Your Experience: Take the 2024 Developer Survey
39 votes
Accepted

How many taps does an FIR filter need?

Citing Bellanger's classic Digital Processing of Signals – Theory and Practice, the point is not where your cut-off frequency is, but how much attenuation you need, how much ripple in the signal you ...
Marcus Müller's user avatar
23 votes
Accepted

Transfer function of second order notch filter

For digital notch filters, I like to use the following form for a notch filter at DC ( $ \omega $=0): $$ H(z) = \frac{1+a}{2}\frac{(z-1)}{(z-a)} $$ where $a$ is a real positive number < 1. The ...
Dan Boschen's user avatar
  • 51.9k
21 votes
Accepted

Why do digital filters work?

Consider a discrete-time input signal of the form: $$ x[n] = \cos(\omega_0 n) ~~~,~~~-\infty < n < \infty, ~~~~~ n\in \mathcal{Z}$$ where the radian frequency $\omega_0$ is set between 0 and $\...
Fat32's user avatar
  • 28.3k
17 votes

How many taps does an FIR filter need?

For a quick and very practical estimate, I like fred harris' rule-of-thumb: $$ N_{taps} = \frac{Atten}{22*B_T}$$ where: Atten is the desired attenuation in dB, $B_T$ is the normalized transition ...
Dan Boschen's user avatar
  • 51.9k
12 votes

What is the maximum output of an IIR filter?

I would like to know,if there is any way to estitmate what could be the maximum limits of the output Yes. It's $$y_{max} = x_{max} \cdot \sum_{n = 0}^{\infty} |h[n]| $$ I.e. the maximum gain is the ...
Hilmar's user avatar
  • 45.3k
12 votes
Accepted

Why don't unit circle poles lead to infinite amplitude response for Butterworth lowpass?

You've made an understandable mistake. You are probably looking at this picture: That is not the unit circle, and it isn't even in the $z$ domain. What you are looking at is the locations of the ...
TimWescott's user avatar
  • 12.8k
11 votes

Digital filter coefficients from low-pass to high-pass

You can apply a so-called all-pass transformation to a discrete-time low-pass prototype filter in order to convert it to other standard filters (such as high-pass, band-pass, and band-stop). This is ...
Matt L.'s user avatar
  • 90.3k
10 votes
Accepted

High Dynamic Range FIR Filters

Like @MattL. and @aconcernedcitizen say, the issue is numerical. Python's scipy.signal.firls uses internally the solver ...
Olli Niemitalo's user avatar
9 votes

Half power frequencies is -6dB or -3dB

The definition of the cut-off frequency is arbitrary. Different design methods use different definitions. If you define the cut-off at $-6\textrm{ dB}$, it means that the amplitude of a sinusoidal ...
Matt L.'s user avatar
  • 90.3k
8 votes

How many taps does an FIR filter need?

Adding to the accepted answer, a few additional references. I won't write the formulas which can be involved. Those formulae mostly yield rule-of-thumbs or approximations to start from. You can fiddle ...
Laurent Duval's user avatar
8 votes
Accepted

What is the largest "safe" order for the digital Butterworth filter of a given signal?

One cause is that higher order Butterworth filters have poles closer to the unit circle. This nearby infinite gain point increases the likelihood of numerical instabilities. (e.g. rounding/...
hotpaw2's user avatar
  • 35.4k
8 votes
Accepted

What's Logic Behind the Construction of Sobel's Filter in Image Processing?

A first rationale is to be very short, as there was a time when computing on images was expensive. Then, a contour or an edge often present a fast variation in image intensities, that can be enhanced ...
Laurent Duval's user avatar
8 votes
Accepted

3 dB cut-off frequency of first-order IIR high-pass filter

A discrete-time first-order high pass filter with unity gain at Nyquist and a zero at DC is described by the following difference equation: $$y[n]=\frac{1+\alpha}{2}\big(x[n]-x[n-1]\big)+\alpha y[n-1],...
Matt L.'s user avatar
  • 90.3k
8 votes
Accepted

Take FFT of audio represented in PDM

In a PDM microphone, the sigma-delta convertor pushes the noise to frequency regions above the 0-20kHz spectrum. So if you'd take the FFT of the signal that comes directly from the PDM microphone, the ...
Tom Verbeure's user avatar
7 votes

Curve Fit of Step Function with Boundary on the 2nd Derivative

Hmmmmmmmmm, interesting question. Since you want to use the second derivative as your criteria, it would seem that you would want to have the maximum second derivative absolutie value for as short of ...
Cedron Dawg's user avatar
  • 7,560
7 votes
Accepted

Protect an IIR filter from being reverse-engineered

Short answer: You can't. If an attacker can insert a signal that covers the whole bandwidth (e.g. a white signal, or at least one that has no spectral zeros) into the system (and he can do that over ...
Marcus Müller's user avatar
7 votes

Filter odd or even harmonics with notch or inverse notch filter

What you are looking for are what we, in the audio space, call comb filters. Comb filters may or may not have a feedback path, just like FIR and IIR filters. In fact, there is a generalized theory ...
robert bristow-johnson's user avatar
7 votes

High Dynamic Range FIR Filters

The problem lies in the formulation of the desired response, and especially in the "don't care" region, which is extremely wide for the chosen filter length. Even though I can't give any ...
Matt L.'s user avatar
  • 90.3k
6 votes

Why do digital filters work?

You have probably used filtering a lot already. A moving average is a filter! Think of general filtering as performing a fancy moving average where instead of averaging every component in a window ...
geometrikal's user avatar
  • 3,616
6 votes
Accepted

What Is the Transfer Function of a Moving Average (FIR Filter)?

The frequency response of the moving average is called the asinc or psinc, the aliased sinc or periodic sinc (sinc for cardinal sine), or the Dirichlet function. Since the sum of the moving average ...
Laurent Duval's user avatar
6 votes

Detect valleys of a signal

First, you'll probably have better luck posting this on dsp.stackexchange. That's a more specialized group that does stuff like this all the time. In terms of your problem, here's a couple of ...
Daniel K's user avatar
  • 309
6 votes

Numerically Stable IIR filter

First of all, what is the order of your IIR filter? The highest order I have ever used was an order-10 IIR filter for a control loop application. I feel like it is unlikely that you need more that ...
Ben's user avatar
  • 3,777
6 votes

Filtering Angular Measurements

If a first-order IIR will do, modify that slightly, and you're done. So the usual first-order low-pass filter can be defined as $y_n = h(\theta_n)$ such that $y_n = y_{n-1} + a(\theta_n - y_{n-1})$. ...
TimWescott's user avatar
  • 12.8k
6 votes
Accepted

Designing digital low pass filter with low pass-band group delay

Minimum phase filters will not give you a near constant group delay. You can design a non-linear phase FIR filter with a linear desired passband phase with a specified group delay that is smaller than ...
Matt L.'s user avatar
  • 90.3k
6 votes

OFDM use a pulse shaping filter or not?

The purpose of pulse shaping filters is not to overcome ISI as is implied in the OP's question. The only reason for using a pulse shaping filter is spectral efficiency, and in the process ISI can be ...
Dan Boschen's user avatar
  • 51.9k
6 votes

Why must the order of a Band-Pass and Notch filter always be even?

In principle there is no reason why the filter order of a general bandpass or bandstop filter must be even. Such a restriction is a consequence of a specific design procedure. In classic IIR filter ...
Matt L.'s user avatar
  • 90.3k
6 votes

Filter odd or even harmonics with notch or inverse notch filter

If the OP is actually interested in selecting only one individual frequency from the even or odd harmonics, then a moving average filter (MAF) would be ideal since this can provide a null at every ...
Dan Boschen's user avatar
  • 51.9k
6 votes

Series vs Parallel Biquad Filters

It really depends on your filter. In my experience serial is has almost always the potential to be better. The reason for this is quite simple. The parallel representation is unique. There is one ...
Hilmar's user avatar
  • 45.3k
5 votes

Why do digital filters work?

To the useful answers that have been added so far, I would like to add, on the point of intuition, that filtering works because it is based on Wave theory and specifically, the interaction of waves. ...
A_A's user avatar
  • 10.7k
5 votes

Why do digital filters work?

I think you're looking for intuition as to why you get a certain frequency domain behavior when computing a weighted sum of input samples. As you know, the output signal of a causal length $N$ FIR ...
Matt L.'s user avatar
  • 90.3k

Only top scored, non community-wiki answers of a minimum length are eligible