Forum Discussion
Altera_Forum
Honored Contributor
18 years agoThanks for the replies.
Well as it turns out it was nothing to do with the filter at all. I had a state machine that would start the filtering when a new sample was ready. This signal, new_sample_ready was generated in the audio clock domain and received in the system clock domain. I forgot to implement a synchronizer to cross the domains (stupid mistake.) This may explain why they were periodic in nature as well. To answer your question question about scaling, i receive a 16-bit sample from the ADC and shift it up 16-bits before multiplying it with my 16.16 fixed point values. So 31 downto 16 is audio and 15 downto 0 is left as 0's (i.e. fraction part of 0). The value (63 downto 48) is always FFFF or 0. I wouldn't think the co-efficients are big enough for this overflow (there typically less than +/-4) and the filter has slightly less than 0db gain overall. Thanks for your advice on saturation and truncation. I will look into rounding the multiplier output with saturation instead of just truncation. Cheers, Evan.