# up sample and down sample

Let's say that I have a sampled signal x[n], it is being, in this exact order, up sampled by 2, down sampled by4, up sampled by 4 and down sampled by 2 to produce y[n].

It seems to me that it should be pretty self evident that since we up sampled the signal by 2 and down sampled it by 2, then up sampled it by 4 and down sampled by 4, I should just get the original x[n] back.

Am I right?

So the real question is, can the various up/down sampling pieces be readily swapped?

## 4 Answers

To make Matt L.'s answer more precise: whenever a downsampling operation results in a sampling frequency that is less than twice the maximum frequency in your signal, you'll end up losing some of the signal's energy.

In the downsampling implementations I've seen, the signal is low-pass filtered prior to downsampling, so no actual aliasing occurs.

The downsampling by a factor of 4 can introduce aliasing (because you upsampled only by a factor 2 in the first stage). If this is the case, it cannot be undone by the following upsampling operation. So in general this system will not produce at its output the original input signal $x[n]$.

And to add a bit more information: if the up/down sampling factors are relative prime they can be "interchanged" (or at least all the filtering happening at the sample rate resulting from downsampling first). But then, you will not get the original signal back (since they will be at different sample rates).

You will only get an approximation to your original signal. By the time you have upsampled by 2 and downsampled by 4, you have an overall downsample of 2. That means you have thrown away half your original data. No amount of upsampling will perfectly re-construct that lost data.

• It's not generally true that you always lose information by downsampling. This depends on the ratio between the original sampling rate and the Nyquist rate. How else could you ever sample a continuous signal without losing any information? – Matt L. Oct 22 '14 at 21:41