"Fred Marshall" <fmarshallx@remove_the_x.acm.org> wrote in message news:<gIOdnQA6NcVBo_ncRVn-vQ@centurytel.net>...
> "Rune Allnor" <allnor@tele.ntnu.no> wrote in message
> news:f56893ae.0410052220.4fc1b189@posting.google.com...
> > "Fred Marshall" <fmarshallx@remove_the_x.acm.org> wrote in message
>
> ...............................
>
> >
> >> I would have said that a FIR filter needs to have enough frequency
> >> samples
> >> (when you FFT the coefficients without padding) to be able to define the
> >> transition you require with those samples.
> >
> > Agreed, but this does not necessarily relate to the number of filter taps.
> > A symmetric FIR filter with 5 taps can have two zeros arbitrarily close
> > at the unit circle. Whether such a filter is *useful* for anything, is
> > another matter. But that's beside the point. There is more to it.
>
> Rune,
>
> Well, maybe I should be more precise and say "the number of FIR filter
> coefficients" (which would include coefficients with values of zero and not
> be confused with the number of "taps" which might not include count of the
> zeros).
Ah, that's a distinction I did not make. I was talking about a FIR filter
of length 5 with coefficients h[0] - h[4] non-zero, on the general form
H(w) = (1-exp(jw_n))(1-exp(-jw_n))(1-exp(j(w_n + e)))1-exp(-j(w_n + e)))
where e is an arbitrarily small offset.
> And, I'd not include zero padded zeros in the count - except maybe
> one.
>
> Let me "derive" what I was talking about:
>
> Start with a filter of length N (N includes zero coefficients) and sample
> interval T so that fs=1/T and the temporal length is (N-1)*T ... except that
> if we assume it's periodic then the period is of length N*T.
> Compute the DFT of the filter.
> The DFT repeats at fs=1/T
> The span from zero to fs is divided into N spaces of interval 1/NT Hz which
> is the reciprocal of the temporal length of the filter.
OK...
> Now, if we have these spectral samples located 1/NT apart then the
> construction of a transition would, shall we say, have a pair of adjacent
> samples being 1.0 and 0 respectively. We can define transistions similar to
> this:
> (I'm defining "transition" as in the common sense that it goes from stop
> band to pass band or vice versa. In other words, a "step" in the desired
> frequency response.)
>
> [..... 1.0 0 .....] spanning 1/NT Hz
> [..... 1.0 0.5 0 .....] spanning 2/NT Hz
> [..... 1.0 0.66 0.33 0 .....] spanning 3/NT Hz
OK
> But, because of the spacing of the spectral samples, there is no way to
> define a transition over 1/2*NT Hz. We can't construct a sequence that will
> do that because we don't have samples to define at that spacing.
I'm not sure I understand what you sy here. f=Fs/2 is a problem with
real-valued signals due to aliasing and all that. The problem disappears
at Fs/2 for complex-valued signals, but a similar problem occurs at Fs.
This is a degenrate situation that I think we can leave out of the
discussion.
> Well, that was the argument that I used because we're talking about
> designing a filter in the frequency domain - or filter features in the
> frequency domain - and having only so many points to deal with - which
> really gets to the number of degrees of freedom we have to work with.
> If we compute the continuous frequency response of a filter then there's a
> lot of detail we can *see* that isn't in our *control* so to speak.
I agree. The more degrees of freedom, the more control we have.
> Example: if we compute the frequency response of a length 5 filter using
> 5,000 points in frequency between zero and fs, then we'll see lots of
> wiggles - but the fact is that we can only control things so much. If we
> design an optimum length 5 minimax filter then there will be 6 degrees of
> freedom: the 5 coefficients and the magnitude of the peak error. This is
> very much related to our ability to achieve transitions of some width or
> another.
I'm not sure I follow you. I have done some tests wyth the type of
filters I showed above. The frequency response of an order 4 filter as
above, will be smooth when plotted after, say, 1024 pt zero padding.
Except for plotting artifacts, I see no wiggle in the response?
> Maybe this will help:
>
> Usually when we design a filter in the frequency domain - as in
> Parks-McClellan - we are using sines and cosines as the basis functions.
> Well, cosines in some Cases and sines in other Cases because the filters
> there are symmetric / antisymmetric.
>
> It's an obscure fact that we can depart from using cosines and switch to
> using a family of shifted sincs or Dirichlet kernels. By superposition it's
> exactly the same thing as a sum of cosines. However, using the shifted and
> equally spaced sincs gives us some interesting insights. It's much easier
> to visualize the construction of the filter response using shifted and
> equally spaced sincs. This is satisfying because it looks the same as
> convolving the filter spectral samples with a sinc - which is the dual of
> time-limiting the filter. The convolution of course becomes a discrete sum
> of shifted, equally spaced sincs. Some will note the similarity to the
> windowing method of filter design.
All of this is very convenient, from a practical point of view. I can't
see that any of this comes down to the fundamentals of FIR filters?
> So, this can be viewed as a unifying principle that ties the spectral
> samples of the filter to the continuous frequency response of the same
> filter.
Agreed.
> In this case a transition might be defined by a sinc with unity weight
> followed by a sinc (or a number of contiguous sincs) with zero weight.
> The sincs with zero weight contribute nothing to the sum and we're left with
> the unity weighted sinc as the only component.
> If there are multiple nonzero sincs in the sum, none of this says anything
> much about the placement of zeros of the sum.
Exactly.
> If we evaluate the filter polynomial over the z plane then we find zeros
> placed wherever... That doesn't take away from the fact that it's
> constructed of real sincs (really Dirichlets) on the unit circle. So,
> transition widths remain limited by the width of those sincs which are
> directly related to the spacing of the spectral samples. (You may well
> accept the notion that the practical width of the main lobe of a sinc is
> equal to the spacing of the regular zeros in the sinc - it is 1/2 the
> spacing between the first zeros adjacent to the peak).
Well, yes, but the placements of the zeros are determined by the sampling
interval, not the length of the FIR filter. The shortest sinc possible
in any system, is the ...0,0,1,0,0,... sequence, that interpolates to
a continuous sinc according to the sampling reconstruction theorem.
But that has nothing to do with FIR filters, as far as I can see?
> Here's an interesting case:
> ft=[1 0 0 0 1] <-> Fw= ... a complex function with 5 samples and Fw(0)=2 and
> no zero-values samples in Fw.
>
> And
> gt=[1 0 0 0 1 0 0 0] <-> Gw=[2 0 2 0 2 0 2 0]
> where g(t) looks much the same as ft except that it's zero padded.
> If you zero pad gt further, you find that Gw becomes a rectified cosine -
> which is exactly what you expect in a comb filter.
>
> Note that the details of Gw are much easier to figure out than the details
> of Fw. The placement of the zeros isn't between samples as in Fw.
>
> These are both closely related to:
> ht=[1 1] <-> Hw=[2 0]
> where one can simply replicate Hw 4 times to get Gw and, thus, gt
>
> So, one might say that Hw is the "prototype" with a single transition - a
> lowpass filter.
> As we get more complicated structures, the zeros might be placed anywhere as
> may other features - small peaks, ringing, etc. These are controlled by
> "fine tuning the coefficients but the fundamental width of the sincs and the
> spacing between spectral samples is still a fundamental measure.
Agreed.
> It's probably easier to visualize if we consider a brick wall transition
> that is preceded by a whole sequence of spectral samples with value 1.0
> followed by a sequence of spectral samples with value zero. In that case we
> force the stopband zeros to be equispaced - which may not be at all optimum.
> Then, if we tweak the stopband peaks to push down the largest ones there is
> a related widening of the transition - very much as the van der Maas, Dolph,
> Taylor functions have wider main lobes than a uniformly weighted array with
> larger sidelobes would have. (Much of the early theory of this sort was
> done by the antenna folks). Then Bartlett, von Hann, harris, Kaiser, et al
> did similar things with "windows" for DSP. I don't make a great distinction
> between continuous functions and discrete ones in my arm-waving
> descriptions.
I think it's intersting. Still, the starting point here was what the
relation between the length of a FIR filter (N, including zero coefficients)
and key properties of the frequency response. I belive we agree that the
one key property that is decided/controlled by N is the transition
bandwidth. Otherwise, we have the freedom to manipulate the coefficients,
as N degrees of freedom, in order to meet whatever requirements and
constraints the filter will have to meet.
Rune