# Tag Info

40

OK, I'll try to answer your questions: Q1: the number of taps is not equal the to the filter order. In your example the filter length is 5, i.e. the filter extends over 5 input samples [$x(n), x(n-1), x(n-2), x(n-3), x(n-4)$]. The number of taps is the same as the filter length. In your case you have one tap equal to zero (the coefficient for $x(n-1)$), so ...

28

When choosing one of these 4 types of linear phase filters there are mainly 3 things to consider: constraints on the zeros of $H(z)$ at $z=1$ and $z=-1$ integer/non-integer group delay phase shift (apart from the linear phase) For type I filters (odd number of taps, even symmetry) there are no constraints on the zeros at $z=1$ and $z=-1$, the phase shift ...

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

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

23

Digital filter design is a very large and mature topic and - as you've mentioned in your question - there is a lot of material available. What I want to try here is to get you started and to make the existing material more accessible. Instead of digital filters I should actually be talking about discrete-time filters because I will not consider coefficient ...

21

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

21

Let me add the following graphic to the great answers already given. When a filter has linear phase, then all the frequencies within that signal will be delayed the same amount in time (as described mathematically in Fat32's answer). Any signal can be decomposed (via Fourier Series) into separate frequency components. When the signal gets delayed through ...

19

The frequency response for the filter designed using the butter function is: But there is no reason to limit the filter to a constant monotonic filter design. If you desire a higher attenuation in the stopband and steeper transition band, other options exist. For more information on specifying a filter using iirdesing see this. As shown by the frequency ...

19

You could use a 2nd order IIR notch filter as I describe in this post Transfer function of second order notch filter - That post demonstrates a 50 Hz IIR notch with 1 KHz sampling. [Update: As @user47050 astutely points out in the comments, the IIR notch would also have minimal delay regardless of notch bandwidth, since the dominat delay in the IIR notch ...

18

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

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

If you want the gain of your length-$N$ filter to be unity at a particular frequency, then you can calculate it directly: $$G = \sum_{k=0}^{N-1} h[k] e^{-j\omega k}$$ $G$ gives the gain of your filter at the frequency $\omega \in [0, 2\pi)$. If you would like to normalize the filter so that its gain at that frequency is $1$, then divide all of the filter ...

14

This is only a partial answer, but there's a lecture online where Hamming talks about how he came up with his eponymous window. Starting at roughly 15:15 gives the full context. With a reasonably entertaining story, he credits John Tukey with inventing the theory of windows (for spectrum analysis). However, he introduces the whole subject in the context of ...

14

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

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

14

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

14

My favorite "Rule of thumb" for the order of a low-pass FIR filter is the "fred harris rule of thumb": $N=[f_s/delta(f)]*[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 atten(dB) is the target rejection in dB For example if you have a transition band of 100 Hz in a system sampled at 1KHz,...

12

Windowing is used because the DFT calculations operate on the infinite periodic extension of the input signal. Since many actual signals are either not periodic at all, or are sampled over an interval different from their actual period, this can produce false frequency components at the artificial 'edge' between repeated intervals, called leakage. By first ...

12

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

12

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 In reviewing fred harris Figures of Merit for various windows (Table 1 in this link) the Hamming is compared to the Hanning (Hann) at various values of$\alpha$and from that it is clear that the Hanning would provide greater stopband rejection (The classic Hann is with$\alpha =2$and from the table the side-lobe fall-off is -18 dB per octave). I provided ... 11 I think you are confusing two different operations. Windowing in the time domain is explained by @sam, so I won't repeat that. But windowing is not done to perform filtering. Filtering by multiplying the FFT of a signal by the filter frequency response is entirely reasonable in many situations, and is indeed done. The alternative for filtering is time-... 11 There have been several good answers to this question. However, I feel that one important point has not been made entirely clear. One part of the question was why we don't just multiply the FFT of a signal with the desired filter response. E.g., if we want to lowpass filter our signal, we could simply zero all frequency components higher than the desired cut-... 11 All digital filter frequency parameters (passband begin frequency, passband end frequency, and stopband begin frequency) are stated in terms of an input signal sequence's Fs sampling frequency. For a lowpass filter example, if I said a lowpass filter's passband width (it's "cutoff" frequency) is 0.2, I'm saying that the cutoff frequency is 0.2 times Fs. So ... 11 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\$ ...

10

Here is another partial answer, mostly about designing custom windows. I came up with this while doing something that (as I know now but didn't then) is called "windowing in the frequency domain." Then, after reading some original papers on windowing, I figured that it was probably the way that some windows were conceived in the first place, but I don't have ...

9

To get started: Complex numbers The frequency response of a filter is easier to understand complex-valued, describing both the magnitude frequency response and the phase frequency response. You will be able to understand poles and zeros, which can be complex. Complex numbers enable you to have negative frequencies, which will make math simpler. ...

9

Yes, it is called acoustic communications. Here is an example of a paper that uses orthogonal frequency division multiplexing (OFDM) in an underwater acoustic channel. EDIT: Note that you wouldn't call it a SONAR any more because SONAR stands for SOund Navigation And Ranging, whereas this is a communication system, just like you wouldn't call your cell ...

9

This is an uncertainty principle kind of problem: there is no way to make a reliable filter with little delay that will suppress a narrow band around 50Hz since the narrowness of a criterion in frequency space necessitates a certain width of observation in the time domain. Basically the compactness of a phenomenon in time and in frequency cannot be ...

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