Electronic – Low pass filter giving sine wave ( triangular wave as input )

filter

so i basically have a low pass filtering that is filtering a square wave and giving me in output :
enter image description here

As far as i know the square wave can be made with the sum of multiple sine waves
enter image description here

So the over/undershoot i have is due to the frequencies that are not being filtered.

The triangle wave i have is this one, i want to know if the same logic can be used to understand the output of the filter

enter image description here

Best Answer

No, you're not seeing the Gibbs phenomenon on your triangle wave (although it would happen, if it were slower and had a period that's an integer fraction of your sampling rate).

What it appears that you've done is to generate a sine wave that is quite fast with respect to your sampling rate. That is why it doesn't appear to be a perfect triangle wave. Moreover, it is not a low-order integer ratio of your sampling rate (i.e., it's not exactly 2/7, but it appears to be close). Because the ratio isn't exact, you're generating aliases of the higher-order harmonics -- this is why your "triangle" wave appears to be riding on a sine wave.

Your low-pass filter, acting in sampled-time, is filtering out the rapidly-moving "triangle" part, and passing the low-frequency sinusoidal, which is genuinely there as a consequence of the aliasing.

enter image description here