Reply by Fred Marshall October 8, 20042004-10-08
Rune,

I think we agree on all points - so I'll just address the areas where you 
had questions or where we seemed to depart in understanding:

"Rune Allnor" <allnor@tele.ntnu.no> wrote in message 
news:f56893ae.0410062316.57c6c842@posting.google.com...
> "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 >> >> ............................... > >> 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.
***NB: I'm not talking about f=fs/2 at all here. I'm talking about frequency intervals of 1/NT or 1/2*NT which are fs/N or fs/2*N. ...........................................
> >> 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? >
***Later in my response I gave an example of a filter that has a zero in its continuous frequency response but has no zeros in its frequency samples. You have to interpolate to see the zero points. Peaks can occur between samples as well - thus, "wiggles". Some "stopband" peaks can be quite large but not seen in the samples. .......................
>> 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?
***Because FIR filter's frequency responses can be expressed in this way - and, I find it much easier to visualize the relationship between length and frequency response if I think of the frequency response as being made up of sincs rather than cosines. I can't wrap my head around a sum of cosines very easily (except when doing half-band filters) but it's easy to visualize a sum of sincs. The sums are the same - the visualization due to the basis function set is much different. ........................................
> >> 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?
***When you say that placement of the zeros are determined by the sampling interval, are you referring to the time sampling interval or the frequency sampling interval? ***The frequency sinc's zeros are determined by the length of the FIR filter. This is because their separation distance is the frequency sampling interval and the distance between adjacent zeros in the frequency sincs. .......................
> >> 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.
***We agree. I think the starting point was about filter temporal length and its relation to cutoff frequency. I said there is none and suggested the relationship in the frequency response to temporal length is in transition band widths. ***I think you introduced the issue of the placement of zeros in the continuous frequency response. That had not been my intent because I don't think there's much that can be said other than there will be zeros somewhere - and closely related to the stop bands but not sppecifically located anywhere. I surely agree that zeros could be close or double or whatever - but these aren't among the gross "features" I'd intended to discuss. And, I see no direct relationship with the length of the filter - other than the number of zeros real or complex. ***To bring this back to the beginning, I was trying to provide a constructive approach to discussion of filter characteristics that *are* related to the filter's temporal length. That's why superposition of frequency sincs is a key point. That's where minimum transition band width is easily demonstrated to be dependent on temporal length. That's where the relative cutoff frequency is shown to be independent of temporal length. Fred
Reply by Rune Allnor October 7, 20042004-10-07
"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
Reply by Fred Marshall October 6, 20042004-10-06
"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). 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. 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 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. 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. 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. 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. 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. 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. 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). 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. 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. Fred
Reply by Rune Allnor October 6, 20042004-10-06
"Fred Marshall" <fmarshallx@remove_the_x.acm.org> wrote in message news:<ctydnf_TOoAShv7cRVn-vA@centurytel.net>...
> "Jerry Avins" <jya@ieee.org> wrote in message > news:cjt48l$lnf$2@bob.news.rcn.net... > > dnb wrote: > > > > It seems to me that there may be some correlation between the length of a > > filter and one or more if its critical frequencies. A classical FIR needs > > to be long enough to encompass roughly a cycle at the lowest transition > > frequency. That's a minimum, and such a length doesn't guarantee any > > particular performance. Fred: Comment? > > > > Jerry > > Jerry, > > You say: > "A FIR filter needs to be long enough to encompass roughly a cycle at the > lowest transition frequency" > hmmmmm.....
I think it's a roundabout way of stating Fred's basic message: That the length of a FIR filter is related to the width of the transition band. Now, the exact nature of how this relation works (does that sentence make sense?) is a matter of speculation. I think Jerry is going a bit too far in explantaion/speculation ("expeculation"?) for my taste. I agree on that the transition bandwidth is the important issue. I wouldn't go into much more detail than that, though.
> 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.
> Let's see how these compare: > Let's make a lowpass filter with transition frequency between f=0 and f=1Hz. > It can be a high pass or low pass - doesn't matter. > For lowpass we will say that F(0)=1.0 and F(1)=0 and F(2 ..... N)=0 > In this case, > The length of the filter needs to be 1/deltaf or 1/1Hz or 1 second.
Agreed.
> So, while this is the lowest possible transition frequency (0.5Hz shall we > say?), it is also the narrowest possible transition. The same analysis > would apply for any transition frequency of the same width.
Agreed.
> So, I don't think the transition frequency matters, only its width
Agreed.
> and I > would rephrase your assertion to be: > "A FIR filter needs to be long enough in time such that the reciprocal of > its temporal length is no greater than the narrowest transition band"
Agreed. At least, this checks with the procedure for designing FIR filters by the window method, as I once learned it.
> It's pretty easy to visualize like this: > Assume a perfect filter response with brick wall edges (zero width > transitions) at whatever frequencies you like. > This filter has an infinite impulse response. > But, we want a real filter with finite temporal length. > So, we're going to chop it off with a rectangular window in time (and maybe > modify its coefficients inside that window - but that's not the important > part so we ignore this for now).
Yep, that's how we did these things.
> - We realize that the temporal windowing is accompanied by convolving the > perfect frequency response with a sinc.
Correct.
> - The width of the sinc is inversely proportional to the width of the > rectangular window. - The longer the filter, the narrower the sinc and the > narrower the transition bands that are created by the convolution. > So, we pick the narrowest transition band we need in the real (i.e. > practical) filter. > The reciprocal of that bandwidth is rougly the length of the window / > filter.
Exactly.
> It applies to *all* of the transitions because of the convolution. > Thus, it doesn't matter where the transitions are because the convolution > treats them all the same. > QED
This procedure checks with the one I learned.
> Now, one might ask, what if we shape the window that truncates the perfect > filter's impulse resonse? Well, that can do a number of things. > 1) It can reduce ringing at the expense of transition width - less ringing, > wider transitions. > 2) It can result in an equiripple, maximally flat, etc. frequency response - > exept that's generally done by looking at the frequency response and > optimizing in frequency. > > None of these "improvements" makes the transitions narrower, only wider. I > don't think there is an example of a transition narrower than provided by > the rectangular window. This is the same as saying I don't think there is > an example of a faster rise time than provided by a brick wall lowpass > filter. Maybe Victor Barcilon showed this in our old paper - I don't > recall.
I've heard these 'facts' stated as just that, 'facts'. I have never seen proofs, though. At least not that I can recall. Rune
Reply by Fred Marshall October 5, 20042004-10-05
"Jerry Avins" <jya@ieee.org> wrote in message 
news:cjt48l$lnf$2@bob.news.rcn.net...
> dnb wrote: > > It seems to me that there may be some correlation between the length of a > filter and one or more if its critical frequencies. A classical FIR needs > to be long enough to encompass roughly a cycle at the lowest transition > frequency. That's a minimum, and such a length doesn't guarantee any > particular performance. Fred: Comment? > > Jerry
Jerry, You say: "A FIR filter needs to be long enough to encompass roughly a cycle at the lowest transition frequency" hmmmmm..... 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. Let's see how these compare: Let's make a lowpass filter with transition frequency between f=0 and f=1Hz. It can be a high pass or low pass - doesn't matter. For lowpass we will say that F(0)=1.0 and F(1)=0 and F(2 ..... N)=0 In this case, The length of the filter needs to be 1/deltaf or 1/1Hz or 1 second. So, while this is the lowest possible transition frequency (0.5Hz shall we say?), it is also the narrowest possible transition. The same analysis would apply for any transition frequency of the same width. So, I don't think the transition frequency matters, only its width and I would rephrase your assertion to be: "A FIR filter needs to be long enough in time such that the reciprocal of its temporal length is no greater than the narrowest transition band" It's pretty easy to visualize like this: Assume a perfect filter response with brick wall edges (zero width transitions) at whatever frequencies you like. This filter has an infinite impulse response. But, we want a real filter with finite temporal length. So, we're going to chop it off with a rectangular window in time (and maybe modify its coefficients inside that window - but that's not the important part so we ignore this for now). - We realize that the temporal windowing is accompanied by convolving the perfect frequency response with a sinc. - The width of the sinc is inversely proportional to the width of the rectangular window. - The longer the filter, the narrower the sinc and the narrower the transition bands that are created by the convolution. So, we pick the narrowest transition band we need in the real (i.e. practical) filter. The reciprocal of that bandwidth is rougly the length of the window / filter. It applies to *all* of the transitions because of the convolution. Thus, it doesn't matter where the transitions are because the convolution treats them all the same. QED Now, one might ask, what if we shape the window that truncates the perfect filter's impulse resonse? Well, that can do a number of things. 1) It can reduce ringing at the expense of transition width - less ringing, wider transitions. 2) It can result in an equiripple, maximally flat, etc. frequency response - exept that's generally done by looking at the frequency response and optimizing in frequency. None of these "improvements" makes the transitions narrower, only wider. I don't think there is an example of a transition narrower than provided by the rectangular window. This is the same as saying I don't think there is an example of a faster rise time than provided by a brick wall lowpass filter. Maybe Victor Barcilon showed this in our old paper - I don't recall. Fred
Reply by dnb October 5, 20042004-10-05
Fred,

Again, thanks. I had posted two messages in rapid succession before I
read your first one. So, thanks and I clearly understand the logic now
and apologize for being slow.

Regards,
Dinkar.

"Fred Marshall" <fmarshallx@remove_the_x.acm.org> wrote in message news:<koKdnfwbX5lCf_zcRVn-qw@centurytel.net>...
> "dnb" <dbhat2@yahoo.com> wrote in message > news:fa0deac8.0410041305.47d59e14@posting.google.com... > > Hi all, > > > > I searched previous articles in comp.dsp regarding FIR filter > > length, and I found one very useful thread for me - namely, the > > relationship between the size of a filter and the the sampling > > frequency. > > It was pointed out that the length could be obtained using N = k > > (fs/ft) > > where fs is the sampling frequency and ft is the transition bandwidth. > > > > So I am able to now hopefully correctly formulate my problem: > > Given the FIR filter that I had - H(z,N) - , the sampling frequency, > > and a specified measurement bandwidth, can I estimate the size of the > > filter N? > > > > Thanks, > > Dinkar > > Without wading through any particular transfer function as your H(z,N) the > answer is still *no*. Adding superfluous information doesn't change the > physics of the problem. > > Here are some true statements: > > Given a filter of sample interval T, the sample rate fs=1/T. > > Given a filter with N coefficients equally spaced, the Discrete Fourier > Transform of the filter coefficients is also of length N expressed over a > frequency range 0>fs. > > Accordingly, the frequency resolution the filter's DFT is fs/N. (You should > interpret this as the best you can do in defining frequency domain > transitions - from one point to another). Thus, a filter of temporal length > NT=N/fs will have transitions not shorter than fs/N (the reciprocal of the > temporal length). > > So, in terms of the transition width defined above, ft=fs/N and N=fs/ft. > If N can be expressed in terms of fs and ft, and there's no relationship > between measurement bandwidth B and ft except for the limiting statement > that B>2*ft or B>2*fs/N, then N cannot be expressed in terms of B. > > You have been very perseverant in seeking a relationship between B and N. > Perhaps it's time to accept that no such relationship exists. > That is because you can get many values of B for a given value of N. > > Fred
Reply by Jerry Avins October 5, 20042004-10-05
dnb wrote:

> Fred, > > Apologize for being a little slow, but this note explains very clearly > - examples always seem to help me more :-) Plz disregard the next mail > which > again mentions bandwidth vs lenght of the filter. > > Regards > Dinkar
It seems to me that there may be some correlation between the length of a filter and one or more if its critical frequencies. A classical FIR needs to be long enough to encompass roughly a cycle at the lowest transition frequency. That's a minimum, and such a length doesn't guarantee any particular performance. Fred: Comment? Jerry -- ... they proceeded on the sound principle that the magnitude of a lie always contains a certain factor of credibility, ... and that therefor ... they more easily fall victim to a big lie than to a little one ... A. H. &#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;
Reply by dnb October 5, 20042004-10-05
Fred,

Apologize for being a little slow, but this note explains very clearly
- examples always seem to help me more :-) Plz disregard the next mail
which
again mentions bandwidth vs lenght of the filter.

Regards
Dinkar

"Fred Marshall" <fmarshallx@remove_the_x.acm.org> wrote in message news:<MdedndWb65Hl6fzcRVn-rg@centurytel.net>...
> Dinkar, > > With respect, I feel like I'm repeating myself. Perhaps I we state the > situation clearly before. > > In every interesting case: You *can't* relate length to bandwidth. > > As before: Length and *transition band width* are more closely related. > The longer the filter, the shorter the transition bands can be. > Also, in-band and stopband specifications: deviation from perfect passband > and stopband lack of attenuation (sometimes called ripple) are improved with > length but not derivable from length. > > Examples: > - You can have a bandpass filter of center frequency as a fraction of fs of > 0.25 and width 0.2 and another of center frequency 0.2 and width 0.25 let's > say they both have transition band widths of 0.01. Then you might say that > the filter has a length around 1/0.01fs or 100T - well, certainly not > shorter than that. > - What you can't do is relate the band center or width to the length of the > filter > > There is one exception: > > - If the filter is so short that it is *all* transition (i.e. transition up > from stop to passband and then immediate transition down from passband to > stopband) then a length 100T passband filter would have a passband of not > smaller than 0.02fs .... all this within a factor of 2 in case I've made a > mistake! > > - As above, if the same length filter has a wider passband then it might be > almost any bandwidth. Thus the inability to relate passband width to length > in most situations of any interest. > > Fred > > > "dnb" <dbhat2@yahoo.com> wrote in message > news:fa0deac8.0410040537.6edd7d9f@posting.google.com... > > As followup, > > Along the lines mentioned below, I wrote the transfer function for > > N=2*P +1 (N is odd) and substituted z = exp(jw). : > > P > > H(w,P) = J(P). exp(-j*[P(w+1) - pi/2]).sigma(l.sin(lw)] > > l=1 > > > > where J(P) is independent fo w. > > I plotted the magnitude function for several N, and as many of you > > pointed out, it is not a low-pass filter and has no cut-off. > > > > So, now what I am trying to do is given a measurement bandwidth > > (bandwdith over which measurements are available), how would I relate > > it to P which is the size of the filter? > > > > Thanks all again > > Dinkar > > > > Alan Johnson <alan.johnson@pyrrhic.co.uk> wrote in message > > news:<41588CD9.4070601@pyrrhic.co.uk>... > >> There is no cutoff frequency for the reasons that others have given > >> however it is such a simple filter that (unusually) it is possible to > >> give a closed form transfer function in the frequency domain. > >> > >> > >> For small numbers of terms you can simply collect terms about the > >> central term and you can see the response is a phase shift of N/2 > >> and the a series of sine terms eg. for N=5 > >> > >> H(z) = J*( (-4 z^-5 + 4 z^-1) + (-2.z^-4 + 2 z^-2)) > >> > >> H(z) = J*z^-3( 4( -z^-2 + z^2) + 2(z^-1+ z^1)) > >> > >> H(w) = exp(3jwT)(-8sinwT +4sinwT) > >> > >> (I hate ascii maths and I may have made a mistake but the principle is > >> clear) > >> > >> As the impulse response is a ramp you could approximate the transfer > >> function using the continuous fourier transform. Analytical methods for > >> such a simple function are not difficult using integration by parts. > >> Actually it is a standard text book example.
Reply by Fred Marshall October 4, 20042004-10-04
"dnb" <dbhat2@yahoo.com> wrote in message 
news:fa0deac8.0410041305.47d59e14@posting.google.com...
> Hi all, > > I searched previous articles in comp.dsp regarding FIR filter > length, and I found one very useful thread for me - namely, the > relationship between the size of a filter and the the sampling > frequency. > It was pointed out that the length could be obtained using N = k > (fs/ft) > where fs is the sampling frequency and ft is the transition bandwidth. > > So I am able to now hopefully correctly formulate my problem: > Given the FIR filter that I had - H(z,N) - , the sampling frequency, > and a specified measurement bandwidth, can I estimate the size of the > filter N? > > Thanks, > Dinkar
Without wading through any particular transfer function as your H(z,N) the answer is still *no*. Adding superfluous information doesn't change the physics of the problem. Here are some true statements: Given a filter of sample interval T, the sample rate fs=1/T. Given a filter with N coefficients equally spaced, the Discrete Fourier Transform of the filter coefficients is also of length N expressed over a frequency range 0>fs. Accordingly, the frequency resolution the filter's DFT is fs/N. (You should interpret this as the best you can do in defining frequency domain transitions - from one point to another). Thus, a filter of temporal length NT=N/fs will have transitions not shorter than fs/N (the reciprocal of the temporal length). So, in terms of the transition width defined above, ft=fs/N and N=fs/ft. If N can be expressed in terms of fs and ft, and there's no relationship between measurement bandwidth B and ft except for the limiting statement that B>2*ft or B>2*fs/N, then N cannot be expressed in terms of B. You have been very perseverant in seeking a relationship between B and N. Perhaps it's time to accept that no such relationship exists. That is because you can get many values of B for a given value of N. Fred
Reply by dnb October 4, 20042004-10-04
Hi all,

I searched previous articles in comp.dsp regarding FIR filter
length, and I found one very useful thread for me - namely, the
relationship between the size of a filter and the the sampling
frequency.
It was pointed out that the length could be obtained using N = k
(fs/ft)
where fs is the sampling frequency and ft is the transition bandwidth.

So I am able to now hopefully correctly formulate my problem:
Given the FIR filter that I had - H(z,N) - , the sampling frequency,
and a specified measurement bandwidth, can I estimate the size of the
filter N?

Thanks,
Dinkar

dbhat2@yahoo.com (dnb) wrote in message news:<fa0deac8.0410040537.6edd7d9f@posting.google.com>...
> As followup, > Along the lines mentioned below, I wrote the transfer function for > N=2*P +1 (N is odd) and substituted z = exp(jw). : > P > H(w,P) = J(P). exp(-j*[P(w+1) - pi/2]).sigma(l.sin(lw)] > l=1 > > where J(P) is independent fo w. > I plotted the magnitude function for several N, and as many of you > pointed out, it is not a low-pass filter and has no cut-off. > > So, now what I am trying to do is given a measurement bandwidth > (bandwdith over which measurements are available), how would I relate > it to P which is the size of the filter? > > Thanks all again > Dinkar > > Alan Johnson <alan.johnson@pyrrhic.co.uk> wrote in message news:<41588CD9.4070601@pyrrhic.co.uk>... > > There is no cutoff frequency for the reasons that others have given > > however it is such a simple filter that (unusually) it is possible to > > give a closed form transfer function in the frequency domain. > > > > > > For small numbers of terms you can simply collect terms about the > > central term and you can see the response is a phase shift of N/2 > > and the a series of sine terms eg. for N=5 > > > > H(z) = J*( (-4 z^-5 + 4 z^-1) + (-2.z^-4 + 2 z^-2)) > > > > H(z) = J*z^-3( 4( -z^-2 + z^2) + 2(z^-1+ z^1)) > > > > H(w) = exp(3jwT)(-8sinwT +4sinwT) > > > > (I hate ascii maths and I may have made a mistake but the principle is > > clear) > > > > As the impulse response is a ramp you could approximate the transfer > > function using the continuous fourier transform. Analytical methods for > > such a simple function are not difficult using integration by parts. > > Actually it is a standard text book example.