DSPRelated.com
Forums

Halfband FIR design with alternating zeros

Started by I. R. Khan June 9, 2005
"I. R. Khan" <ir_khan@hotmail.com> wrote in message 
news:3gsbmbFe3s7qU1@individual.net...
> Fred, thanks for the code. > > Just a comment. While matlab can easily import coefficients generated by > the code, Mathematica has some problems due to use of E. You might > consider using plane %g format for lower order designs. > > Ishtiaq. > > > "Fred Marshall" <fmarshallx@remove_the_x.acm.org> wrote in message > news:h9ydnfZxKcaFyTXfRVn-iQ@centurytel.net... > >> >> There's a PC executable that I keep posted here: >> >> ftp://ftp.mission-systems-inc.com/outgoing/Halfband/ >> >> Fred >> >> >> >
Ishtiaq, It's been a while.... I think the E format only shows up in the examples and the actual input required is a bit more forgiving. Fred
"robert bristow-johnson" <rbj@audioimagination.com> wrote in message 
news:BECEA26D.81CF%rbj@audioimagination.com...
> in article 5JqdnR5udeMrETXfRVn-vw@rcn.net, Jerry Avins at jya@ieee.org > wrote > on 06/09/2005 14:38: > >> Middle coefficient non zero, but all other odd-numbered coefficients. >> Round-off errors usually cause computer programs to return very small >> numbers instead of zero. Ignore those. > > also, make awfully damn sure that the gain about Nyquist/2 is perfectly > odd > symmetry and that the weighting about Nyquist/2 is perfectly even > symmetry. > then you will get virtually half of the FIR coefs to be very small numbers > that, as Jerry sez, should be set to zero. >
No need really guys. That bit of code provided by Juha takes care of everything and yields zero coefficients where they belong without cheating. You can do the same with the P-M program: Define an even-length lowpass filter response at band edges [0 .4 .5 .5] with band values [0.5 0] Then upsample the fiter by a factor of 2 (i.e. intersperse zero coefficients) Then replace the zero coefficient at the center with 0.5. Result: a perfect minimax halfband filter. Fred
Fred Marshall wrote:

   ...

> Then replace the zero coefficient at the center with 0.5. > Result: a perfect minimax halfband filter.
Neat! Given the usual tools, which way is easier? 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;
"Jerry Avins" <jya@ieee.org> wrote in message 
news:OoidnR53xuVmXTTfRVn-qQ@rcn.net...
> Fred Marshall wrote: > > ... > >> Then replace the zero coefficient at the center with 0.5. >> Result: a perfect minimax halfband filter. > > Neat! Given the usual tools, which way is easier? >
Jerry, Well, the code provided by Juha seems pretty darned easy to use if you have Matlab or Scilab. The code I keep posted will write the coefficients to a file - not a big deal but perhaps convenient. I just tried using the standard P-M followed by using the trick Juha's code uses. That seems a little more trouble because you have to grab and manipulate the interim result from PM. One might check the results to see how they compare. Probably all pretty close. I believe in any case, when the stopband attenuation peaks get to be around 200dB, then numerical problems make convergence a problem. Does anybody care? :-) Fred