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

    %% SFDR of Sinusoid
% Obtain the SFDR for a 10 MHz tone with amplitude 1 sampled at 100 MHz.
% There is a spur at the 1st harmonic (20 MHz) with an amplitude of
% $3.16\times10^{-4}$.

% Copyright 2015 The MathWorks, Inc.


deltat = 1e-8;
fs = 1/deltat;
t = 0:deltat:1e-5-deltat;
x = cos(2*pi*10e6*t)+3.16e-4*cos(2*pi*20e6*t);
r = sfdr(x,fs)

%%
% Display the spectrum of the signal. Annotate the fundamental, the DC
% value, the spur, and the SFDR.

sfdr(x,fs);