why is there 2.5 dB difference between log of averages and average of logs of a white signal?

89 Views Asked by At

When I take averaging on the spectrum of a signal for a better view, when wrongly taking averaging on the $10\log_{10}(\lvert \mathcal{F}(x)\rvert^2)$ of a white signal (e.g. random QPSK symbols) instead of first taking the average of $\lvert \mathcal{F}(x) \rvert^2$ and then $10\log_{10}()$ on the average result, I see the former one is 2.5 dB less. I wonder why. Here is a simple Matlab code to check:

M = 4; % M-PSK
L = 10000; % no. of averages
Nfft = 2000; % fft size
N = Nfft * L;
sbi_v = randi(M, N, 1) - 1; % integer symbols
sbc_v = pskmod(sbi_v, M, pi/4, 'gray'); % complex symbols
sbc_m = reshape(sbc_v, Nfft, N/Nfft); 
SBC_m = abs( fft(sbc_m, Nfft) ).^2;
SBC_log_m = 10*log10(SBC_m);

plot( [mean( SBC_log_m, 2) 10*log10( mean( SBC_m, 2) )] )
grid on
1

There are 1 best solutions below

2
On

In general, you cannot expect $\mathbb{E}_x[f(x)]=f[\mathbb{E}_x(x)]$ for non linear functions $f(\cdot)$. Since $\log(\cdot)$ is concave, you actually expect $\mathbb{E}_x[\log(x)] \leq \log[\mathbb{E}_x(x)]$ (Jensen's inequality), as you also observe. The 2.5 dB difference is due to the particular distribution of $x$ you are considering; other distributions (e.g., spectrum of a 64-QAM signal) will, in general, result in another value for the difference between these two quantities.