33 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 ...
user avatar
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 $\...
user avatar
  • 26.8k
19 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 ...
user avatar
  • 37.7k
15 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 ...
user avatar
  • 37.7k
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 ...
user avatar
  • 32.6k
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 ...
user avatar
  • 8,646
11 votes
Accepted

Exponential weighted moving average time constant

If I understood you correctly, you want to compute the value of $\alpha$ that results in a specified 3dB cut-off frequency for an exponentially weighted moving average filter. If you square your last ...
user avatar
  • 80.4k
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 ...
user avatar
  • 80.4k
9 votes
Accepted

Is a high-passed signal the same as a signal minus a low-passed signal?

In general you can't simply subtract a low-pass filtered version of a signal from the original one to obtain a high-pass filtered signal. The reason is as follows. What you're actually doing is ...
user avatar
  • 80.4k
8 votes

Precise Centre frequency of an All-pole digital filter

For a filter consisting of a complex conjugate pair of poles, the $z$-domain transfer function is: $$H(z) = \frac{a}{\left(1-r(\cos{\theta}-i\sin{\theta})z^{-1}\right)\left(1-r(\cos{\theta}+i\sin{\...
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/...
user avatar
  • 34k
8 votes
Accepted

How Come the Low Pass Filter in Sobel Operator Isn't Normalized?

The answer is simple, the Sobel Filter is a composition of Lows Pass Filter (LPF) and High Pass Filter (HPF). The composition is done by convolution. Now, indeed the LPF presented above $ {\left[ 1, 2,...
user avatar
  • 41.4k
7 votes
Accepted

Complex low pass filters

A low pass filter has a frequency response that satisfies $$|H(\omega)|\approx 0,\quad |\omega|>\omega_c\tag{1}$$ where $\omega_c$ is the cut-off frequency. A complex low pass filter must also ...
user avatar
  • 80.4k
7 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 ...
user avatar
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 ...
user avatar
7 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],...
user avatar
  • 80.4k
6 votes
Accepted

Estimating an Image Filter from Examples

I will talk about the Linear Spatially Invariant (LSI) Model. Since the Filter (System) is LSI it can be described in the domain of Fourier Transform: $$ Y \left( \omega \right) = H \left( \omega \...
user avatar
  • 41.4k
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 ...
user avatar
  • 3,559
6 votes

Make a signal that fits another the best possible with a limitation in 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 ...
user avatar
  • 6,903
6 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 ...
user avatar
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 ...
user avatar
  • 3,620
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})$. ...
user avatar
  • 8,646
6 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 ...
user avatar
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 ...
user avatar
  • 80.4k
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 ...
user avatar
  • 80.4k
6 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 ...
user avatar
  • 80.4k
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 ...
user avatar
  • 80.4k
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. ...
user avatar
  • 10.1k
5 votes
Accepted

Problems with implementation of a band-stop filter on an MCU (dsPIC) using fixed-point arithmetic

The denominator (recursive coefficients Ai) look OK: the poles of your system are at 45 degree angles ($\pi/4$), with magnitude 0.68 (which is not very aggressive for a notch filter; in my opinion ...
user avatar
  • 4,721
5 votes
Accepted

determining type of filter given its pole zero plot

You'd have to figure out the frequency response of the filter. Here are two methods. I prefer Method 2 because it's quick and dirty, and you don't really care about the exact gain values in the ...
user avatar
  • 4,014

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