# Precision Full-Wave Rectifier: Why is the signal's biggest magnitude at DC?

I built a Precision Full Wave Rectifier Circuit, like in the following figure( with better amplifiers) to rectify a sine wave of 1kHz. As expected i got a rectified wave with 2kHz but doing its FFT analysis i noticed that the biggest frequency component is at DC(0) can anyone explain me why? Also, I'm sampling this signal with an ADC at much higher frequency around (40 kHz), it order to measure its RMS. Do you find appropriate to build an anti-aliasing filter to the rectified wave and which frequencies should i reject, everything above the 2kHz ?

• Which of the FFT components are you most wanting, 2000 Hz., or DC? Usually, it is DC. If you sample at 40 Khz, then instead of anti-alias, just sum 40 samples, or 80 or 120 or 160......samples (increments of 40 samples). This works only if your expected input is 1000 Hz. (this kind of anti-alias filter is very simple, but effective). An unknown input frequency does require a more complex anti-alias filter. – glen_geek Dec 20 '16 at 3:13
• It depends entrirely on your SNR and range of the signal and error budget over the range. – Sunnyskyguy EE75 Dec 20 '16 at 7:54
• The perfect answer would be a mix of the two answers below: intuitively, Andy aka's answer, mathematically, Ken Shirriff's answer. Would be fine, in my humble opinion, if someone wrote a third reply, or edit one of the below, to made it. – Antonio Dec 22 '16 at 9:02

The Fourier series of the full wave rectified sine wave is (from here):

The DC component has magnitude 2A/π, while the first AC component has magnitude 4A/3π. So that's why mathematically the DC component is largest. You'd expect a large DC component because rectification makes the whole signal positive.

You don't want to filter everything about 2 kHz because then you'll just end up with a sine wave again. All the frequency components are important to the shape of the curve, so you should keep as many as possible. Because of the Nyquist limit, you'll want an antialiasing filter to remove everything above half your sampling frequency (and a bit more for safety).

• An anti alias filter is not required if all you are doing is calculating rms of a periodic signal. – Andy aka Dec 22 '16 at 12:18

i noticed that the biggest frequency component is at DC(0)

That is what rectifiers do - they rectify AC into DC - what would happen if you full-wave rectified an AC square wave - you would get pure DC out with no ripple - I know that is an extreme example but, don't forget what rectifiers do best.

Think about it another way: -

The average value is the peak value x $\dfrac{2}{\pi}$ or 0.6366 x pk. The RMS is 0.7071 x pk so the whole harmonic content of the wave form accounts for $\sqrt{0.7071^2-0.6366^2}$ = 0.265 i.e. significantly lower than the DC content.

I'm sampling this signal with an ADC at much higher frequency around (40 kHz), it order to measure its RMS. Do you find appropriate to build an anti-aliasing filter to the rectified wave and which frequencies should i reject, everything above the 2kHz ?

If you are only calculating the RMS then you don't need an anti-alias filter. With an anti-alias filter you are discarding harmonic content so you would never measure RMS perfectly. By not using an anti-alias filter you are "aliasing" spectral content above 20 kHz nyquist down into the base band and, ironically, you want to measure this so, don't use an anti-alias filter.

Just take each sample, square it, take an average (many samples) then take the square root of that average. Below is a picture of a sinewave sampled at 2.7 times per cycle and I've shown the sample values: -

Take all those values, square them, take the average then take the square root: -

$\sqrt{\dfrac{(+0.7071)^2 + (0)^2 + (-0.7071)^2 + (1)^2 + (-0.7071)^2 + (0)^2 + (+0.7071)^2 + (-1)^2}{8}}$

= $\sqrt{\dfrac{4}{8}}$ = 0.7071 i.e. same as a sinewave of peak amplitude 1

It doesn't matter whether this is a sinewave or a rectified sinewave - the RMS value will be the same because the negative sine samples get converted to positive ones in the squaring process: -

The full wave rectified signal has exactly the same RMS value as the sinewave yet has only been slightly oversampled at the fundamental frequency. Clearly there is harmonic content at much higher frequencies than the sampling frequency yet the proper RMS value has been derived correctly.

If you are careful in choosing the sampling frequency and the signal is periodic you can even undersample and get the correct value for RMS: -

You should be able to see that the undersampled waveform output has the same RMS value of the oversampled output. You have to avoid sampling continually at the same position on the waveform or you will get an error but this can be avoided with good design.

• Are you satisfied with any answer given? If not explain why not and I (at least) will try and improve my answer but, I recommend you do something about it rather than let this slide. It seems to be going down the path of the question I commented on a few minutes ago and that would be a snub to those people who have given you good advice. – Andy aka Jan 8 '17 at 11:37

In order to capture the RMS value you need to measure the highest frequency components with significant power as defined by your requirements.

If you know in advance that the input will always be a pure sine wave you can just measure the DC component and correct for the ~11% error in software.

If the input can be much less like a sine wave, for example DC or a waveform with a large crest factor then you will need to measure a wider bandwidth. How wide depends on the worst case acceptable error and the nastiest waveform you need to accept.

I can't add anything to the wonderful answer by Andy aka, but if you want to explore the Fourier series math Ken Shirriff mentioned I can recommend an interactive tool to explore the Fourier coefficients of different waveforms.