RTL2832U FIR filter
Michael Karcher
osmosdr at mkarcher.dialup.fu-berlin.de
Sun Jul 15 11:35:15 UTC 2012
Am Sonntag, den 15.07.2012, 01:59 +0200 schrieb Stefan Sydow:
> Hello Michael,
> > This filter has a quite flat passband in the interesting range for DAB
> > (-768kHz..+768kHz) but by far not enough attenuation at 1280kHz (which
> > will alias to 768kHz at a sampling rate of 2048kHz) to get satisfactory
> > adjacent channel rejection. The experimentally observed alias rejection
> > is good enough, which lead to the conclusion that there is another
> > low-pass filter, which might be part of the resampling unit.
> I've got a passband of nearly 2MHz with the original coefficients.
> Did I miss a factor 2 somewhere? I tried to construct a narrower filter
> using the gnuradio function.
No, I don't think you missed a factor of 2. I get a -3dB bandwidth of
1.2MHz, and the stopband rejection of -35dB indeed starts at around
2MHz. The actual required DAB range (768kHz) has a flatness of 0.55dB,
if I calculated all the stuff correctly.
> Here is a python script to construct the FIR register and plot the
> frequency
> response. Maybe the script is also helpful to you.
Thanks for the script, just some minor notes: SAMP_RATE should be
28.8e6, not 28e6. Also you don't seem to do any overflow checking on the
conversion. If you are trying to build narrow filters, I expect you
might hit the 1/16 limit on the outer 8 coefficients, so the filter
coefficients might need to be shrunk (reducing the filter gain, of
course) before converting to integers.
I'm afraid that constructing a filter using gnuradio firdes and then
truncating it to 32 coefficients is likely not resulting in a good
filter. In my oppinion (not backed by math knowledge in that area,
though), the filter length should already be considered during
coefficient generation.
It looks like your plot uses the convention that 10dB is a factor of 10.
As the filter affects amplitude values and not power values, you should
use 20dB for a factor of 10, if I understand the dB scale correctly.
Regards,
Michael Karcher
More information about the osmocom-sdr
mailing list