AnsweredAssumed Answered

IIR Filter on the KL25Z

Question asked by Nicola Lacalendola on Apr 17, 2014
Latest reply on Apr 22, 2014 by Nicola Lacalendola

Hey guys, I'm trying to implement a simple 2 pole IIR filter on my KL25Z. Coefficients were calculated using Matlab, it's a Butterworth Highpass, second order, Fs at 10 KHz, and Cut off at 60 Hz. I'm feeding in a mixed signal sin(2pi80t)+sin(2pi175t) which is generated by one of the boards to the the other board which is running the IIR filter program.

Here's the code: http://imgur.com/NDqYXfT

Here's what I'm feeding into my filtering board:http://imgur.com/d7NzRzG

Here's the filter board DAC output: http://imgur.com/Vmjn9LH

I'm expecting the 80Hz sinewave to remain at the output, or at least something similar (I know these filters are not perfect), but the output looks like an audiowave or some sort. Can't figure out why. You guys have an idea what it is or maybe there's some error in my code (most likely). Thanks a lot guys!

Outcomes