Use decimation filter to demodulate the PWM signal. It's just downsample and lowpass/bandpass filter. It has very narrow transition band to filter out high frequency noise.
It's digital sinc filter, so analog guys seldomly talk about this.
Maybe your DSP courses have already talk about digital filters. Check it.