From: robert bristow-johnson on 6 Dec 2006 20:35 Ron N. wrote: > > Can't one just precalculate one filter and shift it about? yeah, probably. i presume you mean "scale" instead of "shift". (or do you mean "shift and overlap-add" for additional features?) > (similar to how your IIR cookbook picks one basic pole/zero > geometry and just scales their locations for the filters few > degrees of freedom...) > > I would start with a Hamming windowed (trig table lookup) > sinc (pre-fft'd rectangle), and see it that fits his needs well > enough (before getting out a pile driver when a boot heel > would have sufficed). actually, the idea of a cookbook is a collection of optimized recipes that make for a pretty good tasting souffle that would, for the resources, be pretty hard to improve upon if you follow the directions carefully. i, too, would like to see a public-domain self-contained C function that uses FFTW or whatever to do this for arbitrary given shapes (assume phase linear and the symmetry that goes with that). dunno. r b-j
From: Fred Marshall on 7 Dec 2006 02:31 "robert bristow-johnson" <rbj(a)audioimagination.com> wrote in message news:1165455330.357851.192280(a)79g2000cws.googlegroups.com... > > Ron N. wrote: >> >> Can't one just precalculate one filter and shift it about? > > yeah, probably. i presume you mean "scale" instead of "shift". (or do > you mean "shift and overlap-add" for additional features?) > >> (similar to how your IIR cookbook picks one basic pole/zero >> geometry and just scales their locations for the filters few >> degrees of freedom...) >> >> I would start with a Hamming windowed (trig table lookup) >> sinc (pre-fft'd rectangle), and see it that fits his needs well >> enough (before getting out a pile driver when a boot heel >> would have sufficed). > > actually, the idea of a cookbook is a collection of optimized recipes > that make for a pretty good tasting souffle that would, for the > resources, be pretty hard to improve upon if you follow the directions > carefully. i, too, would like to see a public-domain self-contained C > function that uses FFTW or whatever to do this for arbitrary given > shapes (assume phase linear and the symmetry that goes with that). > dunno. > > r b-j r b-j, How about this: It's pretty simple to extend the P-M approach to an arbitrary shape and arbitrary weights. One could call a function, passing the shape and weights and get FIR coefficients needed for a minimax frequency approximant in return. There's really no need for distinct "bands", etc. It may complicate handling the transition bands... It is also possible to do the very same minimax approximation using a family of sincs (in frequency) instead of a family of cosines in frequency. This is pretty neat if one wants to visualize what happens if some of the sincs have zero coefficients because the sinc peaks have the identical value of the frequency response unlike the cosines. Then, this idea can be extended to using sums of sincs like 1/2 1 1/2 which have more rapid decay. It can have the advantage of a windowed approach with a minimax solution. Would that do? Fred
From: Andor on 7 Dec 2006 03:18 robert bristow-johnson wrote: > jeff227 wrote: > > >How does this cookbook allow him to create FIR filters on > > >the fly as part of a subroutine? Can Matlab generate C code > > >which can then generate parameterized FIR filters? > > > Yes, exactly. Maybe I need to re-state my question. > > > I am hoping to find a C routine that will calculate FIR coefficients at > > run time. "Window" methods seem to be the best for my needs (simple audio > > LP/HP filters, relatively wide transition bands, modest stop band atten, > > etc.) Nothing fancy but fast to compute.well, pick on a certain window. > > Kaiser might be best, but it's sorta > hard to generate. maybe some even-symmetry polynomial (with only even > power terms) that approximate this Kaiser window. There is a simple alternative to the Kaiser window. I call it the Knab window [1]. It also has a single parameter to trade-off mainlobe width with sidelobe attenuation, and is claimed to be very "similar" to the Kaiser window. However, it only takes the exp-function to compute, and can therefore be generated on thy fly with any standard math library. Regards, Andor [1] John J Knab, "An Alternate Kaiser Window" IEEE Transactions on Acoustics, Speech, and Signal Processing, Vol. ASSP-27, No.5, October 1979
From: Ron N. on 7 Dec 2006 15:06 jeff227 wrote: > Has anyone come up with a "cookbook" for simple FIR filters similar to > RBJ's IIR cookbook? Here's a filter cookbook that uses a simple scaled windowed sinc to create arbitrary single cutoff FIR filters: http://www.musicdsp.org/files/wsfir.h Basically, you get only three degrees of freedom: sample rate, filter length, and (stop or) passband width. You could add gain, as a 4th degree of freedom, by equally scaling all the coefficients generated. Zero-pad to a long enough length and fft to evaluate whether the resulting filter quality is suitable for your purposes. IMHO. YMMV. -- rhn A.T nicholson d.0.t C-o-M
From: Rune Allnor on 7 Dec 2006 16:22
robert bristow-johnson skrev: > i, too, would like to see a public-domain self-contained C > function that uses FFTW or whatever to do this for arbitrary given > shapes (assume phase linear and the symmetry that goes with that). Seems as if you are re-inventing wavelets from yet another direction. Rune |