trying to program an integrator. My input is a square wave and my expected output should be a triangle wave. However, whenever I pass it through my low pass filter algorithm (just a 2nd order butterworth low pass filter with a Q of 0.707), I never seem to get a triangle wave. Instead, I get a a smooth square wave (I guess that's similar to a capacitor smoothing it out?). I am not sure how to tackle this problem as I'm a little new to signal processing + algorithms. Any help would be greatly appreciated.
Below is a picture of an example test I did through Xcode. I was sending a F3 note (around 349 hz) through a low pass with a cutoff of 200 hz and the output is shown below. This is probably the sharpest/closest I've gotten to the triangle wave.
EDIT: to clarify, I am trying to convert a square wave to a triangle wave (preferably through a low pass filter if that is totally doable).