﻿The "pwm_fourier.m" function plots the Fourier series (i.e. frequency-domain) representation of periodic pulse-width-modulated (PWM) waveforms.
It also shows the effects of applying a second-order low-pass filter to a PWM voltage waveform produced by an ideal half-bridge circuit.

To run it, you will need to install either:
GNU Octave (free): https://www.gnu.org/software/octave/
MATLAB (expensive): https://www.mathworks.com/products/matlab.html.

Unzip, point Octave or MATLAB at the folder containing "pwm_fourier.m", then type the following at the Octave/MATLAB command line:
pwm_fourier

Make sure to play around with all the parameters at the start of "pwm_fourier.m" to see the effect on the output waveforms in the time and frequency domains.

Comments and suggestions can be addressed to dan.rogers@eng.ox.ac.uk

Last updated:
June 2020
