discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] Half-Band Filter Module Output Clipping?


From: Bruce McGuffin
Subject: Re: [Discuss-gnuradio] Half-Band Filter Module Output Clipping?
Date: Thu, 3 Sep 2009 09:13:40 -0400
User-agent: Thunderbird 2.0.0.22 (X11/20090625)

Matt Ettus wrote:
Bruce McGuffin wrote:
Hi

I've been looking at the USRP2 filter characteristics, to see if it will work for me. After going through the half-band filter code (hb_dec.v from gnu-radio 3.2) I understand what the filter coefficients are, but I have
a question about the output from this module.

Near the end of the module the filtered data is clipped and rounded in lines 152-153:
 ...

It looks to me like final_sum_unrounded is 25-bits long, so the input to final_round is the 20 LSBs of final_sum_unrounded (final_sum_unrounded[19:0]), and the output final_sum is those 20 bits rounded to 18 bits in the usual way. But this data is two's complement, so clipping the 5 MSBs from final_sum_unrounded can drasticaly change the data value, for example changing both the sign and
magnitude, even when the magnitude of final_sum_unrounded  <  2^17.

What am I missing here?

Based on the coefficients, we can guarantee that the final sum will have a magnitude which fits in 20 bits, including the sign bit. We can just drop those extra sign bits, since they'll all be the same.

Matt
So I'm curious. If the final sum fit into 20 bits, why were the accumulation and
following sum carried out with 24 or 25 bits?

Bruce





reply via email to

[Prev in Thread] Current Thread [Next in Thread]