Hi, I am implimenting a SRC for both decimation and interpolation using polyphase filter implementation. my question is 1.i take a sine wave (+1 to -1) of 24 bit and convolving with filter taps of 1.31 format. 2. when i save my result after filtering to 24 bit, i need to truncate the result to 24 bit and save it 3. in the above process i found the output sine wave having a maximum value of 1.002 and i am truncating it to 1.000 because of this i get a error of 0.001 at some point and my final SNR of the resultant signal is detoriated. 4. when i dont truncate the result i get a proper signal and SNR... IS there a method to redue the error by some means (dithering, HalfaddUp) any inputs are helpful... regards, srikk

# fixed point issue inSRC

Started by ●March 20, 2007

Reply by ●March 20, 20072007-03-20

On Mar 20, 6:19 am, "srikk" <srikanth_...@rediffmail.com> wrote:> Hi, > > I am implimenting a SRC for both decimation and interpolation using > polyphase filter implementation. >What is "SRC"?

Reply by ●March 20, 20072007-03-20

On Mar 20, 7:19 am, "srikk" <srikanth_...@rediffmail.com> wrote:> Hi, > > I am implimenting a SRC for both decimation and interpolation using > polyphase filter implementation. > > my question is > > 1.i take a sine wave (+1 to -1) of 24 bit and convolving with filter > taps of 1.31 format. > 2. when i save my result after filtering to 24 bit, i need to truncate the > > result to 24 bit and save it > 3. in the above process i found the output sine wave having a maximum > value of 1.002 and i am truncating it to 1.000 > because of this i get a error of 0.001 at some point and my final SNR > of the resultant signal is detoriated. > 4. when i dont truncate the result i get a proper signal and SNR... > > IS there a method to redue the error by some means (dithering, HalfaddUp) > any inputs are helpful... > > regards, > srikkI would guess if you handle the problem for sine waves you won't have solved the problem for arbitrary waveforms (even simple ones). Might want to rethink the problem. Dirk Dirk Bell DSP Consultant

Reply by ●March 20, 20072007-03-20

On 20 Mrz., 12:19, "srikk" <srikanth_...@rediffmail.com> wrote:> Hi, > > I am implimenting a SRC for both decimation and interpolation using > polyphase filter implementation. > > my question is > > 1.i take a sine wave (+1 to -1) of 24 bit and convolving with filter > taps of 1.31 format. > 2. when i save my result after filtering to 24 bit, i need to truncate the > > result to 24 bit and save it > 3. in the above process i found the output sine wave having a maximum > value of 1.002 and i am truncating it to 1.000 > because of this i get a error of 0.001 at some point and my final SNR > of the resultant signal is detoriated. > 4. when i dont truncate the result i get a proper signal and SNR... > > IS there a method to redue the error by some means (dithering, HalfaddUp) > any inputs are helpful...It looks like your filter has a gain > 1 for some frequenies. Find out the maximum gain (using the truncated coefficients), then normalize the filter. You should also dither in step 2 to get the maximum performance out of your SRC. Regards, Andor

Reply by ●March 21, 20072007-03-21

>On 20 Mrz., 12:19, "srikk" <srikanth_...@rediffmail.com> wrote: >> Hi, >> >> I am implimenting a SRC for both decimation and interpolation using >> polyphase filter implementation. >> >> my question is >> >> 1.i take a sine wave (+1 to -1) of 24 bit and convolving with filter >> taps of 1.31 format. >> 2. when i save my result after filtering to 24 bit, i need to truncatethe>> >> result to 24 bit and save it >> 3. in the above process i found the output sine wave having a maximum >> value of 1.002 and i am truncating it to 1.000 >> because of this i get a error of 0.001 at some point and my finalSNR>> of the resultant signal is detoriated. >> 4. when i dont truncate the result i get a proper signal and SNR... >> >> IS there a method to redue the error by some means (dithering,HalfaddUp)>> any inputs are helpful... > >It looks like your filter has a gain > 1 for some frequenies. Find out >the maximum gain (using the truncated coefficients), then normalize >the filter. > >You should also dither in step 2 to get the maximum performance out of >your SRC. > >Regards, >Andor > >

Reply by ●March 21, 20072007-03-21

>On 20 Mrz., 12:19, "srikk" <srikanth_...@rediffmail.com> wrote: >> Hi, >> >> I am implimenting a SRC for both decimation and interpolation using >> polyphase filter implementation. >> >> my question is >> >> 1.i take a sine wave (+1 to -1) of 24 bit and convolving with filter >> taps of 1.31 format. >> 2. when i save my result after filtering to 24 bit, i need to truncatethe>> >> result to 24 bit and save it >> 3. in the above process i found the output sine wave having a maximum >> value of 1.002 and i am truncating it to 1.000 >> because of this i get a error of 0.001 at some point and my finalSNR>> of the resultant signal is detoriated. >> 4. when i dont truncate the result i get a proper signal and SNR... >> >> IS there a method to redue the error by some means (dithering,HalfaddUp)>> any inputs are helpful... > >It looks like your filter has a gain > 1 for some frequenies. Find out >the maximum gain (using the truncated coefficients), then normalize >the filter. > >You should also dither in step 2 to get the maximum performance out of >your SRC. > >Regards, >Andor > >Hi andor, you are correct... the filter that i am designing has a gain of 2... which is necessary.... the problem i am facing here is the "finite word length effect". 1. when i take a sine wave of (+1 to -1) in 1.23 format the max value is (2^23)-1 2. i am doing filtering on the data and storing the intermediate results in 32 bit word. 3. finally when i need to output the results i convert this 32 bit to 24 bit by right shifting. 4. even after right shifthing it results in a value more than (2^23)-1 which i need to truncate to (2^23)-1 which results in the error... can u point me to some articles or explain me how this dithering is done... regards, srikk

Reply by ●March 21, 20072007-03-21

srikk wrote:> srikk wrote: > >> Hi, > > >> I am implimenting a SRC for both decimation and interpolation using > >> polyphase filter implementation. > > >> my question is > > >> 1.i take a sine wave (+1 to -1) of 24 bit and convolving with filter > >> taps of 1.31 format. > >> 2. when i save my result after filtering to 24 bit, i need to truncate > the > > >> result to 24 bit and save it > >> 3. in the above process i found the output sine wave having a maximum > >> value of 1.002 and i am truncating it to 1.000 > >> because of this i get a error of 0.001 at some point and my final > SNR > >> of the resultant signal is detoriated. > >> 4. when i dont truncate the result i get a proper signal and SNR... > > >> IS there a method to redue the error by some means (dithering, > HalfaddUp) > >> any inputs are helpful... > > >It looks like your filter has a gain > 1 for some frequenies. Find out > >the maximum gain (using the truncated coefficients), then normalize > >the filter. > > >You should also dither in step 2 to get the maximum performance out of > >your SRC. > > >Regards, > >Andor > > Hi andor, > you are correct... the filter that i am designing has a gain of 2... > which is necessary....I didn't mean the filter gain (even if I wrote that :-), but the whole SRC section gain. That should be 1 and probably is larger than 1, perhaps due to coefficient truncation.> the problem i am facing here is the "finite word > length effect". > 1. when i take a sine wave of (+1 to -1) in 1.23 format the > max value is (2^23)-1 > 2. i am doing filtering on the data and storing the intermediate results > in 32 bit word. > 3. finally when i need to output the results i convert this 32 bit to 24 > bit by right shifting. > 4. even after right shifthing it results in a value more than (2^23)-1 > which i need to truncate to (2^23)-1 which results in the error...That's because your SRC section has gain > 1. You have to compute the maximum gain from the truncated filter coefficients. Then scale the coefficients as necessary.> > can u point me to some articles or explain me how this dithering is > done...There is lots of webinfo on dithering (Google -> digital audio dither). Regards, Andor