A sine wave is produced from a PWM waveform by varying the duty cycle in a sinusoidal manner, typically using a microcontroller to adjust the duty cycle at each PWM period. An LC filter is employed to eliminate the carrier frequency from the PWM signal, where the inductor (L) presents high impedance at the carrier frequency, and the capacitor (C) provides low impedance, effectively attenuating the unwanted frequency components. This process is similar to FM demodulation, where the LC filter acts to smooth the output into a pure sine wave. Additionally, square waves can be shaped into sine waves using tuned filters that reduce harmonic content. Understanding these principles is essential for designing effective sine wave inverters.