athos
Newbie level 1
hi all,
i'm trying to implement a reverb in fixed point, using the moorer's topology (comb filters and allpass) plus a convolution stage with a truncated real impulse response for the first hundred of milliseconds. I just need to simulate it for now, so it doesn't have to be synthesizable (yet).
i know how to build a fir filter in vhdl, i successfully built some filters using few taps, and i know how to load fixed point coefficients from textfiles generated in octave (basically i take a wave file containing an impulse response, i scale the values to be integers and i save to a txt file). Now, my doubts:
since the truncated IR will be around 4 thousand samples long, the fir filter will have this 4k coefficients, and 4k additions. So, i will need to add around log2(4k)=~12 guard bits for the adding part to prevent overflow in the worst case. And, of course, add the bits needed for multiplications.
But as i see it, when i truncate the word at the output, which corrensponds to scaling down, i may end up with very small values, if many of the IR coefficients are small, so in this case I get a lower quality output.
Do you have any advice on treating this issue? I think that if i know the IR, i can dimension the number of guard bits and later truncation referring not to the worst case, but using the sum of all coefficients to calculate the necessary guard bits, but i didn't completely figured out how, and if it's the right method.
Am i on the right way? Am i completely missing some point and talking non-sense?
thanks,
athos
i'm trying to implement a reverb in fixed point, using the moorer's topology (comb filters and allpass) plus a convolution stage with a truncated real impulse response for the first hundred of milliseconds. I just need to simulate it for now, so it doesn't have to be synthesizable (yet).
i know how to build a fir filter in vhdl, i successfully built some filters using few taps, and i know how to load fixed point coefficients from textfiles generated in octave (basically i take a wave file containing an impulse response, i scale the values to be integers and i save to a txt file). Now, my doubts:
since the truncated IR will be around 4 thousand samples long, the fir filter will have this 4k coefficients, and 4k additions. So, i will need to add around log2(4k)=~12 guard bits for the adding part to prevent overflow in the worst case. And, of course, add the bits needed for multiplications.
But as i see it, when i truncate the word at the output, which corrensponds to scaling down, i may end up with very small values, if many of the IR coefficients are small, so in this case I get a lower quality output.
Do you have any advice on treating this issue? I think that if i know the IR, i can dimension the number of guard bits and later truncation referring not to the worst case, but using the sum of all coefficients to calculate the necessary guard bits, but i didn't completely figured out how, and if it's the right method.
Am i on the right way? Am i completely missing some point and talking non-sense?
thanks,
athos