I'm trying to implement a high pass filter, where the cutoff frequency is controlled via a scaled pot input. This is what I'm trying, but it's giving me a low pass filter instead. ( ? )
Code: Select all
equ hp0 reg5 ;register for high-pass filter
equ khp reg14 ;register for cutoff frequency
;load and scale pot2, write to register
ldax pot2
sof -0.07884094, 0.082668548 ;450Hz to 20Hz @ 32kHz
wrax khp, 0.0
rdax hp0, -1.0 ; these three lines recreate
mulx khp ; RDFX, but with a register coefficient
rdax hp0, 1.0 ; instead of a fixed coefficient
wrhx hp0, -0.5
Any help would be greatly appreciated. As I said earlier, when the pot as at 0, I get a *low pass* cutoff around 450 Hz, and when the pot is maxed, I get a *low pass* cutoff around 20 Hz (or something much lower than 450).
Thank you!
-Jake[/code]