Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Very long convolution in fixed point (vhdl): output truncation issues

Status
Not open for further replies.

athos

Newbie level 1
Joined
Nov 20, 2011
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,296
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
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top