I am adding some white Gaussian noise on a signal in MATLAB 2008 R2
noisedSignal = awgn(signal, 25);% 25 is the SNR
but then when I calculate the SNR in the noisedSignal
snr = GetSNR(noisedSignal, noisedSignal-signal);
and
function SNR = GetSNR(signal, errorSignal)
SNR = 20 * log10(sqrt(mean(signal.^2))/sqrt(mean(errorSignal.^2)));
end
the SNR
calculated is 1.1818 which is not 25. What am I missing ?