I am curious to know if i vary a high frequency PWM square wave linearly where all the widths are equal and I then filter it if I would get a good sine wave other than when I vary the pwm sinusoidally.
Just trying to know if the same type of filter would suffice for both situations.
I have experimented on the sinusoidal type in the lab but am curious if anyone has experience or what they think
Filtering a modulated PWM signal to recover the modulating signal from the carrier is very different from filtering the carrier directly to turn it into a sinewave rather than a square wave. Both are possible. If you adjust the PWM signal such that it is a simple 50% duty cycle squarewave, this can be filtered into a sinewave of the same frequency. However, to remove enough harmonics to obtain a sinewave with low distortion takes a complex filter.
A fairly low distortion sine wave (under 5% harmonic) can be obtained from a 50% duty-cycle square-wave by double-integrating it.
This can be low-pass filtered to further reduce distortion if needed.
Of course, as with all low-pass filters, the output amplitude of the integrator varies with frequency.