⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 c8_snrexample.m

📁 经典书籍《通信系统仿真原理与无线应用》chap8部分课后题仿真源代码
💻 M
字号:
% File: c8 snrexample.m
kpts = 1024;                         % FFT Block size
k = 1:kpts;                           % sample index vector
fd = 2;                              % desired signal frequency
fi = 8;                               % interference frequency
Ax = 80; Ayd = 20; Ayi =4;             % amplitudes
phase = pi/4;                        % phase shift
nstd = 0.8;                          % noise standard deviation
%
theta = 2*pi*k/kpts;                   % phase vector
x = Ax*sin(fd*theta);                  % desired signal
yd = Ayd*sin(fd*theta+pi/4);           % desired signal at receiver input
yi = Ayi*sin(fi*theta);                  % interference
noise = nstd*randn(1,kpts);            % noise at receiver input
yy = yd+yi+noise;                    % receiver input
[gain,delay,px,py,rxy,rho,snrdb] = snrmse(x,yy);
%
% display results
%
cpx = ['The value of Px is ',num2str(px),'.'];
cpy = ['The value of Py is ',num2str(py),'.'];
cgain = ['The value gain is ',num2str(gain),'.'];
cdel = ['The value of delay is ',num2str(delay),'.'];
csnrdb = ['The value of SNR is ',num2str(snrdb),'dB.'];
disp(' ') % insert blank line
disp(cpx)
disp(cpy)
disp(cgain)
disp(cdel)
disp(csnrdb)
% End of script file.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -