# $\frac{\mathbb{E}[P]}{\mathbb{E}[N]}$ vs. $\mathbb{E}\left[\frac{P}{N}\right]$

This is a very simple question arised from my considerations in here: Log-normal shadowing and mean power.

I have understood that SNR is often defined as $$\frac{\mathbb{E}[P]}{\mathbb{E}[N]},$$ but why? Would the definition $$\mathbb{E}\left[\frac{P}{N}\right]$$ be equally intuitively valid?

We know that generally the above definitions are not equivalent. For sake of a simple example; if both $$P$$ and $$N$$ are log-normally (base $$e$$) distributed ~$$Lognormal(0,1)$$, we have that $$\frac{\mathbb{E}[P]}{\mathbb{E}[N]} = 1,$$ but $$\mathbb{E}\left[\frac{P}{N}\right]$$ = $$e$$. The difference is huge.

I guess that the mean noise power $$N$$ is often considered as AWGN with constant mean, an thus only its mean power matters during a transmission. But surely the mean power of $$N$$ could also be varying according to some distribution.

Would the definition be equally intuitively valid?

No.

Using the expectation operator $$\mathbb{E}$$ implies that both $$P$$ and $$N$$ are functions of time. The problem with the second definition is that $$P(t)$$ can be occasionally very small or zero in which case the quotient gets very large or infinite. These "low noise" instances will dominate the mean.

we can show this with a simple experiment: create two Gaussian random variables and calculate the ratio of the mean squares, vs mean squares of the ratio.

The first method gives us the consistently the correct answer, the second will be much larger and all over the place.

nx = 2^16;   % number of points
SNR = 2;  % true SNR
sig = sqrt(SNR)*randn(nx,1); % signal with energy SNR
noise = randn(nx,1); % noise with enegery 1

SNR1 = mean(sig.^2)./mean(noise.^2);
SNR2 = mean((sig./noise).^2);
% print results
fprintf('E<P>/E<N> = %8.2f\n',SNR1);
fprintf('E<P/N>    = %8.2f\n',SNR2);

• don't need to be functions of time, just random variables, but "multiple realizations over time" is indeed the most common case. Oct 11 at 12:38
• Fair enough. In order to take a mean, it has to be a function of something, I guess. Oct 11 at 12:58
• Ok, I understand your example – it is the mean noise power that matters, not the individual time instances. But the mean power of N could be a function over time, for example if the temperature changes. Oct 11 at 13:48
• Then your SNR also changes with time. You don't need to average over infinite time. Just a small enough time window so that the output of the averaging becomes stable. As long as the stabilization time is smaller than the time constants in your system, this works just fine. Oct 11 at 14:06
• If the noise power changes rapidly, you don't have "reasonably stationary" signals and the concept of a single SNR doesn't apply in the first place. Oct 11 at 20:03

I have understood that SNR is often defined as ...

That's the only sensible definition of SNR (assuming $$P$$ is signal power, and $$N$$ is noise power)! (other forms are just equivalent)

Would the definition E[P/N] be equally intuitively valid?

No. As you note yourself, it's mathematically simply not true.

Long story short: if $$P$$ and $$N$$ are lognormal, then there's random variables $$Q,M\sim \mathcal N$$ such that $$P=e^Q, N=e^M$$, or

$$\log(P/N) =\log(P)-\log(N) = \log(e^Q) - \log(e^M) = Q-M:=R$$

and since $$R=Q-M$$ is by normally distributed with mean $$\mu_R=\mu_Q-\mu_M$$ and variance $$\sigma^2_R=\sigma^2_Q+\sigma^2_M-2\rho_{QM}$$, with the last term being zero if noise is independent from signal.

Now, $$\log(P/N) =R \implies P/N = e^R$$, and that, again, is lognormally distributed. As you know how the mean and variance of a lognormal RV are related to the mean and variance of the "underlying" normal RV, you can calculate the expectation:

\begin{align} E(P/N) &= E(e^R)\\ &= E(\mu_R+\sigma^2_R/2)\\ &=E(\mu_Q-\mu_M+\sigma^2_Q/2+\sigma^2_M/2-\rho_{QM})\\ &=\mu_Q-\mu_M+\sigma^2_Q/2+\sigma^2_M/2-\rho_{QM}&\|\text{properties logn from normal}\\ &=\log(\mu_P^2/\sqrt{\mu_P^2+\sigma_P^2})-\log(\mu_N^2/\sqrt{\mu_N^2+\sigma_N^2})\\ &\phantom{= } +\log(1+\sigma_P^2/\mu_P^2)/2+\log(1+\sigma_N^2/\mu_N^2)/2-\rho_{QM}\\ &=\log\left(\frac{\mu_P^2/\sqrt{\mu_P^2+\sigma_P^2}}{\mu_N^2/\sqrt{\mu_N^2+\sigma_P^2}}(1+\sigma_P^2/\mu_P^2)(1+\sigma_N^2/\mu_N^2)/4\right)-\rho_{QM}\\ &\ne \mu_P/\mu_N\\ \end{align}

• There is mathematically nothing wrong that $E(P/N) \neq \mu_P/\mu_N?$ It's just that that here we are not concerned about how $P/N$ behaves, but about signals and noises mean energies. Oct 13 at 23:21
• @Mundo that inequality simply means that your "alternative definition" simply gives different values than the correct definition, so it can't be equally valid (as the proper SNR is useful for Shannon capacity calculation); and if you look at the result, you'll notice that your definition leads to a constant summand – no matter how low the signal power ever becomes, you don't approach 0 SNR! Oct 14 at 7:10

Why do you we have a ratio of expectations for the SNR? Probably because we often use an additive model for the noise: observation is signal plus noise. When the model is more multiplicative, an expectation of a ratio might make more sense, at the expense of being less tractable in general.

Under appropriate assumptions, some consider that $$\frac{\mathbb{E}[P]}{\mathbb{E}[N]}$$
and $$\mathbb{E}\left[\frac{P}{N}\right]$$ can be related through limits or approximations. One typical assumption can be that the variable at the denominator takes only positive values, with a non-vanishing expectation. This could suit to the case of looking at energies.

Through a second-order Taylor expansion, one may obtain:

$$\mathbb{E}\left[\frac{P}{N}\right]\sim \frac{\mathbb{E}[P]}{\mathbb{E}[N]}\left(1-\frac{\mathrm{Cov}(P,N)}{\mathbb{E}[P]\mathbb{E}[N]}+\frac{\mathrm{Var}(N)}{|\mathbb{E}[N]|^2}\right)$$

Computations are detailed in Howard Seltman's Approximations for Mean and Variance of a Ratio (source). For instance, the second-order correction works well here with uniform distribution, but it can be very bad. clear all
for iRun = 1:100
nSample = 512;
E = (rand(nSample,1))+0.1;
N = (rand(nSample,1)/1+0.5);
%plot([E,N,E+N])

Eesp = mean(E);
Nesp = mean(N);
ENesp = mean(E./N);
EespNesp = Eesp/Nesp;

COVEN = mean((E-Eesp).*(N-Nesp));
VARN =  mean((N-Nesp).*(N-Nesp));
facto = (1-COVEN/(Eesp*Nesp)+VARN/Nesp^2);
ENespArray(iRun,1) = ENesp;
EespNespArray(iRun,1) = EespNesp;
EespNespApproxArray(iRun,1) = EespNesp*facto;
end

figure(1);clf
plot([ENespArray EespNespArray EespNespApproxArray])
h= legend('E(E/N)','E(E)/E(N)','Approx');

• Yeah you said it. If I now understand correctly, we could consider that $P$ and $N$ are randomly fluctuating mean energies of a signal and noise, and then $\mathbb{E}(P/N)$ would make sense. Oct 13 at 23:36
• If you expect that the noise does not behave in an additive manner, but possibly in a multiplicative one, a ratio could make sense. Note however, as mentioned in other answers, what matters is both the "mean" and the fluctuation around the mean, for this criterium to be meaningful. Having a floor constant to the denominator could be necessary to stabilize the estimation, like for Wiener filtering Oct 14 at 8:51