I've noticed something strange about some filters designed with Parks-McClellan. For example, if I design a lowpass with 4096 taps, upper passband of .003906, lower stopband of .0045, ripple of 0.2dB, and a stopband of 50dB, I get an a filter that meets the requirements, but the impulse response looks strange. It looks like a sinc pulse for the most part, except at the outer edges, where it diverges from the 1/x envelope a bit. Then, the outer two samples have a really large magnitude. This seems to happen in all filters in which the number of taps is high and the transition region is small. Sometimes the outer two samples have a magnitude almost half as large at the main lobe. I want to use the filter as an interpolator, and these outer two samples pose a problem. Since they only exist in two out of the M polyphases, the phases in which they appear give strange results. If I just truncase these two samples from the impulse response, the frequency response changes drastically. Normally, on a 4096-tap filter, you should be able to truncate the outer two samples without affecting the frequency response much. Is this normal? Is there some way to constrain P-M to yield a more normal impulse response? More background: I modified P-M to create root-raised cosine fitlers. The modified algorithm works well. However, I want to make an interpolate-by-128 RRC. When I use my modified program to do this, I get an equiripple response but I have the two strange samples in the impulse response. I found I get the same thing with an unmodified P-M algorithm when there are a lot of taps and the transition region is small. -Kevin
Unusual Impulse Resp. from Parks-McClellan
Started by ●September 21, 2003
Reply by ●September 21, 20032003-09-21
"Kevin Neilson" <kevin_neilson@removethiscomcast.net> wrote in message news:nkqbb.401922$cF.125042@rwcrnsc53...> I've noticed something strange about some filters designed with > Parks-McClellan. For example, if I design a lowpass with 4096 taps, upper > passband of .003906, lower stopband of .0045, ripple of 0.2dB, and a > stopband of 50dB, I get an a filter that meets the requirements, but the > impulse response looks strange. It looks like a sinc pulse for the most > part, except at the outer edges, where it diverges from the 1/x envelope a > bit. Then, the outer two samples have a really large magnitude. Thisseems> to happen in all filters in which the number of taps is high and the > transition region is small. Sometimes the outer two samples have a > magnitude almost half as large at the main lobe. > [...]That is a common problem in equiripple filters. The designed frequency response oscillates between the upper and lower constraints at a pretty constant frequency. This can show up as a pair of spikes in the impulse response, because an IFFT is just an FFT with a sign change. Off the top of my head, I expect that you could get rid of the spikes by shifting your transition band up or down a bit in frequency. My guess is that this will shift the phase of the oscillations in the positive and negative frequencies in different directions. When the differential shift is just right, they should cancel out in the impulse response and the spikes should disappear. I could be wrong. If you try it, *please* let me know whether or not it works! An alternative would be to constrain the response at 0 Hz to a precise value. By moving this value up or down within the given tolerences, you may be able to effect a similar shift in the phase of those oscillations. I know this has been discussed in this group before, but a cursory search of the archives didn't turn up anything useful information for me.
Reply by ●September 22, 20032003-09-22
Kevin Neilson wrote:> I've noticed something strange about some filters designed with > Parks-McClellan. For example, if I design a lowpass with 4096 taps, up=per> passband of .003906, lower stopband of .0045, ripple of 0.2dB, and a > stopband of 50dB, I get an a filter that meets the requirements, but th=e> impulse response looks strange. It looks like a sinc pulse for the mos=t> part, except at the outer edges, where it diverges from the 1/x envelop=e a> bit. Then, the outer two samples have a really large magnitude. This =seems> to happen in all filters in which the number of taps is high and the > transition region is small. Sometimes the outer two samples have a > magnitude almost half as large at the main lobe. >=20 > I want to use the filter as an interpolator, and these outer two sample=s> pose a problem. Since they only exist in two out of the M polyphases, =the> phases in which they appear give strange results. If I just truncase t=hese> two samples from the impulse response, the frequency response changes > drastically. Normally, on a 4096-tap filter, you should be able to tru=ncate> the outer two samples without affecting the frequency response much. >=20 > Is this normal? Is there some way to constrain P-M to yield a more nor=mal> impulse response? >=20 > More background: I modified P-M to create root-raised cosine fitlers. =The> modified algorithm works well. However, I want to make an > interpolate-by-128 RRC. When I use my modified program to do this, I g=et an> equiripple response but I have the two strange samples in the impulse > response. I found I get the same thing with an unmodified P-M algorith=m> when there are a lot of taps and the transition region is small. >=20 > -Kevin >=20I learned here recently that other optimizations -- least square error,=20 for example -- often yield more desirable impulse responses. With a few=20 extra taps and a nice window like Blackman, the problem doesn't arise.=20 Does theory matter, or do you have the resources to live with a slightly = sub-optimum solution? --=20 Engineering is the art of making what you want from things you can get. =AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF= =AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF= =AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF
Reply by ●September 22, 20032003-09-22
"Kevin Neilson" <kevin_neilson@removethiscomcast.net> wrote in message news:nkqbb.401922$cF.125042@rwcrnsc53...> I've noticed something strange about some filters designed with > Parks-McClellan. For example, if I design a lowpass with 4096 taps, upper > passband of .003906, lower stopband of .0045, ripple of 0.2dB, and a > stopband of 50dB, I get an a filter that meets the requirements, but the > impulse response looks strange. It looks like a sinc pulse for the most > part, except at the outer edges, where it diverges from the 1/x envelope a > bit. Then, the outer two samples have a really large magnitude. Thisseems> to happen in all filters in which the number of taps is high and the > transition region is small. Sometimes the outer two samples have a > magnitude almost half as large at the main lobe. > > I want to use the filter as an interpolator, and these outer two samples > pose a problem. Since they only exist in two out of the M polyphases, the > phases in which they appear give strange results. If I just truncasethese> two samples from the impulse response, the frequency response changes > drastically. Normally, on a 4096-tap filter, you should be able totruncate> the outer two samples without affecting the frequency response much. > > Is this normal? Is there some way to constrain P-M to yield a more normal > impulse response? > > More background: I modified P-M to create root-raised cosine fitlers.The> modified algorithm works well. However, I want to make an > interpolate-by-128 RRC. When I use my modified program to do this, I getan> equiripple response but I have the two strange samples in the impulse > response. I found I get the same thing with an unmodified P-M algorithm > when there are a lot of taps and the transition region is small.Kevin, (Which Parks-McClellan program are you using that gives you 4096 length? Just curious.) Yes, this is normal because there's a lot of energy at the frequency of the stopband ripples. As Jerry suggests, you might try a different objective function or metric. At any rate, the idea is to perturb the steady frequency content of the stopband ripples - or, as you have already asked, to remove the large coefficients at the end of the filter. This is done by tapering the filter which is also done by tapering the filter response. If you want to stay with the same program, you might try this: Define a 3-band filter with: Band 1 value 1.0 (the passband), with weight 1.0 Band 2 value 0 with weight 1.0 (the "real" stopband) Band 3 value 0 with weight 1000 (a contrived stopband) Vary the transition point between Bands 2 and 3. Perhaps make band 3 start at 0.49*fs - something like that. The idea is to taper the frequency response toward zero at fs/2. So force the end of the frequency response to go toward zero. This should get rid of the large coefficients at the end of the filter at some expense to ripple in the rest of the filter. Fred
Reply by ●September 22, 20032003-09-22
On Sun, 21 Sep 2003 23:17:39 GMT, "Kevin Neilson" <kevin_neilson@removethiscomcast.net> wrote:>I've noticed something strange about some filters designed with >Parks-McClellan. For example, if I design a lowpass with 4096 taps, upper >passband of .003906, lower stopband of .0045, ripple of 0.2dB, and a >stopband of 50dB, I get an a filter that meets the requirements, but the >impulse response looks strange. It looks like a sinc pulse for the most >part, except at the outer edges, where it diverges from the 1/x envelope a >bit. Then, the outer two samples have a really large magnitude. This seems >to happen in all filters in which the number of taps is high and the >transition region is small. Sometimes the outer two samples have a >magnitude almost half as large at the main lobe. > >I want to use the filter as an interpolator, and these outer two samples >pose a problem. Since they only exist in two out of the M polyphases, the >phases in which they appear give strange results. If I just truncase these >two samples from the impulse response, the frequency response changes >drastically. Normally, on a 4096-tap filter, you should be able to truncate >the outer two samples without affecting the frequency response much. > >Is this normal? Is there some way to constrain P-M to yield a more normal >impulse response? > >More background: I modified P-M to create root-raised cosine fitlers. The >modified algorithm works well. However, I want to make an >interpolate-by-128 RRC. When I use my modified program to do this, I get an >equiripple response but I have the two strange samples in the impulse >response. I found I get the same thing with an unmodified P-M algorithm >when there are a lot of taps and the transition region is small. > >-KevinKevin, Another approach for a polyphase application is to design the filter with fewer taps and then interpolate it up to what you need. This is described briefly at http://www.dspguru.com/comp.dsp/tricks/dsn/firintrp.htm This is also handy if your P-M or Remez is restricted in the number of output taps that it can deal with. In any case, this may let you constrain the parameters differently for the desired response with fewer taps. In my experience the "flying end taps" are less likely with fewer taps, but YMMV. Eric Jacobsen Minister of Algorithms, Intel Corp. My opinions may not be Intel's opinions. http://www.ericjacobsen.org
Reply by ●September 22, 20032003-09-22
"Eric Jacobsen" <eric.jacobsen@ieee.org> wrote in message news:3f6f5701.310842012@news.west.earthlink.net...> > Another approach for a polyphase application is to design the filter > with fewer taps and then interpolate it up to what you need. This is > described briefly at > > http://www.dspguru.com/comp.dsp/tricks/dsn/firintrp.htm > > This is also handy if your P-M or Remez is restricted in the number of > output taps that it can deal with. > > In any case, this may let you constrain the parameters differently for > the desired response with fewer taps. In my experience the "flying > end taps" are less likely with fewer taps, but YMMV. > > > Eric Jacobsen > Minister of Algorithms, Intel Corp. > My opinions may not be Intel's opinions. > http://www.ericjacobsen.orgEric, I'll try that. I tried something very similar but with limited success. I decided to make a 2X interpolator and try to convert it into an 8X interpolator. I stuffed three zeroes between each sample of the impulse response, and then I lowpass-filtered the IMPULSE response to interpolate the three samples between each original sample. I filtered the filter. That worked, sort of, but the freq. response of that filter didn't have a really flat stopband and the first sidelobe was bigger. I'll try your method. -Kevin
Reply by ●September 22, 20032003-09-22
"Jerry Avins" <jya@ieee.org> wrote in message news:bklsqc$j53$1@bob.news.rcn.net... I learned here recently that other optimizations -- least square error, for example -- often yield more desirable impulse responses. With a few extra taps and a nice window like Blackman, the problem doesn't arise. Does theory matter, or do you have the resources to live with a slightly sub-optimum solution? -- Engineering is the art of making what you want from things you can get. ����������������������������������������������������������������������� I don't know about the least-square error, but I don't think I can use any windowing techniques. I'm making a root-Nyquist filter, and windowing ruins the Nyquist ISI characteristics of the original pulse. -Kevin
Reply by ●September 22, 20032003-09-22
"Matt Timmermans" <mt0000@sympatico.nospam-remove.ca> wrote in message news:Npsbb.2850$yD1.228715@news20.bellglobal.com...> > That is a common problem in equiripple filters. The designed frequency > response oscillates between the upper and lower constraints at a pretty > constant frequency. This can show up as a pair of spikes in the impulse > response, because an IFFT is just an FFT with a sign change. > > Off the top of my head, I expect that you could get rid of the spikes by > shifting your transition band up or down a bit in frequency. My guess is > that this will shift the phase of the oscillations in the positive and > negative frequencies in different directions. When the differential shift > is just right, they should cancel out in the impulse response and thespikes> should disappear. I could be wrong. If you try it, *please* let me know > whether or not it works! > > An alternative would be to constrain the response at 0 Hz to a precise > value. By moving this value up or down within the given tolerences, youmay> be able to effect a similar shift in the phase of those oscillations. > > I know this has been discussed in this group before, but a cursory searchof> the archives didn't turn up anything useful information for me. >Matt, I like that explanation. Now I understand where the spikes come from. The ripple in the stopband is very regular. I tried both of those techniques and they do have an effect. I moved the transition band around a little at a time and could see the spikes get smaller. Unfortunately I don't think this will work for me because I have to have the transition band in a precise location. I also put a small notch at DC and moved it up and down and this had some effect too, although it was harder to control. Can the positions of the extrema points in the stopband be moved? I wonder if I could modfiy the P-M routine so that it "dithers" the frequency response stopband samples before the impulse response is created. This would probably lead to a sub-optimal stopband, but it might get rid of the spikes. -Kevin
Reply by ●September 22, 20032003-09-22
"Kevin Neilson" <kevin_neilson@removethiscomcast.net> wrote in message news:ZQLbb.408406$Oz4.199513@rwcrnsc54...> I don't know about the least-square error, but I don't think I can use any > windowing techniques. I'm making a root-Nyquist filter, and windowingruins> the Nyquist ISI characteristics of the original pulse. > -KevinThat gives me another idea -- generate a prototype filter with P-M, using a slightly narrower transition band, and then multiply it by a sine-window. The sine window is just a positive half-cycle of a sine wave. Normally, it makes a pretty mediocre window, but in this case, since your P-M filter is already time-limited, multiplying by a sine window is exactly equivalent to modulating with a complete sinusoid. The effect on the frequency response is very simple and predictable -- two copies are shifted up and down by the frequency of that sinusoid and added together. The result is a predictably widened transition region and a bit more maximum ripple. If your P-M routine allows it, you could even invert the effects on the transition band before designing your filter, allowing you to give P-M a wider transition band, which will reduce stopband ripple.
Reply by ●September 22, 20032003-09-22
"Kevin Neilson" <kevin_neilson@removethiscomcast.net> wrote in message news:0_Lbb.409136$cF.126743@rwcrnsc53...> Can the positions of the extrema points in the stopband be moved? Iwonder> if I could modfiy the P-M routine so that it "dithers" the frequency > response stopband samples before the impulse response is created. This > would probably lead to a sub-optimal stopband, but it might get rid of the > spikes.I think the results would be an unpredictable response. P-M is a two-phase algorithm. In each iteration, it chooses sample points for the extrema based on the previous iteration, and then generates a completely new optimal response at those points. The whole effect of all those iterations is to pick good sample points. You don't want to throw that away by moving them. I put what I think is a better idea in Jerry's branch of this thread.






