25

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 ...


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 ...


16

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 simplest type of discrete-time (digital) LTI FIR filters which are defined through the fundamental arithmetic ...


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 ...


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

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 $...


8

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

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.


7

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$, ...


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 ...


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

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 ...


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

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

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

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 ...


5

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/...


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 ...


5

In general there is no straightforward analytical solution. As you know, you need to solve $$\left|H(e^{j\omega_c})\right|=\frac{1}{\sqrt{2}}\tag{1}$$ for $\omega_c$, where it is assumed that the maximum filter gain equals $1$. For Butterworth filters, the specified cut-off frequency always equals the $3\textrm{ dB}$ frequency. This is not the case for other ...


5

Yes Virginia, There is a perfect digital filter. I assume the OP means by "perfect filter" what we would typically call an "ideal filter": which is a filter that passes a finite block of frequencies with no alteration and completely removes all other frequencies, which is referred to as a "brick wall filter". Otherwise if the OP ...


4

You calculating FFT only from two samples. You need to pad your impulse response with zeros to get a valid result. So in MATLAB that would be: N = 1024; % Number of points to evaluate at % Create the vector of angular frequencies at one more point. % Filter itself b=[1,-1]; [h_f, w_f] = freqz(b, 1); figure grid on hold on plot(w_f, abs(h_f), 'or') % MATLAB ...


4

As I've mentioned in a comment, the Parks McClellan algorithm is usually used to design frequency selective filters with a fixed maximum stopband error, which results in an equiripple behaviour in the stopband. Note that the algorithm can in principle approximate any desired frequency response shape. However, many implementations just allow for piecewise ...


4

The book doesn't say that the impulse response must be zero for an ideal channel. It says that an ideal channel has exactly one, and not more than one, non-zero component, i.e. the ideal channel's impulse response is an impulse, which means that the signal is only delayed but not distorted.


4

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 ...


4

You made a minimum-phase filter but with a different magnitude response than the original linear phase filter. What you have to do to keep the magnitude the same is to reflect the zeros outside the unit circle into the circle. Since for linear phase filters the zeros are symmetrical with respect to the unit circle (or on the circle), you simply have to ...


4

You are almost right: digital filters do deal with samples, but a sample can be any numerical representation of a given signal value at a given instant (so in general, they may accept zeros or ones). Moreover, a sample is usually represented by a binary word (e.g. 0001), so a digital filter actually deals with 0s and 1s.


4

I don't think there really is some definitive minimum number of taps. It it pretty common to generate FIR filters by convex optimization, e.g. $$ \text{minimize} \ \text{max}\left(\left| H(\omega) \right|\right) \text{for all } \omega \text{ in the stopband} $$ $$ \text{subject to} \frac{1}{\delta} \leq \left| H(\omega) \right| \leq \delta \text{ for all } \...


4

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 ...


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