DSPRelated.com
Forums

FIR filter and time delay

Started by Ross Clement (Email address invalid - do not use) February 15, 2006
On Wed, 15 Feb 2006 10:58:47 -0500, Jerry Avins <jya@ieee.org> wrote:

>Ross Clement (Email address invalid - do not use) wrote: >> Hi. I note that a suitably designed FIR filter with N coefficients can >> have a time-delay of N/2 (or is it (N-1)/2?). > >All symmetric FIR filters with the same number of taps operating at the >same sample rate have the same delay: (N-1)/2.
(snipped) Hi jerry, I'm beginning to think that maybe we should say that the time delay though a symmetrical (or antisymmetrical) tapped-delay line FIR filter is # of delay elements time delay = ----------------------- . 2 I say that because if some of the filter's coefficients are zero-valued (like half-band filters, comb filters, & some differentiators) then we could have far fewer "taps" than the "number of delay elements" in a filter's delay line. For example, a comb filter with 8 delay elements has only two taps, but it's time (group) delay is 4 samples. Any thoughts? [-Rick-]
Rick Lyons wrote:
> On Wed, 15 Feb 2006 10:58:47 -0500, Jerry Avins <jya@ieee.org> wrote: > > >>Ross Clement (Email address invalid - do not use) wrote: >> >>>Hi. I note that a suitably designed FIR filter with N coefficients can >>>have a time-delay of N/2 (or is it (N-1)/2?). >> >>All symmetric FIR filters with the same number of taps operating at the >>same sample rate have the same delay: (N-1)/2. > > > (snipped) > > Hi jerry, > > I'm beginning to think that maybe we should say > that the time delay though a symmetrical (or antisymmetrical) > tapped-delay line FIR filter is > > # of delay elements > time delay = ----------------------- . > 2 > > I say that because if some of the filter's coefficients > are zero-valued (like half-band filters, comb filters, > & some differentiators) then we could have far fewer "taps" > than the "number of delay elements" in a filter's > delay line. > > For example, a comb filter with 8 delay elements > has only two taps, but it's time (group) delay > is 4 samples. > > Any thoughts?
You can always count on me for a philosophical opinion. That doesn't mean it's worth much. <Preamble> # of delay elements # of delay elements -1 Whether time delay = -------------------- or ----------------------- 2 2 depends on how one conceives of the circuit's or program's functioning. Coming from a hardware background, I tend to think in terms of the second. A sample appears at the output as soon as it is clocked into a shift register, so the first delay element has no delay measured in clocks. With that view, a filter with an odd number of delay elements has a delay measured in integer samples, while an even number of elements counts as "and a half". </Preamble> Again from a hardware point of view, delay lines are made either with chains of flip-flops, or cascades of series inductors and shunt capacitors. In either case, there is a tap available for each element, whether or not we choose to use it. When I say "tap", I think "tapping point". I know that's wrong, and I'll reform if you think my use is misleading. A recognize that I can tap a pipe anywhere along its length with a saddle valve, but I see delay lines as pipes as much as I do of chains; literally, concatenations. With a half-band filter, the MAC can run through the data buffer with a stride of 2, so the unused taps disappear. The data, however, are still there. I see them as available to be looked at; that's admittedly fuzzy. Shall I reform? Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;

Ross Clement (Email address invalid - do not use) wrote:
> Thanks Bob. > > As a folllow-up question, could I use that FFT method to do the > following? Imagine that I have a filter implementation, perhaps an IIR > filter or even an analogue filter. I then calculate or measure the > impulse response of the filter up to a "sufficient" length. I then take > the FFT of that, zero the phases, and then inverse FFT and shift to get > the coefficients of an FIR filter with approximately the same frequency > response as the original IIR or analogue filter, but zero phase?
Yes, if you mean magnitude response by frequency response. I'd take issue with the term zero phase, though, as I don't know what that means. What results from the above is a linear phase filter which has has same group delay for all frequencies, half the filter length. This procedure may leave small transitions at the edges. What I do in that case is apply a linear fade to the first and last small percentage of the total length. This leaves the magnitude response within a small fraction of a dB from the original. If this is for audio, however, I'd go instead for a minimum phase filter and there is another algorithm, a bit more complicated but with a small Matlab implementation, which takes any IR as input and returns the minimum phase IR with the same magnitude response. I find that for audio purposes minimum phase sounds more natural. Our ear/brain is used to that kind of filtering due to natural mechanisms but it is completely naive about linear phase filters since nature can't provide them. Bob -- "Things should be described as simply as possible, but no simpler." A. Einstein