Sin wave output with PWM pin output amplitude question

The amplitude will decrease if the sine wave (PWM) frequency goes above the roll-off frequency of the RLC low pass filter.

What is the roll-off frequency and what frequencies are you generating? Post a schematic of the filter you made.

why does amplitude decay as frequency is increased

There is nothing in the posted code that changes any frequency. It outputs 50 steps approximating one cycle of a sine wave every second, so that is 1 Hz.

1 Like