Signal to noise and distortion ratio – MATLAB sinad

Create two signals. Both signals have a fundamental frequency of π/4 rad/sample with amplitude 1 and the first harmonic of frequency π/2 rad/sample with amplitude 0.025. One of the signals additionally has additive white Gaussian noise with variance 0.052.

Create the two signals. Set the random number generator to the default settings for reproducible results. Determine the SINAD for the signal without additive noise and compare the result to the theoretical SINAD.

n = 0:159;
x = cos(pi/4*n)+0.025*sin(pi/2*n);
rng 

default

y = cos(pi/4*n)+0.025*sin(pi/2*n)+0.05*randn(size(n)); r = sinad(x)
r = 32.0412
powfund = 1;
powharm = 0.025^2;
thSINAD = 10*log10(powfund/powharm)
thSINAD = 32.0412

Determine the SINAD for the sinusoidal signal with additive noise. Show how including the theoretical variance of the additive noise approximates the SINAD.

r = sinad(y)
r = 22.8085
varnoise = 0.05^2;
thSINAD = 10*log10(powfund/(powharm+varnoise))
thSINAD = 25.0515

Xổ số miền Bắc