DSPRelated.com
Forums

frequency respons of halfband filter?

Started by alex65111 April 15, 2009
Fred Marshall wrote:
> bellda2005@cox.net wrote: >> >> Interesting, Fred. Could you post the coefficients of an example >> filter? >> >> Thanks, >> >> Dirk > > Dirk, > > Actually, it really does depend on which type so if you're a bit more > specific then I could see if I still have the code that will generate > it. The Hermann-Schussler work was done quite long ago. > > Do you mean a half-band with f(0)=1.0 ??? or something else? > > Fred
In the mean time, here is some insight into equality constraints: In the standard Remez algorithm (and this would be true of any approach reaching minimax criteria), the ripple peaks alternate in sign and there are generally N+1 such peaks where N is the number of variables (e.g. filter coefficients). On rare occasions there are N+2. If you impose an equality constraint (such as 1.0 at f=0), then you might visualize this as "pushing" the function toward that value. And, you might think of this point as having infinite weight re: the error .. thus forcing the error to zero. So, if the weight is infinite at that point it's as if there's a peak in the error (even though it's very small in magnitude due to the weighting - or even zero .. which is fine). The function "pushes back" in some direction. As it turns out then, each such equality point takes up the place of an error peak and, although you can't readily "see" it, the sign of this error is as any of the others - that is, it's in the set of peaks whose signs alternate. Accordingly, since there's no perceptible error at this point, it appears that the adjacent error peaks "skip" an alternation - the adjacent error peaks have the same sign and the point of equality "uses up" the "missing" alternating peak. All this leads to a modified Remez algorithm .. with proofs, etc. which takes into consideration the "modified sign alternation property". Since the equality constraint must be represented in the set of equations that are being solved at each step, and because this equation has no error value to be equalized along with the others (it has zero error value), it uses up one degree of freedom. And, because of this, the equalized error (the ripple peaks) go up relative to not having imposed the constraint. From ripple magnitude perspective, it's like having a FIR filter with one less coefficient. Fred
On Apr 30, 3:03&#4294967295;am, "Fred Marshall" <fmarshallx@remove_the_x.acm.org>
wrote:
> bellda2...@cox.net wrote: > > > Interesting, Fred. &#4294967295;Could you post the coefficients of an example > > filter? > > > Thanks, > > > Dirk > > Dirk, > > Actually, it really does depend on which type so if you're a bit more > specific then I could see if I still have the code that will generate it. > The Hermann-Schussler work was done quite long ago. > > Do you mean a half-band with f(0)=1.0 ??? or something else? > > Fred
Hi Fred, I meant the a half-band with f(0)=1.0, if the code to generate on is readily available. Thanks, Dirk
bellda2005@cox.net wrote:
> Hi Fred, > > I meant the a half-band with f(0)=1.0, if the code to generate on is > readily available. > > Thanks, > > Dirk
Here is a quickie but the transition bands have bumps in them which is unecessary. This means it was an early version of my code. I don't know if the 1.0 at f=0 constraint is built into a later version. I can keep looking. Anyway, you can look at the passband to see how it looks. You can also look in the stopband to see that there's a double zero at fs/2. This works out because: A halfband filter response is made up of a constant = 0.5 and an antisymmetric component that is 0.5 in the passband and -0.5 in the stopband. When added together, the components yield 1.0 in the passband and zero in the stopband (+/- the ripples of course). If the frequency response has a constant term, in this case 0.5, then the temporal response must be 0.5 at "DC" or, really, at time zero. So, we can design the antisymmetric filter and then just add the center coefficient of 0.5. That's a way to look at it. The approximation only needs to be done in the passband because the structure guarantees that fs/4=0.5 (or zero) and guarantees the response from fs/4 to fs/2 is antisymmetric. Thinking of it this way, if the frequency response is 1.0 at f=0 and the components are as described above, then the frequency response at fs/2 must be zero. Indeed, you see a double zero there. Anyway, here is that imperfect (if not interesting) filter set of coeff's: -0.318178627640009E-02 0.000000000000000E+00 0.624465197324753E-02 0.000000000000000E+00 -0.656183436512947E-02 0.000000000000000E+00 0.963471177965403E-02 0.000000000000000E+00 -0.100250272080302E-01 0.000000000000000E+00 0.103756394237280E-01 0.000000000000000E+00 -0.913409423083067E-02 0.000000000000000E+00 0.710289599373937E-02 0.000000000000000E+00 -0.520208990201354E-02 0.000000000000000E+00 0.379590759985149E-02 0.000000000000000E+00 -0.529637048020959E-02 0.000000000000000E+00 0.101068196818233E-01 0.000000000000000E+00 -0.219537038356066E-01 0.000000000000000E+00 0.439153611660004E-01 0.000000000000000E+00 -0.934268832206726E-01 0.000000000000000E+00 0.313605815172195E+00 0.500000000000000E+00 0.313605815172195E+00 0.000000000000000E+00 -0.934268832206726E-01 0.000000000000000E+00 0.439153611660004E-01 0.000000000000000E+00 -0.219537038356066E-01 0.000000000000000E+00 0.101068196818233E-01 0.000000000000000E+00 -0.529637048020959E-02 0.000000000000000E+00 0.379590759985149E-02 0.000000000000000E+00 -0.520208990201354E-02 0.000000000000000E+00 0.710289599373937E-02 0.000000000000000E+00 -0.913409423083067E-02 0.000000000000000E+00 0.103756394237280E-01 0.000000000000000E+00 -0.100250272080302E-01 0.000000000000000E+00 0.963471177965403E-02 0.000000000000000E+00 -0.656183436512947E-02 0.000000000000000E+00 0.624465197324753E-02 0.000000000000000E+00 -0.318178627640009E-02 I'll see if I can't find better code than what created this example. Fred
On Apr 30, 3:43&#4294967295;pm, "Fred Marshall" <fmarshallx@remove_the_x.acm.org>
wrote:
> bellda2...@cox.net wrote: > > Hi Fred, > > > I meant the a half-band with f(0)=1.0, if the code to generate on is > > readily available. > > > Thanks, > > > Dirk > > Here is a quickie but the transition bands have bumps in them which is > unecessary. &#4294967295;This means it was an early version of my code. &#4294967295;I don't know if > the 1.0 at f=0 constraint is built into a later version. I can keep looking. > Anyway, you can look at the passband to see how it looks. &#4294967295;You can also look > in the stopband to see that there's a double zero at fs/2. > > This works out because: > > A halfband filter response is made up of a constant = 0.5 and an > antisymmetric component that is 0.5 in the passband and -0.5 in the > stopband. &#4294967295;When added together, the components yield 1.0 in the passband and > zero in the stopband (+/- the ripples of course). &#4294967295;If the frequency response > has a constant term, in this case 0.5, then the temporal response must be > 0.5 at "DC" or, really, at time zero. > So, we can design the antisymmetric filter and then just add the center > coefficient of 0.5. &#4294967295;That's a way to look at it. > > The approximation only needs to be done in the passband because the > structure guarantees that fs/4=0.5 (or zero) and guarantees the response > from fs/4 to fs/2 is antisymmetric. > > Thinking of it this way, if the frequency response is 1.0 at f=0 and the > components are as described above, then the frequency response at fs/2 must > be zero. &#4294967295;Indeed, you see a double zero there. > > Anyway, here is that imperfect (if not interesting) filter set of coeff's: > &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; -0.318178627640009E-02 > &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295;0.000000000000000E+00 > &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295;0.624465197324753E-02 > &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295;0.000000000000000E+00 > &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; -0.656183436512947E-02 > &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295;0.000000000000000E+00 > &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295;0.963471177965403E-02 > &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295;0.000000000000000E+00 > &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; -0.100250272080302E-01 > &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295;0.000000000000000E+00 > &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295;0.103756394237280E-01 > &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295;0.000000000000000E+00 > &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; -0.913409423083067E-02 > &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295;0.000000000000000E+00 > &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295;0.710289599373937E-02 > &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295;0.000000000000000E+00 > &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; -0.520208990201354E-02 > &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295;0.000000000000000E+00 > &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295;0.379590759985149E-02 > &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295;0.000000000000000E+00 > &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; -0.529637048020959E-02 > &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295;0.000000000000000E+00 > &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295;0.101068196818233E-01 > &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295;0.000000000000000E+00 > &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; -0.219537038356066E-01 > &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295;0.000000000000000E+00 > &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295;0.439153611660004E-01 > &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295;0.000000000000000E+00 > &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; -0.934268832206726E-01 > &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295;0.000000000000000E+00 > &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295;0.313605815172195E+00 > &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295;0.500000000000000E+00 > &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295;0.313605815172195E+00 > &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295;0.000000000000000E+00 > &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; -0.934268832206726E-01 > &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295;0.000000000000000E+00 > &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295;0.439153611660004E-01 > &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295;0.000000000000000E+00 > &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; -0.219537038356066E-01 > &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295;0.000000000000000E+00 > &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295;0.101068196818233E-01 > &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295;0.000000000000000E+00 > &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; -0.529637048020959E-02 > &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295;0.000000000000000E+00 > &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295;0.379590759985149E-02 > &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295;0.000000000000000E+00 > &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; -0.520208990201354E-02 > &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295;0.000000000000000E+00 > &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295;0.710289599373937E-02 > &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295;0.000000000000000E+00 > &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; -0.913409423083067E-02 > &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295;0.000000000000000E+00 > &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295;0.103756394237280E-01 > &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295;0.000000000000000E+00 > &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; -0.100250272080302E-01 > &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295;0.000000000000000E+00 > &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295;0.963471177965403E-02 > &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295;0.000000000000000E+00 > &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; -0.656183436512947E-02 > &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295;0.000000000000000E+00 > &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295;0.624465197324753E-02 > &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295;0.000000000000000E+00 > &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; -0.318178627640009E-02 > > I'll see if I can't find better code than what created this example. > > Fred
Thanks Fred, It does just what you advertised (not that I doubted you, I just wanted to see the response). Very interesting, I will have to reread your method. Thanks again, Dirk