[DSP-10] Spectral Inversion
Bob Larkin
boblark at proaxis.com
Sun Sep 19 19:58:19 EDT 2004
Hi Bob,
The coefficients of the HPF look a lot like the coefficients of the mirror
image LPF. The difference is the change of sign on every other
coefficient. This is probably not very interesting, in a practical sense.
What you probably want to do is to calculate a new filter, the HPF that you
want. Then changing from the LPF to the HPF is only changing the
coefficient values. There are a number of programs for finding the FIR
coefficients for the HP filter. One general source of such info is
http://www.poynton.com/Poynton-dsp.html
I have to also mention that our book, "Experimental Methods in RF Design"
http://www.arrl.org/catalog/index.php3?category=Technical%2C+Electronics%2C+and+Communications+Reference
includes a program that I wrote in QBasic (or GW Basic or most similar
dialects) that computes HP coefficients (or LP or BP). The background is in
Chapter 10 . The program only designs BandPass filters, but if you set the
upper frequency limit of the bandpass to half of the sampling frequency,
you get a HPF!
Be aware that a true HPF must have an odd number of coefficients. If not,
there will be a tiny notch right at the top end of the response. In 99% of
applications, this can be ignored, since that frequency range needs to be
removed in real-time applications to prevent alias signals. If the filter
you are putting coefficients into already is set up for an even number, say
200 coefficients, just design the new HPF for 199 coefficients and place a
zero at either end to fill out the data.
Also, the C source code for the DSP-10 has a reasonably general design
program used for the 8th receive filter or the transmit audio
equalizer. These are in the module UFILTER.C. These create a multi-band
equalizer from multiple band-pass filters, each with a different filter
gain. The linearity of the FIR filter allows these to be added together and
placed into a single set of FIR coefficients. This can be seen in action
using the "Design-a-Filter" function SCRL-F4. Here you choose the filter
parameters and see the resulting response plotted on the screen. Close the
box with the audio filters on (F3) and you hear the result. The 14-band
equalizer comes from the .CFG file. The programs illustrate how to design
the FIR coefficients as well as computing their response. This is all
linked from
http://www.proaxis.com/~boblark/dsp10.htm
Best wishes for your project!
73,
Bob W7PUA
At 03:57 AM 9/18/2004, you wrote:
>Hi
>
>Can anyone advise on the following
>
>I want to spectrally invert a LPF into an HPF
>
> To do this I read (Smith etc) that I can
>
>- invert the order ( or sign ?) of the filter kernel
>- reverse the order of calculation in the FIR filter sub-routine such that
>the coefficients are used in the reverse order to normal.
>
>I can do the former with a bit of manipulation with a text editor etc. but
>the second would be easier since the same coeff set would be used for both
>the HPF FIR and the LPF. However in the AD assembly language syntax how
>do you rewrite the DO .....UNTIL CE phrase so that the multiplication
>would use the coeff in the reverse order ?
>
>I have consulted the AD Instruction Set Ref but although there are quite a
>few permissable terms I dont see how you could structure the reverse to
>the normal.
>
>Any ideas ?
>
>Thanks
>
>Bob G3PJT
>
>
>_______________________________________________
>DSP-10 mailing list
>DSP-10 at mailman.qth.net
>http://mailman.qth.net/mailman/listinfo/dsp-10
More information about the DSP-10
mailing list