# Fourier transform to understand filtering on PWM

Is it correct to analyse the impact of a low-pass by regarding at the Fourier transform of a PWM signal, even if this one is generated with a H-Bridge ? And deduce that the higher frequencies forming the square signal are attenuated or even disappear ?

• The cutoff, doesn't mean that frequencies are cut off, it means the heavy attenuation starts there. But it is still an attenuation only. – PlasmaHH Dec 6 '16 at 16:10
• Your problem is scope ground inductance amplifies induced current, rather than sample just voltage. You must used very short ground leads or none at all with tip removed and use barrel to nearby gnd pin. (<1cm away) Examine the loop area of the filter spike current and reduce area of signal to ground loop. Then get textbook waveforms. – Tony Stewart EE75 Dec 6 '16 at 16:26
• I doubt it, but does the lowpass have zeroes? – a concerned citizen Dec 6 '16 at 16:28
• Thank you for all these advice. I don't thing that there were any zeroes, as it was a simple passive filter. However my main question was the second part about the Fourier transform, so, I will take your advice and delete the first part. – Crapsy Dec 6 '16 at 16:41
• How does Fourier relate to how the signal is generated ("H-bridge")? – JimmyB Dec 6 '16 at 16:44

## 2 Answers

The Fourier transform is used to analyze PWM signals. The result depends on the type of PWM like type of carrier and kind of modulation.

A typical result looks like shown in the picture below. The baseband signal is present and a number of intermodulation products around the carrier frequency.

The two spectra are for different amplitudes of the modulating signal. In order to sufficiently suppress the unwanted components most often a higher order filter is used.

• If I understood correctly, the shape depicted above is similar from a square signal generated with a pulse modulator a a H-bridge ? – Crapsy Dec 6 '16 at 16:59
• It depends on the input signal if they look somewhat similar or not. In general I wouldn't say that they do. – Mario Dec 6 '16 at 17:06
• For exemple if we generate two similar PWM, with a duty cycle of 50% and a frequency of 20kHz both with a H-Bridge and an oscillator. Would the Fourier transform give the same spectra ? – Crapsy Dec 6 '16 at 17:09
• A PWM signal with 50% duty cycle is a square wave so it should have the same spectrum. – Mario Dec 6 '16 at 17:11
• And is it different if the duty cycle move to 80% ? – Crapsy Dec 6 '16 at 17:12

Is it correct to analyse the impact of a low-pass by regarding at the Fourier transform of a PWM signal, even if this one is generated with a H-Bridge ?

It can be correct to analyse a filter like that, but the reference will have to be the waveform before the filter, which is the PWM. But this has too much information, that is, it has the modulation (the sine you want to extract) and the switching, variable pulse-width frequency, which is to be filtered out (thus unneeded). So you'd be comparing a useful waveform (output) with a not so useful one (input). The only time this would be useful is to see just how well the switching frequency has been filtered out, but that can be easily deducted from the transfer function.

Here's a small example of what I mean: V(x) is the PWM waveform, V(o) is the output. It's a self-oscillating gizmo, so the switching frequency varies, and is present in the interval ~300kHz~420kHz, while the modulation is a 5kHz sine (m=70.71%). As you an see, visually the PWM (orange) waveform is not wanted and needs to be filtered out, while V(o) is a sine with residual high-frequency content (no filter is perfect). You can verify in the FFT window that the carrier has been attenuated, you can measure it, but it would be an unnecessary step since the transfer function of the filter is known and the attenuation at a certain frequency can be easily determined analytically:

$$H(s)=\frac{R}{RLCs^2+sL+R}=\frac{4}{8.16*10^{-11}s^2+3*10^{-5}s+4}$$

and the attenuations at 300kHz and 420kHz are -37.25dB and -43.07dB (more or less what you see in the picture, save the resolution and the fact that I didn't use a tighter timestep, plotwinsize, and numdgt>7).

And deduce that the higher frequencies forming the square signal are attenuated or even disappear ?

If this would be your goal then you'd be doing a very unnecessary thing, since the very purpose of the lowpass filter is to filter out high frequency content. That is, you don't ned to perform an FFT on a lowpass filter to deduce that it's a lowpass filter.

TLDR: Yes, you can, but a) it can be deducted and b) that's why you're building the filter in the first place, to attenuate by X dB at Y Hz.