# Tag Info

## Hot answers tagged digital-filters

29

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 want to preserve you can tolerate and, most importantly, how narrow your transition from pass- to stopband (transition width) needs to be. I assume you want a ...

20

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 $\pi$ radians per sample. Now, consider two basic discrete-time (digital) filters which are defined through addition and subtraction of their input $x[n]$ for ...

17

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 closer $a$ is to 1, the tighter the notch (and the more digital precision needed to implement). This is of the form with a zero = 1, and a pole = $a$, where $a$ is ...

14

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 band $B_T=\frac{F_{stop}- F_{pass}}{F_s}$, $F_{stop}$ and $F_{pass}$ are the stop band and pass band frequencies in Hz and $F_s$ is the sampling frequency in ...

11

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 accomplished by transforming the complex variable $z$ in the transfer function of the prototype filter by a function $G(z)$ which satisfies $|G(e^{j\omega})|=1$, ...

9

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 implement a system with frequency response $$H(\omega)=1-H_{LP}(\omega)\tag{1}$$ where $H_{LP}(\omega)$ is the frequency response of the low-pass filter. Note that $... 9 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 equation, you get $$\frac{\alpha^2}{1-2(1-\alpha)\cos(\omega_c)+(1-\alpha)^2}=\frac12\tag{1}$$ which can be rearranged into the following quadratic equation: ... 8 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{\theta})z^{-1}\right)}\\ = \frac{a}{1 - 2r\cos(\theta)z^{-1} + r^2z^{-2}},$$ where$a$is a constant by which the magnitude frequency response can be normalized,$...

8

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/arithmetic/quantization noise may move a pole to the “wrong” side of the unit circle.) Where the numerical noise will blow up depends on your executable code’s exact ...

7

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 around these numbers for your actual design. One of the origin for Bellanger's design is: On computational complexity in digital filters, 1981, Proc. Eur. ...

7

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 an arbitrarily long time, or add up observations), they will get an output, and can through the magic of correlation get the impulse response.

6

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 satisfy $$H(\omega)\neq H^*(-\omega)\tag{2}$$ which causes its impulse response to be complex-valued. So the frequency response of a complex low pass filter is ...

6

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 equally, you weight the components. If you just wanted to smooth the signal you could weight each value used in the average by a Gaussian (bell) curve for ...

6

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 a duration as possible. This would suggest piecing together parabolas, matching the first derivatives at the joints. How to do this algorithmically will take ...

6

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 by derivatives. Sobel filters emulate such derivatives in one direction, and slightly average pixels in the complementary direction, to smooth small variations ...

6

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 this. Second, it is a good idea to split your filter in second-order-sections (SOS) and cascade them , this usually fix most issues. https://www.dsprelated.com/...

6

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})$. This works great for $\theta_n \in \mathbb{R}$. You want a low-pass filter that's defined on an interval that spans $360^\circ$. For reasons that will become ...

6

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 the group delay of the corresponding linear phase filter. If you use a least-squares criterion, this is equivalent to solving a system of linear equations. As ...

6

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 design (Butterworth, Chebyshev, Cauer) you start with an analog prototype lowpass filter. Bandpass or bandstop filters are then obtained by a frequency ...

5

it depends on how you map the analog filter to the digital filter and how the s-plane poles get mapped to the z-plane poles (ya know, the "bilinear transform" vs. "impulse invariant" vs. whatever else is out there). probably, if it were up to me, for the purpose of defining $Q$, i would map the poles as you would map $s$ to $z$ with $$z = e^{sT}$$ ...

5

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 filter is given by $$y[n]=\sum_{k=0}^{N-1}h[k]x[n-k]\tag{1}$$ where $h[n]$ are the filter coefficients (taps), or, equivalently, the filter's finite length ...

5

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. This provides a huge array of intuitive examples. But also, that there are basically two viewpoints. One is the abstract viewpoint, taken by modelling reality ...

5

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 they should be more like 0.9). But your numerator has its roots very near $z=1$, which corresponds to frequency 0 instead of the desired $\pi/4$ for implementing ...

5

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 frequency response, just the general shape to figure out the type of the filter. Method 1: Brute Force/Computer Assisted import scipy.signal as sp import numpy as ...

5

In this answer I'll try to show you how to qualitatively evaluate a given pole-zero plot by just looking at it. Of course, this method has its limits, but for relatively simple pole-zero plots you can very quickly decide on the type of the corresponding filter. You should know that for stable filters, the frequency response equals the transfer function \$H(z)...

5

The question is rather vague or inaccurate really; or I haven't understood it well. I would start with saying "there is no such a thing as a 'best' filter (for all use)". A filter is optimal only if it exploits a specific property of signal or noise generating better SNR over regular filter -but if you don't know about signal or noise specifically then ...

5

I don't have a concrete proof for this one. However, I can tell you this... Consider a perfect low pass filter. The time domain representation is a sinc. And for any system to have a sharp transition band, a base signal has to be multiplied with a rectangular waveform in the frequency domain. Which implies that, the time domain signal of the same has to be ...

5

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 options. One is a machine learning approach. e.g. create a training set by taking a bunch of data and hand marking the points that are good versus bad (like you've ...

5

More taps. You don't have anywhere near enough taps for a filter that steep. Start large with 8192 or so cut to desired accuracy, if needed Due to the low number of tabs you are seeing the effect of "circular" hilbert transform. See for example: http://andrewduncan.net/air/ How do you know you have zeros outside the unit circle? Calculating the roots of a ...

5

It is the objective of the receiver to make the best estimate for each symbol as to what was transmitted. This is often done by ultimately determining a decision time in each sample (through timing recovery) on the waveform after it has been processed by the receiver (equalization and matched filtering) in which to sample the waveform and make a decision as ...

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