Hot answers tagged

40

filtfilt is zero-phase filtering, which doesn't shift the signal as it filters. Since the phase is zero at all frequencies, it is also linear-phase. Filtering backwards in time requires you to predict the future, so it can't be used in "online" real-life applications, only for offline processing of recordings of signals. lfilter is causal forward-in-time ...


33

Let me add the following graphic to the great answers already given, with the intention of a specific and clear answer to the question posed. The other answers detail what linear phase is, this details why it is important in one graphic: When a filter has linear phase, then all the frequencies within that signal will be delayed the same amount in time (as ...


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


27

We know that in general transfer function of a filter is given by: $$H(z)=\dfrac{\sum_{k=0}^{M}b_kz^{-k}}{\sum_{k=0}^{N}a_kz^{-k}} $$ Now substitute $z=e^{j\omega}$ to evaluate the transfer function on the unit circle: $$H(e^{j\omega})=\dfrac{\sum_{k=0}^{M}b_ke^{-j\omega k}}{\sum_{k=0}^{N}a_ke^{-j\omega k}} $$ Thus this becomes only a problem of ...


25

A linear phase filter will preserve the waveshape of the signal or component of the input signal (to the extent that's possible, given that some frequencies will be changed in amplitude by the action of the filter). This could be important in several domains: coherent signal processing and demodulation, where the waveshape is important because a ...


24

FIR filters contain as many poles as they have zeros. but all of the poles are located at the origin, $z=0$. because all of the poles are located inside the unit circle, the FIR filter is ostensibly stable. this is probably not the FIR filter the OP is thinking about, but there is a class of FIR filters called Truncated IIR filters (TIIR) which may have a ...


21

To understand the linearity property more easily.Let us consider the above diagram,here we have 2 sequences namely Xn and Yn. when we add both the sequence we get Xn+Yn whose amplitude value are represented with blue colour. when any system which satisfy this condition then it is called linear. In case of mean filter, mean value for sequence Xn is 1+1+3/3=5/...


20

I found this video to be very, very helpful (it elaborates on Matt's answer). Here are some key ideas from the video: Zero-phase will result in no phase distortion, but will result in a non-causal filter. This means that if the data is being filtered as it's gathered, this will not be an option (only valid for stored data which we can post-process). When ...


19

There are a lot of books out there, but if you are interested in Control and Signal Processing, I strongly suggest you take a look a Stephen Boyd Lectures from standford: http://www.youtube.com/watch?v=bf1264iFr-w There's the first one, the entire course is really valuable and he is a great Teacher. Appart from That here's a good list of my preferred ...


19

Nonlinear filters are those for which the linearity relationship breaks down. Consider two signals $A$ and $B$, for linear filter such as mean filter $F_m$,you have $F_m(A+\lambda B) = F_m(A) + \lambda F_m(B)$, but the equation is not satisfied for an nonlinear filter such as the median filter. In application, the median filter removes outliers and shot ...


19

This is the FIR filter, although it looks like an IIR. If you calculate the coefficients you get finite impulse response: $h=[1]$ This happens due to zero-pole cancellation: $Y(z)-0.5Y(z)z^{-1}=X(z)-0.5X(z)z^{-1}$ $H(z)=\dfrac{Y(z)}{X(z)}=\dfrac{1-0.5z^{-1}}{1-0.5z^{-1}}=1 $ Yes, it can be tricky. Seeing $y[n-k]$ coefficients in LCCDE (Linear Constant ...


19

Just to add to what's already been said, you can see this intuitively by looking at the following sinusoid with monotonically increasing frequency. Shifting this signal to the right or left will change its phase. But note also that the phase change will be larger for higher frequencies, and smaller for lower frequencies. Or in other words, the phase ...


18

Jojek's answer is of course correct. I would just like to add some more information because much too often have I seen the terms "IIR" and "recursive" confused. The following implications always hold: $$\begin{align}\text{IIR}& \Longrightarrow\text{recursive}\\ \text{non-recursive}&\Longrightarrow\text{FIR}\end{align}$$ i.e. every IIR filter (i.e. ...


18

Roughly speaking, they are the amount of noise in your system. Process noise is the noise in the process - if the system is a moving car on the interstate on cruise control, there will be slight variations in the speed due to bumps, hills, winds, and so on. Q tells how much variance and covariance there is. The diagonal of Q contains the variance of each ...


18

My favorite "Rule of thumb" for the order of a low-pass FIR filter is the "fred harris rule of thumb": $$ N=\frac{f_s}{\Delta f}\cdot\frac{\rm atten_{dB}}{22} $$ where $\Delta f$ is the transition band, in same units of $f_s$ $f_s$ is the sample rate of the filter $\rm atten_{dB}$ is the target rejection in dB For example if you have a ...


17

Suppose that a linear filter has impulse response $h(t)$ and frequency response/transfer function $H(f) = \mathcal F [h(t)]$, where $H(f)$ has the property that $H(-f) = H^*(f)$ (conjugacy constraint). Now, the response of this filter to complex exponential input $x(t) = e^{j2\pi f t}$ is $$y(t) = H(f)e^{j2\pi f t} = |H(f)|e^{j(2\pi f t + \angle H(f))}$$ ...


16

I agree that the windowing filter design method is not one of the most important design methods anymore, and it might indeed be the case that it is overrepresented in traditional textbooks, probably due to historical reasons. However, I think that its use can be justified in certain situations. I do not agree that computational complexity is no issue ...


15

"Can you mathematically show that FIR filters have poles, because I'm not seeing it." – Jim Clay can we assume this FIR is causal? filter order is $N$. number of taps is $N+1$ the Finite Impulse Response: $ \quad h[n] = 0 \quad \forall \quad n>N, \ n<0$ transfer function of the FIR: $$ \begin{align} H(z) & = \sum_{n=-\infty}^{+\infty} h[n] ...


15

this is just an addendum to jojek's answer which is more general and perfectly good when double-precision math is used. when there is less precision, there is a "cosine problem" that crops up when either the frequency in the frequency response is very low (much lower than Nyquist) and also when the resonant frequencies of the filter are very low. when you ...


15

The essence and importance of linear phase property lies in the definition and the effect of group delay $$\tau(\omega) = - \frac {d\phi(\omega)}{d\omega}$$ on the applied signal $x[n]$, where $\phi(\omega)$ is the phase response of the filter; (phase of its frequency response). Assume that a filter, with a fixed group delay of $n_0$ samples, is applied a ...


15

The discrete recurrence relation given on the linked page is $y[n] = (1-\alpha)y[n-1] + \alpha x[n]$ with $x[n]$ being the input samples and $y[n]$ being the output samples. So taking the Z-transform $Y(z) = (1-\alpha)z^{-1}Y(z) + \alpha X(z)$ $H(z) = \dfrac{Y(z)}{X(z)}= \dfrac{\alpha}{1-(1-\alpha)z^{-1}}$ To find the -3 dB corner of the filter, in terms of ...


15

The given single-pole IIR filter is also called exponentially weighted moving average (EWMA) filter, and it is defined by the following difference equation: $$y[n]=\alpha x[n]+(1-\alpha)y[n-1],\qquad 0<\alpha<1\tag{1}$$ Its transfer function is $$H(z)=\frac{\alpha}{1-(1-\alpha)z^{-1}}\tag{2}$$ The exact formula for the required value of $\alpha$ ...


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


13

Your question is a bit harsh, because it's kind of vague. I will give you a few points, maybe it will help. What's the same? The intuitions behind both bilateral filtering and anisotropic diffusion are the same: averaging is good to remove random noise; averaging should only concern pixels that belong to the same region (in the sense that they are pixels ...


13

Intuition: The intuition is this: Your noise is some event or events that are rare, and that when compared to other events, look like outliers that shouldn't really be there. For example, if you are measuring the speeds of every car on the highway as they pass by you and plot them, you will see that they are usually in the range of say, $50$ mph to $70$ ...


13

There's a good overview article which appeared in 1996 in the IEEE Signal Processing Magazine: Splitting the unit delay: tools for fractional delay filter design. The nice thing about it is that there's also a set of related Matlab files available. These routines will allow you to design such a system. As for shifting by an integer number of samples, what ...


13

I can recommend you two books about DSP for C language. Embree P. M. - C Language Algorithms for Digital Signal Processing It is old and you can easily get it second-hand for a decent price. It covers pretty much all 4 topics that you described. The other one I recommend is: Malepati H. - Digital Media Processing: DSP Algorithms Using C It covers ...


13

The answer to this question is already been explained clearly in the previous replies. Yet I wish to give it a try to present a mathematical interpretation of the same Consider a linear time invariant System whose frequency response is governed by $H(w)$. i.e if the input to this system is $e^{jw_{0}t}$ the output will be $H(w_{0})e^{jw_{0}t}$ Here $H(w_{...


12

FIR filters contain only zeros and no poles. If a filter contains poles, it is IIR. IIR filters are indeed afflicted with stability issues and must be handled with care. EDIT: After some further thought and some scribbling and google-ing, I think that I have an answer to this question of FIR poles that hopefully will be satisfactory to interested parties....


12

Usually, a complementary filter (like a complementary function) complements another filter. The two filters that are complementary to each other add to one. Or, at least, add to an all-pass filter (which is what Linkwitz-Riley crossovers do. so either $$ H(f) + G(f) = 1 $$ or $$ H(f) + G(f) = A(f) $$ for $H(f)$ and $G(f)$ being complements of each ...


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