DSPRelated.com
Forums

FIR interpolator

Started by Vladimir Vassilevsky March 11, 2008
"Vladimir Vassilevsky" <antispam_bogus@hotmail.com> wrote in message 
news:_PzBj.15715$Ej5.2369@newssvr29.news.prodigy.net...
> > Recently I run into the problem with a basic task: design of a polyphase > set of filters for the interpolation of a signal. The input is the sampled > signal; the output should be the interpolated values spaced at 1/10 of the > sample. > > So, I designed the LPF at 10 x sample rate by the Parks-McClellan > algorithm, and then decimated it into 10 subsets of the coefficients. > > But, although the original filter is well within the specs, the decimated > subsets (calculated to the original sample rate) are not! There is a > significant difference is in the passband flatness as well as in the > stopband. > > Where is the mistake? > > > Vladimir Vassilevsky > DSP and Mixed Signal Design Consultant > http://www.abvolt.com >
Vladimir, I'm not sure I understand what you're doing yet. You can't just take any filter and make it polyphase. The essential ingredient is that only certain coefficients contribute to the output at each output sample instant. Once that's ascertained then the filter can be split into "phases" leading to a polyphase / parallel sort of implementation. Otherwise it can't. A classical halfband filter meets this criterion because (nearly) half of the coefficients are zero and equispaced. Thus one shift of the half the input samples contribute to the output and one delay later the opposite input samples contribute to the output. So, one can construct two filter paths that add at the output. It's not proper to simply skip multiplies that are in the original filter design. But, perhaps I missed the point? Fred Fred
On Mar 11, 12:16 pm, dbell <bellda2...@cox.net> wrote:
> On Mar 11, 3:58 pm, Vladimir Vassilevsky <antispam_bo...@hotmail.com> > wrote: > > Vladimir Vassilevsky wrote: > > > > Recently I run into the problem with a basic task: design of a polyphase > > > set of filters for the interpolation of a signal. The input is the > > > sampled signal; the output should be the interpolated values spaced at > > > 1/10 of the sample. > > > > So, I designed the LPF at 10 x sample rate by the Parks-McClellan > > > algorithm, and then decimated it into 10 subsets of the coefficients. > > > > But, although the original filter is well within the specs, the > > > decimated subsets (calculated to the original sample rate) are not! > > > There is a significant difference is in the passband flatness as well as > > > in the stopband. > > > > Where is the mistake? > > > What happens: when the original interpolator LPF response is decimated > > by the factor of N, its stopband gets aliased by the factor of N also. > > This alters the frequency response of the subset filters. So, if it is > > desired to keep the passband flatness, then the stopband attenuation of > > the original filter has to be increased. In the worst case, the increase > > should be by the factor of N, however you can probably get by the > > smaller factors. > > > Thanks to everybody! The question is clear now. > > > Vladimir Vassilevsky > > DSP and Mixed Signal Design Consultanthttp://www.abvolt.com-Hide quoted text - > > > - Show quoted text - > > If the net effect is a flat passband on the whole filter, what is the > concern about the individual partial filters?
1) They give you a properly filtered or interpolated partial sample tapped delay line, or 1/10th sample delay element. 2) If the result from the full filter is properly bandlimited to below 1/20th the new sample rate, then subsampling that new bandlimited signal at or above 1/10th the new sample rate should produce results that allow reconstruction of the original signal. IMHO. YMMV. -- rhn A.T nicholson d.0.t C-o-M
On Mar 11, 4:36&#4294967295;pm, "Ron N." <rhnlo...@yahoo.com> wrote:
> On Mar 11, 12:16 pm, dbell <bellda2...@cox.net> wrote: > > > > > > > On Mar 11, 3:58 pm, Vladimir Vassilevsky <antispam_bo...@hotmail.com> > > wrote: > > > Vladimir Vassilevsky wrote: > > > > > Recently I run into the problem with a basic task: design of a polyphase > > > > set of filters for the interpolation of a signal. The input is the > > > > sampled signal; the output should be the interpolated values spaced at > > > > 1/10 of the sample. > > > > > So, I designed the LPF at 10 x sample rate by the Parks-McClellan > > > > algorithm, and then decimated it into 10 subsets of the coefficients. > > > > > But, although the original filter is well within the specs, the > > > > decimated subsets (calculated to the original sample rate) are not! > > > > There is a significant difference is in the passband flatness as well as > > > > in the stopband. > > > > > Where is the mistake? > > > > What happens: when the original interpolator LPF response is decimated > > > by the factor of N, its stopband gets aliased by the factor of N also. > > > This alters the frequency response of the subset filters. So, if it is > > > desired to keep the passband flatness, then the stopband attenuation of > > > the original filter has to be increased. In the worst case, the increase > > > should be by the factor of N, however you can probably get by the > > > smaller factors. > > > > Thanks to everybody! The question is clear now. > > > > Vladimir Vassilevsky > > > DSP and Mixed Signal Design Consultanthttp://www.abvolt.com-Hidequoted text - > > > > - Show quoted text - > > > If the net effect is a flat passband on the whole filter, what is the > > concern about the individual partial filters? > > 1) > They give you a properly filtered or interpolated partial > sample tapped delay line, or 1/10th sample delay element. > > 2) > If the result from the full filter is properly bandlimited > to below 1/20th the new sample rate, then subsampling that > new bandlimited signal at or above 1/10th the new sample > rate should produce results that allow reconstruction of > the original signal. > > IMHO. YMMV. > -- > rhn A.T nicholson d.0.t C-o-M- Hide quoted text - > > - Show quoted text -
And would that not be true anyway if the original filter was appropriately designed, without caring exactly how the partial filters looked? Dirk
On Mar 11, 1:10 pm, dbell <bellda2...@cox.net> wrote:
> On Mar 11, 4:36 pm, "Ron N." <rhnlo...@yahoo.com> wrote: > > > > > On Mar 11, 12:16 pm, dbell <bellda2...@cox.net> wrote: > > > > On Mar 11, 3:58 pm, Vladimir Vassilevsky <antispam_bo...@hotmail.com> > > > wrote: > > > > Vladimir Vassilevsky wrote: > > > > > > Recently I run into the problem with a basic task: design of a polyphase > > > > > set of filters for the interpolation of a signal. The input is the > > > > > sampled signal; the output should be the interpolated values spaced at > > > > > 1/10 of the sample. > > > > > > So, I designed the LPF at 10 x sample rate by the Parks-McClellan > > > > > algorithm, and then decimated it into 10 subsets of the coefficients. > > > > > > But, although the original filter is well within the specs, the > > > > > decimated subsets (calculated to the original sample rate) are not! > > > > > There is a significant difference is in the passband flatness as well as > > > > > in the stopband. > > > > > > Where is the mistake? > > > > > What happens: when the original interpolator LPF response is decimated > > > > by the factor of N, its stopband gets aliased by the factor of N also. > > > > This alters the frequency response of the subset filters. So, if it is > > > > desired to keep the passband flatness, then the stopband attenuation of > > > > the original filter has to be increased. In the worst case, the increase > > > > should be by the factor of N, however you can probably get by the > > > > smaller factors. > > > > > Thanks to everybody! The question is clear now. > > > > > Vladimir Vassilevsky > > > > DSP and Mixed Signal Design Consultanthttp://www.abvolt.com-Hidequotedtext - > > > > > - Show quoted text - > > > > If the net effect is a flat passband on the whole filter, what is the > > > concern about the individual partial filters? > > > 1) > > They give you a properly filtered or interpolated partial > > sample tapped delay line, or 1/10th sample delay element. > > > 2) > > If the result from the full filter is properly bandlimited > > to below 1/20th the new sample rate, then subsampling that > > new bandlimited signal at or above 1/10th the new sample > > rate should produce results that allow reconstruction of > > the original signal. > > > IMHO. YMMV. > > -- > > rhn A.T nicholson d.0.t C-o-M- Hide quoted text - > > > - Show quoted text - > > And would that not be true anyway if the original filter was > appropriately designed, without caring exactly how the partial filters > looked?
The question appears to be how to appropriately design the original filter if you actually do care about the output of the partial filters (as would be the case if you were using them as a selectable delay elements, or some-such.) e.g. If have a given Passband specification for the partial filters, is it affected by the Stopband spec in the undecimated full filter? Looks like it might be. IMHO. YMMV. -- rhn A.T nicholson d.0.t C-o-M
On Tue, 11 Mar 2008 13:22:03 -0700, "Fred Marshall"
<fmarshallx@remove_the_x.acm.org> wrote:

>I'm not sure I understand what you're doing yet. You can't just take any >filter and make it polyphase. The essential ingredient is that only certain >coefficients contribute to the output at each output sample instant. Once >that's ascertained then the filter can be split into "phases" leading to a >polyphase / parallel sort of implementation. Otherwise it can't.
I'm not convinced that's strictly true. Generally you're using a polyphase filter to resample by M/N, with certain restrictions on the common factors of M and N. Under these circumstances you're 'conceptually' upsampling to LCM(M,N) (LCM = least common multiple), anti-alias filtering as appropriate, and decimating. With a polyphase filter, in this situation, I believe that you'll need the output from every phase at one point in time or another, just not *all* of them *all* of the time. And I think that any old filter will suffice for the polyphase implementation, provided that it meets the anti-aliasing criteria when implemented at the LCM sampling rate. Vladimir appears to be doing something different. It looks like he's keeping his original sampling rate, but shifting his sampling times 1/10 sample period by interpolating. In this case he's really only using one phase of his polyphase filter, and throwing the other nine away. So for this I think he just needs a filter that works better after its coefficients have been decimated.
>A classical halfband filter meets this criterion because (nearly) half of >the coefficients are zero and equispaced. Thus one shift of the half the >input samples contribute to the output and one delay later the opposite >input samples contribute to the output. So, one can construct two filter >paths that add at the output. > >It's not proper to simply skip multiplies that are in the original filter >design.
If you were to construct the two decimated filters extracted from the two "halves" of the halfband filter, their frequency responses would be dissimilar due to aliasing. Their sum would be okay, but each one individually would not look exactly like the desired overall response. This is similar to what Vladimir is apparently observing. Greg
On Tue, 11 Mar 2008 13:22:03 -0700, "Fred Marshall"
<fmarshallx@remove_the_x.acm.org> wrote:

> >"Vladimir Vassilevsky" <antispam_bogus@hotmail.com> wrote in message >news:_PzBj.15715$Ej5.2369@newssvr29.news.prodigy.net... >> >> Recently I run into the problem with a basic task: design of a polyphase >> set of filters for the interpolation of a signal. The input is the sampled >> signal; the output should be the interpolated values spaced at 1/10 of the >> sample. >> >> So, I designed the LPF at 10 x sample rate by the Parks-McClellan >> algorithm, and then decimated it into 10 subsets of the coefficients. >> >> But, although the original filter is well within the specs, the decimated >> subsets (calculated to the original sample rate) are not! There is a >> significant difference is in the passband flatness as well as in the >> stopband. >> >> Where is the mistake? >> >> >> Vladimir Vassilevsky >> DSP and Mixed Signal Design Consultant >> http://www.abvolt.com >> > >Vladimir, > >I'm not sure I understand what you're doing yet. You can't just take any >filter and make it polyphase. The essential ingredient is that only certain >coefficients contribute to the output at each output sample instant. Once >that's ascertained then the filter can be split into "phases" leading to a >polyphase / parallel sort of implementation. Otherwise it can't. > >A classical halfband filter meets this criterion because (nearly) half of >the coefficients are zero and equispaced. Thus one shift of the half the >input samples contribute to the output and one delay later the opposite >input samples contribute to the output. So, one can construct two filter >paths that add at the output. > >It's not proper to simply skip multiplies that are in the original filter >design. > >But, perhaps I missed the point? > >Fred
Having built resampling polyphase filters with arbitrary coefficients (i.e., read from RAM), that had all sorts of coefficient sets in practical use, both symmetric and minimum-phase, I don't think your assertion is accurate. As long as the filter is reasonably designed to avoid aliasing under the configured resampling conditions and the coefficients were adequately oversampled, it's a fairly generalized problem. At least in our case everything always worked as expected, and we did some weird stuff with it. Eric Jacobsen Minister of Algorithms Abineau Communications http://www.ericjacobsen.org
On Mar 12, 9:56 am, Eric Jacobsen <eric.jacob...@ieee.org> wrote:
> On Tue, 11 Mar 2008 13:22:03 -0700, "Fred Marshall" > > > > <fmarshallx@remove_the_x.acm.org> wrote: > > >"Vladimir Vassilevsky" <antispam_bo...@hotmail.com> wrote in message > >news:_PzBj.15715$Ej5.2369@newssvr29.news.prodigy.net... > > >> Recently I run into the problem with a basic task: design of a polyphase > >> set of filters for the interpolation of a signal. The input is the sampled > >> signal; the output should be the interpolated values spaced at 1/10 of the > >> sample. > > >> So, I designed the LPF at 10 x sample rate by the Parks-McClellan > >> algorithm, and then decimated it into 10 subsets of the coefficients. > > >> But, although the original filter is well within the specs, the decimated > >> subsets (calculated to the original sample rate) are not! There is a > >> significant difference is in the passband flatness as well as in the > >> stopband. > > >> Where is the mistake? > > >> Vladimir Vassilevsky > >> DSP and Mixed Signal Design Consultant > >>http://www.abvolt.com > > >Vladimir, > > >I'm not sure I understand what you're doing yet. You can't just take any > >filter and make it polyphase. The essential ingredient is that only certain > >coefficients contribute to the output at each output sample instant. Once > >that's ascertained then the filter can be split into "phases" leading to a > >polyphase / parallel sort of implementation. Otherwise it can't. > > >A classical halfband filter meets this criterion because (nearly) half of > >the coefficients are zero and equispaced. Thus one shift of the half the > >input samples contribute to the output and one delay later the opposite > >input samples contribute to the output. So, one can construct two filter > >paths that add at the output. > > >It's not proper to simply skip multiplies that are in the original filter > >design. > > >But, perhaps I missed the point? > > >Fred > > Having built resampling polyphase filters with arbitrary coefficients > (i.e., read from RAM), that had all sorts of coefficient sets in > practical use, both symmetric and minimum-phase, I don't think your > assertion is accurate. As long as the filter is reasonably designed > to avoid aliasing under the configured resampling conditions and the > coefficients were adequately oversampled, it's a fairly generalized > problem. > > At least in our case everything always worked as expected, and we did > some weird stuff with it.
Were you concerned about extreme flatness in the passband? I think the key difference might be that Vladimir was concerned about passband ripple after proper decimation or subsampling. Subsampling a properly but imperfectly bandlimited signal (e.g. new Fs > Bw*2, but the bandlimit filter length was finite) causes the a portion of the filter stopband ripple to affect the resulting passband ripple. One needs to find the overlapping portions of the repeated filter spectra, and perhaps use tighter constraints on those segments of the bandlimit filter. IMHO. YMMV. -- rhn A.T nicholson d.0.t C-o-M http://www.nicholson.com/rhn/dsp.html

Ron N. wrote:

>>>"Vladimir Vassilevsky" <antispam_bo...@hotmail.com> wrote in message >>>news:_PzBj.15715$Ej5.2369@newssvr29.news.prodigy.net... >> >>>>Recently I run into the problem with a basic task: design of a polyphase >>>>set of filters for the interpolation of a signal. The input is the sampled >>>>signal; the output should be the interpolated values spaced at 1/10 of the >>>>sample. >> >>>>So, I designed the LPF at 10 x sample rate by the Parks-McClellan >>>>algorithm, and then decimated it into 10 subsets of the coefficients. >> >>>>But, although the original filter is well within the specs, the decimated >>>>subsets (calculated to the original sample rate) are not! There is a >>>>significant difference is in the passband flatness as well as in the >>>>stopband. >> > I think the key difference might be that Vladimir was > concerned about passband ripple after proper decimation or > subsampling.
My goal was a variable delay line with a resolution of 1/10 of a sample. So I am using just one of the subsets of the coefficients of the x10 interpolation filter at a time. It was quite unexpected to find out that the frequency response of a subset filter in the passband could be very different from that of the complete interpolation filter. I don't know what should be the exact design procedure, however it looks like for the worst case the interpolator filter by N should have lower stopband by the factor of N also. I guess you have to do several iterations adjusting the stopband. Vladimir Vassilevsky DSP and Mixed Signal Design Consultant http://www.abvolt.com
On Mar 12, 11:03 am, Vladimir Vassilevsky <antispam_bo...@hotmail.com>
wrote:
> Ron N. wrote: > >>>"Vladimir Vassilevsky" <antispam_bo...@hotmail.com> wrote in message > >>>news:_PzBj.15715$Ej5.2369@newssvr29.news.prodigy.net... > > >>>>Recently I run into the problem with a basic task: design of a polyphase > >>>>set of filters for the interpolation of a signal. The input is the sampled > >>>>signal; the output should be the interpolated values spaced at 1/10 of the > >>>>sample. > > >>>>So, I designed the LPF at 10 x sample rate by the Parks-McClellan > >>>>algorithm, and then decimated it into 10 subsets of the coefficients. > > >>>>But, although the original filter is well within the specs, the decimated > >>>>subsets (calculated to the original sample rate) are not! There is a > >>>>significant difference is in the passband flatness as well as in the > >>>>stopband. > > > I think the key difference might be that Vladimir was > > concerned about passband ripple after proper decimation or > > subsampling. > > My goal was a variable delay line with a resolution of 1/10 of a sample.
That was my guess.
> So I am using just one of the subsets of the coefficients of the x10 > interpolation filter at a time. It was quite unexpected to find out that > the frequency response of a subset filter in the passband could be very > different from that of the complete interpolation filter.
Subsampling (by 1/10th) in the time domain repeats the filter's frequency response in the frequency domain. The resultant subset filter is the sum of those overlapped spectra. Only if there is no overlap (Nyquist) and the stopband level is zero will the new frequency response be identical.
> I don't know what should be the exact design procedure, however it looks > like for the worst case the interpolator filter by N should have lower > stopband by the factor of N also. I guess you have to do several > iterations adjusting the stopband.
Try finding those segments of the stopband that overlaps the passband in the repeated spectra, and only constrain those smaller portions lower. e.g. equiripple with notches. Might result in a shorter filter. IMHO. YMMV. -- rhn A.T nicholson d.0.t C-o-M http://www.nicholson.com/rhn/dsp.html
On Mar 12, 5:23 pm, "Ron N." <rhnlo...@yahoo.com> wrote:
...
> Try finding those segments of the stopband that overlaps > the passband in the repeated spectra, and only constrain > those smaller portions lower. e.g. equiripple with notches.
i thought i said as much. if you have notches to -inf dB at integer multiples of Fs, then, at least at DC, there won't be any difference between the different phases.
> Might result in a shorter filter.
if you compare apples to apples with the same length filter, there is a slight trade off with the first and biggest stopband lobe.
> IMHO.
my O, too. r b-j