Help needed with DSP filter problems

Neoklis Kyriazis nkcyham at yahoo.com
Fri Sep 2 07:06:39 UTC 2016


Hi

I have been experimenting writing DSP software, using librtlsdr and a NESDR
dongle from NooElec. After much searching the Internet for code to design and
implement DSP filters (with little success), I remembered that years ago I
bought the "Digital Signal Processing" book by Steven W. Smith. I used the
BASIC software included to produce C code to calculate the a and b coefficients
for Low Pass or High Pass Chebyshev filters, from 2-pole to 20-pole if needed.

Unfortunately, the cut-off frequency for a 6-pole Low Pass filter I implemented
turns out to be 2x the required value, even though the design function that
calculates the a and b coefficients produces values that match exactly values
tabled in the book. This leaves me I think with the following possibilities:

1. That the calculated a and b coefficients are correct but my own code
implementing a recursive filter is incorrect.

2. That I have incorporated the LPF filter function into my librtlsdr-based
application incorrectly, perhaps misunderstanding parameters like the sampling
rate or the required bandwidth.

3. That both the above implementations are correct but the BASIC code included
in the book has a bug somewhere, so that both my own results for a and b and
those tabled in the book are incorrect. Rather unlikely I thought....

So I am asking for help here from more knowledgeable DSP'ers hoping to resolve
this matter, as the above mentioned book is very good, with very clear and
simplified teaching of DSP for engineers _and_ it includes source code in
BASIC for most of the algorithms it teaches. And it is available openly on
the Internet with source code here!: http://dspguide.com/

My own GPL'ed application is available for inspection here:
www.5b4az.org/pkg/sdrx/sdrx-0.3-beta.tar.bz2

The filter functions are in src/filters.c and SDR functions in src/rtlsdr.c

My thanks here in advance!

 --
Best Regards
Neoklis - Ham Radio Call:5B4AZ
http://www.5b4az.org/


More information about the osmocom-sdr mailing list