# Rectify signal basic question

When rectifying a signal by squaring it, is it necessary to upsample by a factor of 2?

Why is this?

• As a complement to jithin's fine answer: When processing a signal, the sampling theorem needs to be satisfied at every step, including the final result, or aliasing will occur.
– MBaz
Mar 27, 2020 at 16:19

The only reason I can think of may be to preserve the frequencies over which original signal had spectrum (before squaring). When you square a signal $$x[n]$$, whose spectrum $$X(e^{j\omega})$$ extends from $$-\omega_0 \le \omega \le \omega_0$$, you are multiplying by itself. So in frequency domain, the effect is to (periodically) convolve $$X(e^{j\omega})$$ by itself. $$S(e^{j\omega}) = \int_0^{2\pi} X(e^{j\theta})X(e^{j(\omega - \theta)})d\theta$$ The convolution will result in $$S(e^{j\omega})$$ non-zero over $$-2\omega_0 \le \omega \le 2\omega_0$$. If you had upsampled before squaring, the spectrum before squaring would have been non-zero only from $$-\omega_0/2 \le \omega \le \omega_0/2$$. So after squaring (convolution in frequency domain), its spectrum is still $$-\omega_0 \le \omega \le \omega_0$$.
So the options are to either up-sample or low-pass filter somewhere below $$F_S/4$$ before squaring the signal