www.gusucode.com > signal 案例源码程序 matlab代码 > signal/SINADOfAmplifiedSignalExample.m

    %% SINAD of Amplified Signal
% Generate a sinusoid of frequency 2.5 kHz sampled at 50 kHz. Add Gaussian
% white noise with standard deviation 0.00005 to the signal. Pass the
% result through a weakly nonlinear amplifier. Plot the SINAD.

%%

fs = 5e4;
f0 = 2.5e3;
N = 1024;
t = (0:N-1)/fs;

ct = cos(2*pi*f0*t);
cd = ct + 0.00005*randn(size(ct));

amp = [1e-5 5e-6 -1e-3 6e-5 1 25e-3];
sgn = polyval(amp,cd);

sinad(sgn,fs);

%%
% The plot shows the spectrum used to compute the ratio and the region
% treated as noise. The DC level and the fundamental are excluded from the
% noise computation. The fundamental is labeled.