# Discrete signals: Power and Energy after Up/Downsampling

I think I have a very simple question, but I am very confused about it right now.

Given is a discrete sequence $x[n]$, for simplicity we say its finite and of length $N$. Then we know that the energy of this signal is given as $E = \sum_{n = 0}^N x[n]^2$ and its power is given as $P = \frac 1 N E$ (since it's finite).

Now here are some things that confused me. Assume we upsample the signal. The energy would be the same, since we only insert 0s. But inserting 0s increases $N$, hence we would reduce the power. This cannot make sense... so where is my error here?

Regards

• Average power per sample decreases as N increases. – TicTacToe Oct 21 '15 at 10:18
• @zola - consider elaborating and making a proper answer. – Andy aka Oct 21 '15 at 10:22
• Although you got an answer already, questions like this are a good fit for DSP.SE as well. – Jason R Oct 21 '15 at 13:05

Your basic mistake is that power is energy per sample. Power is energy per time. In other words, P = E/t, not P = E/N as you used.

Resampling at a different rate doesn't change the time duration of the signal (t in the equation above). Resampling at a lower sample rate, for example, decreases the number of sample, but also increases the energy per sample.

• I think that dearomatic talks about the discrete-time. – Junior Jan 11 '16 at 12:07
• @Junior: I think he's asking about the power in the real signals represented by the samples. – Olin Lathrop Jan 11 '16 at 12:30
• While I completely agree with your physical argument, power of a real world signal shouldn't depend on the sample rate, I think your argument has a flaw: if you look carefully, the measure in the integral defining $E$ has time also, so the choice of units of time do indeed cancel out, leaving $1/N$. See my answer for details. – Timo Jan 11 '16 at 14:27

Olin is not right.

N is not t in the discrete-time. N is the number of (squared) discrete samples you sum together. There is no concept of absolute time in the discrete-time; there are only integer sample indices with nothing in between. Inserting N-1 zero samples between samples, changes the measured power irrespective over the sample size you measure over, but the total energy or energy per sample does not change.

Down-sampling does the opposite. The energy is reduced, but power stays the same.

• I took the OP's question as asking about the real world signals that the samples represent. You seem to be talking about more theoretical discrete sampling theory "power", which is just going to confuse the OP. – Olin Lathrop Jan 11 '16 at 12:25

Regarding the other answers: Olin considers the corresponding real world case, but note that in $P = \frac{1}{T} \int\ x(t)^2 \mathrm{d}t$ any time scale cancels out, so his argument doesn't really pan out. You'll see it explicitly if you approximate the integral by a sum over steps of the size of the sample period: $$\frac{1}{T} \int_{0}^{T} x(t)^2 \mathrm{d}t \approx\frac{1}{N \Delta T} \sum_{n = 0}^{N-1} x(n\Delta t)^2\, \Delta t = \frac{1}{N} \sum_{n = 0}^{N-1} x(n\Delta t)^2\,$$ where $\Delta t$ is the sampling period. Note how the time cancels from the scaling.

On the other hand, Seb talks about power in the discrete domain. He is technically right, but I understand the question was about the power of the corresponding real world signal, which of course shouldn't depend on the sampling rate. Let me try to combine these views:

Upsampling by zero-padding does not represent the same real-world signal. Consider what happens in the frequency domain: for an upsampling factor $k$ the signal becomes replicated $k$ times. Back to the time domain: if you were properly upsampling the signal, you would insert a sinc-function $$k\, \mathrm{sinc}\left(\frac{n - n_0}{k}\right) = k \frac{\sin\left(\frac{\pi(n - n_0)}{k} \right)}{\pi (n - n_0)},$$ multiplied by $x[n_0]$, at each position $n_0$ where there formerly was a sample, and sum. Note that the integral of a sinc squared with the above scaling is $k$ (simply do a change of variables in the formula given here).

Since the sum $\sum_{n = 0}^N x[n]^2$ approximates an integral, you will get roughly $k$ times the original total energy (although I blatantly ignored here the crossterms in the sum-of-sincs), but on the other hand, as you noticed, you have $k$ times the samples over which you divide, so the power is the same given proper resampling.

Back to the point in the beginning about the frequency domain: if the signal was replicated $k$ times when zero-padding, why didn't the total energy rather increase by a factor of $k$? This is because there is a factor of $1/N$ in Parseval's theorem, which allows you to compute the energy from the DFT. But doesn't the total energy then decrease when we're bandlimiting for the interpolation? Not really, as the gain of our interpolation filter is $k$, and when using Parseval's theorem to compute the energy in the frequency domain, that gets squared. So, the energy gets multiplied by $k^2$, but on the other hand we limit the spectrum to $1/k$, so we get a total factor of $k$, consistent with our time domain calculation. This also shows that when I ignored the cross-terms in estimating the scaling of the total energy, I didn't make an error at all.

You're right. The power does get reduced during upsampling due to a larger denominator, unless the filter has a proper gain. When that gain is the same factor as the rate change, energy increases by the same factor but in the expression for power, both get canceled out and you end up with the same power.

For visualizing in figures what Timo has described very nicely here, you can read this article on sample rate conversion.