DSPRelated.com
Forums

Fractional Saving

Started by snigdha March 23, 2006
Hello everyone,

I have seen some posts regarding the implementation of IIR filters on a
fixed-point platform. I understand that using a cascade of DF1 IIR filters
combined with fractional saving would provide the best result. This is what
I am using currently.

Now, in my attempt to optimize the cascade structure, I read that
combining the poles of a biquad with the zeros of the next biquad is a
good procedure to go about. But, is that possible using the fractional
saving?

Any suggestions would be appreciated.

Thanks,
S L

snigdha wrote:
> Hello everyone, > > I have seen some posts regarding the implementation of IIR filters on a > fixed-point platform. I understand that using a cascade of DF1 IIR filters > combined with fractional saving would provide the best result. This is what > I am using currently. > > Now, in my attempt to optimize the cascade structure, I read that > combining the poles of a biquad with the zeros of the next biquad is a > good procedure to go about. But, is that possible using the fractional > saving?
I'm not sure of what you mean. If the poles and zeros cancel, then the overall order of the filter is unnecessarily high. If not, how are they to be combined? Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
in article yLudnYt8VMfgj77ZnZ2dnUVZ_sOdnZ2d@giganews.com, snigdha at
i_am_snigdha@yahoo.com wrote on 03/23/2006 16:26:

> I have seen some posts regarding the implementation of IIR filters on a > fixed-point platform. I understand that using a cascade of DF1 IIR filters > combined with fractional saving would provide the best result. This is what > I am using currently. > > Now, in my attempt to optimize the cascade structure, I read that > combining the poles of a biquad with the zeros of the next biquad is a > good procedure to go about. But, is that possible using the fractional > saving?
absolutely. there is no reason why these two optimizations have anything to do with each other. the fraction saving (otherwise know as "first-order noise shaping with a zero at DC") is a function of the quantizer. the feedback states (which are the same as the feedforward states of the next biquad section) get their input from the output of that quantizer. for an N sections of cascaded biquad with DF1, the number of states you need are 2N+2 (with the DF2 it's 2N). i have some old DSP56K code that demonstrates this. -- r b-j rbj@audioimagination.com "Imagination is more important than knowledge."
>snigdha wrote: >> Hello everyone, >> >> I have seen some posts regarding the implementation of IIR filters on
a
>> fixed-point platform. I understand that using a cascade of DF1 IIR
filters
>> combined with fractional saving would provide the best result. This is
what
>> I am using currently. >> >> Now, in my attempt to optimize the cascade structure, I read that >> combining the poles of a biquad with the zeros of the next biquad is a >> good procedure to go about. But, is that possible using the fractional >> saving? > >I'm not sure of what you mean. If the poles and zeros cancel, then the >overall order of the filter is unnecessarily high. If not, how are they >to be combined? > >Jerry >-- >Engineering is the art of making what you want from things you can get. >����������������������������������������������������������������������� >
I guess my use of words was not apt. By combining, I did not mean that the poles of a biquad and the zeros of the next cancel each other. The delay buffer for the poles of the first biquad is the same as the delay buffer for the zeros of the next biquad. This can be taken into consideration in the implementation of cascade filters of DF1 IIR filters. Thanks, S L
>in article yLudnYt8VMfgj77ZnZ2dnUVZ_sOdnZ2d@giganews.com, snigdha at >i_am_snigdha@yahoo.com wrote on 03/23/2006 16:26: > >> I have seen some posts regarding the implementation of IIR filters on
a
>> fixed-point platform. I understand that using a cascade of DF1 IIR
filters
>> combined with fractional saving would provide the best result. This is
what
>> I am using currently. >> >> Now, in my attempt to optimize the cascade structure, I read that >> combining the poles of a biquad with the zeros of the next biquad is a >> good procedure to go about. But, is that possible using the fractional >> saving? > >absolutely. there is no reason why these two optimizations have anything
to
>do with each other. the fraction saving (otherwise know as "first-order >noise shaping with a zero at DC") is a function of the quantizer. the >feedback states (which are the same as the feedforward states of the
next
>biquad section) get their input from the output of that quantizer. > >for an N sections of cascaded biquad with DF1, the number of states you
need
>are 2N+2 (with the DF2 it's 2N). > >i have some old DSP56K code that demonstrates this. > >-- > >r b-j rbj@audioimagination.com > >"Imagination is more important than knowledge." > > >
Thanks r-b-j. But, doesn't that mean that we are inherently implementing the structure in DF2 IIR filters? And, that was not supposed to be a good method of implementing fixed point IIR filters. Isn't it? Please clarify. Thanks, S L
snigdha wrote:
>>snigdha wrote: >> >>>Hello everyone, >>> >>>I have seen some posts regarding the implementation of IIR filters on > > a > >>>fixed-point platform. I understand that using a cascade of DF1 IIR > > filters > >>>combined with fractional saving would provide the best result. This is > > what > >>>I am using currently. >>> >>>Now, in my attempt to optimize the cascade structure, I read that >>>combining the poles of a biquad with the zeros of the next biquad is a >>>good procedure to go about. But, is that possible using the fractional >>>saving? >> >>I'm not sure of what you mean. If the poles and zeros cancel, then the >>overall order of the filter is unnecessarily high. If not, how are they >>to be combined? >> >>Jerry >>-- >>Engineering is the art of making what you want from things you can get. >>����������������������������������������������������������������������� >> > > I guess my use of words was not apt. By combining, I did not mean that the > poles of a biquad and the zeros of the next cancel each other. > > The delay buffer for the poles of the first biquad is the same as the > delay buffer for the zeros of the next biquad. This can be taken into > consideration in the implementation of cascade filters of DF1 IIR > filters.
Well, I ought to have guessed. Remainder saving applies to the calculated result. Combining storage doesn't remove the added accuracy. Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
in article HcGdnU-7PrKXvL7ZnZ2dnUVZ_vSdnZ2d@giganews.com, snigdha at
i_am_snigdha@yahoo.com wrote on 03/23/2006 17:28:

> Thanks r-b-j.
yer welcome, FWIW.
> But, doesn't that mean that we are inherently implementing the structure > in DF2 IIR filters? And, that was not supposed to be a good method of > implementing fixed point IIR filters. Isn't it? > > Please clarify.
again to repeat, this DF1 and DF2 issue is orthogonal to the fraction saving or noise shaping issue (hence i changed the subject line). it is not entirely different from the quantization issue, the DF2 has 2 quantizers in a single 2nd order filter whereas the DF1 has 1. you can draw this out to see. the states of the first DF2 section would be the feedforward states of the first contrived DF1. the feedback coefficients of the first DF2 section (usually called "a1" and "a2") would be zero and the feedforward coefs (b0, b1, b2) of the first DF2 would be the feedforward coefs of the first contrived DF1. anyway, it is true that if you have some devices that has N cascaded DF2 sections, you can give up 2 filter orders and make that same device into N-1 cascaded DF1 sections. and vice-versa. and it definitely is true, for any filter sections that are interesting (like they have a decently high Q or poles/zeros close to the unit circle), the DF1 is far preferable to the DF2 for fixed-point (and even floating-point) even if the DF1 is not "canonical" and has 2 more states than the filter order. (this assumes that for each DF1 section has a double wide accumulator or at least a wider accumulator than the word width of the states/signal.) -- r b-j rbj@audioimagination.com "Imagination is more important than knowledge."
>in article HcGdnU-7PrKXvL7ZnZ2dnUVZ_vSdnZ2d@giganews.com, snigdha at >i_am_snigdha@yahoo.com wrote on 03/23/2006 17:28: > >> Thanks r-b-j. > >yer welcome, FWIW. > >> But, doesn't that mean that we are inherently implementing the
structure
>> in DF2 IIR filters? And, that was not supposed to be a good method of >> implementing fixed point IIR filters. Isn't it? >> >> Please clarify. > >again to repeat, this DF1 and DF2 issue is orthogonal to the fraction
saving
>or noise shaping issue (hence i changed the subject line). it is not >entirely different from the quantization issue, the DF2 has 2 quantizers
in
>a single 2nd order filter whereas the DF1 has 1. you can draw this out
to
>see. the states of the first DF2 section would be the feedforward states
of
>the first contrived DF1. the feedback coefficients of the first DF2
section
>(usually called "a1" and "a2") would be zero and the feedforward coefs
(b0,
>b1, b2) of the first DF2 would be the feedforward coefs of the first >contrived DF1. > >anyway, it is true that if you have some devices that has N cascaded DF2 >sections, you can give up 2 filter orders and make that same device into
N-1
>cascaded DF1 sections. and vice-versa. > >and it definitely is true, for any filter sections that are interesting >(like they have a decently high Q or poles/zeros close to the unit
circle),
>the DF1 is far preferable to the DF2 for fixed-point (and even >floating-point) even if the DF1 is not "canonical" and has 2 more states >than the filter order. (this assumes that for each DF1 section has a
double
>wide accumulator or at least a wider accumulator than the word width of
the
>states/signal.) > >-- > >r b-j rbj@audioimagination.com > >"Imagination is more important than knowledge." > > >
Thanks r-b-j. I saved a lot of data transfer using the cascade structures. Using fractional saving along with the cascade structure, I obtained the best result in a very efficient way. Thanks to everyone, S L
in article pI-dnQ86hMy48r7ZnZ2dneKdnZydnZ2d@giganews.com, snigdha at
i_am_snigdha@yahoo.com wrote on 03/23/2006 23:01:
 
> > I saved a lot of data transfer using the cascade structures. Using > fractional saving along with the cascade structure, I obtained the best > result in a very efficient way.
cool. remember the purpose of using the DF1 over the DF2 for fixed point is to let the effect of the zeros cancel a little of the effect of the poles so that the signal going into the states does not clip. this only works if you pair up the zeros to the poles wisely. the rule of thumb is to pick on your most unstable poles (the pair closest to the unit circle) and pair them up with the zeros closest to these poles, then get the next most unstable pole pair from the remaining poles and pair them up with the zeros that will most tame them, and so on. if you don't match up the zeros to the poles in this way, you can still have a filter biquad section that saturates awfully, even with DF1.
> Thanks to everyone,
yer welcome (as least AFAIC). stick around and contribute to pay your bill here. this is possibly the newsgroup in all of USENET with the highest S/N ratio. even when we fight about DFT indexing or the one and only true nature of the DFT (it maps a periodic sequence to a periodic sequence and anyone who disagrees should be burned as an archeretic) or what the meaning (and dimension of quantity) of the dirac delta function is (we've had nasty fights about it here), there is still a lot of S/N, even then. this was my comp.dsp day. i'll be gone for a while guys. -- r b-j rbj@audioimagination.com "Imagination is more important than knowledge."
I shall surely contribute :-).

Just to finish up on your comments, theoretically I can totally
understand what you are saying about the pairing up of poles and zeros.
But, unfortunately, my system wouldn't allow me to know the poles and
zeros before hand. As far as my system works fine, I wouldn't complain.
I might, in the worst case scenario, get back to this issue later.

Thanks,
S L