Forums

Polyphase decimation errors

Started by Alasdair September 30, 2003
Folks, 
I understand that, based on the Nobel Identities, the output of a
polyphase decimator should be identical to the output of a basic FIR
decimator. This is due to the fact that even though we decimate in the
full input bandwidth all the undersampled aliases will exactly cancel
in the final summation.
 
My question is, is this still the case even when we have finite
sampling rate and other real world limitations?

The reason I ask is I am trying to find the source of an error, and in
doing so I am comparing the output of a 'standard' FIR decimator (as a
test case), and a polyphase decimator.

In the frequency domain I appear to get the same output.
In the time domain I can see the two traces are very similar, but
there are slight differences in structure between the two. I.e. extra
or missing low frequency peaks and or phase shifts.

Below are some details of my implementation.
Any information appreciated.

Thanks, 

Al




The input is noise (uniform random number).
The sample rate is ~50MSPS
The FIR filter has 600 coefficients
The FIR filter has pass band of 0 - 1MHz and cutoff at 1.2MHz.
Pass band attenuation is 1dB. Out of band rejection is 73.1dB
The coefficients are saved in variable 'Num'

The polyphase filter has 6 subfilters, using coefficients as below:
    Num([1:6:length(Num)]+0)
    Num([1:6:length(Num)]+1)
    Num([1:6:length(Num)]+2)
    Num([1:6:length(Num)]+3)
    Num([1:6:length(Num)]+4)
    Num([1:6:length(Num)]+5)

Note that this filter has been set up as an example - nothing should
be read into any mismatch between the number of coeffs, the pass band
and the decimation.
"Alasdair" <alasdair.marsh@baesystems.com> wrote in message
news:76988c29.0309301013.1d02ab9d@posting.google.com...
> Folks, > I understand that, based on the Nobel Identities, the output of a > polyphase decimator should be identical to the output of a basic FIR > decimator. This is due to the fact that even though we decimate in the > full input bandwidth all the undersampled aliases will exactly cancel > in the final summation. > > My question is, is this still the case even when we have finite > sampling rate and other real world limitations?
Yes. The only thing that I can think off the top of my head that may be different between the 2 outputs, is the delay. Depending on the implementation, the delay through the 2 cases may be different. While the outputs themselves don't differ, their time alignments might be off. I'm not very positive about this, but this is my gut reaction.
> > The reason I ask is I am trying to find the source of an error, and in > doing so I am comparing the output of a 'standard' FIR decimator (as a > test case), and a polyphase decimator. > > In the frequency domain I appear to get the same output. > In the time domain I can see the two traces are very similar, but > there are slight differences in structure between the two. I.e. extra > or missing low frequency peaks and or phase shifts. > > Below are some details of my implementation. > Any information appreciated. > > Thanks, > > Al > > > > > The input is noise (uniform random number). > The sample rate is ~50MSPS > The FIR filter has 600 coefficients > The FIR filter has pass band of 0 - 1MHz and cutoff at 1.2MHz. > Pass band attenuation is 1dB. Out of band rejection is 73.1dB > The coefficients are saved in variable 'Num' > > The polyphase filter has 6 subfilters, using coefficients as below: > Num([1:6:length(Num)]+0) > Num([1:6:length(Num)]+1) > Num([1:6:length(Num)]+2) > Num([1:6:length(Num)]+3) > Num([1:6:length(Num)]+4) > Num([1:6:length(Num)]+5) > > Note that this filter has been set up as an example - nothing should > be read into any mismatch between the number of coeffs, the pass band > and the decimation.
"Alasdair" <alasdair.marsh@baesystems.com> wrote in message
news:76988c29.0309301013.1d02ab9d@posting.google.com...
> Folks, > I understand that, based on the Nobel Identities, the output of a > polyphase decimator should be identical to the output of a basic FIR > decimator. This is due to the fact that even though we decimate in the > full input bandwidth all the undersampled aliases will exactly cancel > in the final summation. > > My question is, is this still the case even when we have finite > sampling rate and other real world limitations? > > The reason I ask is I am trying to find the source of an error, and in > doing so I am comparing the output of a 'standard' FIR decimator (as a > test case), and a polyphase decimator. > > In the frequency domain I appear to get the same output. > In the time domain I can see the two traces are very similar, but > there are slight differences in structure between the two. I.e. extra > or missing low frequency peaks and or phase shifts. > > Below are some details of my implementation. > Any information appreciated. > > Thanks, > > Al > > > > > The input is noise (uniform random number). > The sample rate is ~50MSPS > The FIR filter has 600 coefficients > The FIR filter has pass band of 0 - 1MHz and cutoff at 1.2MHz. > Pass band attenuation is 1dB. Out of band rejection is 73.1dB > The coefficients are saved in variable 'Num' > > The polyphase filter has 6 subfilters, using coefficients as below: > Num([1:6:length(Num)]+0) > Num([1:6:length(Num)]+1) > Num([1:6:length(Num)]+2) > Num([1:6:length(Num)]+3) > Num([1:6:length(Num)]+4) > Num([1:6:length(Num)]+5) > > Note that this filter has been set up as an example - nothing should > be read into any mismatch between the number of coeffs, the pass band > and the decimation.
I think that Rick Lyons book on DSP has a very illuminating treatment of polyphase filters. You might take a look at it. As far as I'm concerned, a polyphase implementation is simply a way to reduce the number of operations necessary as compared to the brute-force FIR implementation. It would have no meaning at all if implemented in the frequency domain as a multiplication - which is often more efficient. So, whether it's a good idea depends on your platform context. In other words, it shouldn't matter if the implementation is polyphase or not. Well, except perhaps for things like roundoff noise where it may make a real world difference. Somehow I think that dealing with roundoff noise (meaning to not just accept what you get) would tweak any architecture... Fred
"Fred Marshall" <fmarshallx@remove_the_x.acm.org> wrote in message news:<Kyqeb.28$F4.14236@feed2.centurytel.net>...
> "Alasdair" <alasdair.marsh@baesystems.com> wrote in message > news:76988c29.0309301013.1d02ab9d@posting.google.com... > > Folks, > > I understand that, based on the Nobel Identities, the output of a > > polyphase decimator should be identical to the output of a basic FIR > > decimator. This is due to the fact that even though we decimate in the > > full input bandwidth all the undersampled aliases will exactly cancel > > in the final summation. > > > > My question is, is this still the case even when we have finite > > sampling rate and other real world limitations? > > > > The reason I ask is I am trying to find the source of an error, and in > > doing so I am comparing the output of a 'standard' FIR decimator (as a > > test case), and a polyphase decimator. > > > > In the frequency domain I appear to get the same output. > > In the time domain I can see the two traces are very similar, but > > there are slight differences in structure between the two. I.e. extra > > or missing low frequency peaks and or phase shifts. > > > > Below are some details of my implementation. > > Any information appreciated. > > > > Thanks, > > > > Al > > > > > > > > > > The input is noise (uniform random number). > > The sample rate is ~50MSPS > > The FIR filter has 600 coefficients > > The FIR filter has pass band of 0 - 1MHz and cutoff at 1.2MHz. > > Pass band attenuation is 1dB. Out of band rejection is 73.1dB > > The coefficients are saved in variable 'Num' > > > > The polyphase filter has 6 subfilters, using coefficients as below: > > Num([1:6:length(Num)]+0) > > Num([1:6:length(Num)]+1) > > Num([1:6:length(Num)]+2) > > Num([1:6:length(Num)]+3) > > Num([1:6:length(Num)]+4) > > Num([1:6:length(Num)]+5) > > > > Note that this filter has been set up as an example - nothing should > > be read into any mismatch between the number of coeffs, the pass band > > and the decimation. > > I think that Rick Lyons book on DSP has a very illuminating treatment of > polyphase filters. You might take a look at it. > > As far as I'm concerned, a polyphase implementation is simply a way to > reduce the number of operations necessary as compared to the brute-force FIR > implementation. It would have no meaning at all if implemented in the > frequency domain as a multiplication - which is often more efficient. So, > whether it's a good idea depends on your platform context. > > In other words, it shouldn't matter if the implementation is polyphase or > not. Well, except perhaps for things like roundoff noise where it may make > a real world difference. Somehow I think that dealing with roundoff noise > (meaning to not just accept what you get) would tweak any architecture... > > Fred
Thanks Fred, I am in the process of ordering a small library on the very subject; one should not attempt to get everything for free on the Internet! For the contents pages on Amazon, Rick's book looks good. Does anyone have any other recommendations. I'd like to cover most of the subjects I've enquired about on here in at most 3 books. That would be software radio, especially FM and AM Demodulation and high efficiency decimation and filtering. If pressed I'd say I'd rather choose a text with a medium to high learning curve rather than a less detailed introduction, but with 3 books maybe a bit of both. On the subject of the original post, I think you have confirmed that if I am not getting the same result from my 'Normal FIR' Decimation as from my Poly-phase Decimator, then I have probably found the source of my errors, which is good. Thanks. Al