e1041.m
来自「matlab算法集 matlab算法集」· M 代码 · 共 38 行
M
38 行
%----------------------------------------------------------------
% Example 10.4.1: Target detection
%----------------------------------------------------------------
% Initialize
clc
clear
N = 512;
M = 256;
d = 200;
alpha = 0.05;
beta = 0.05;
randinit (1000);
% Construct signals
fprintf ('Example 10.4.1: Target Detection\n');
t = [0 : N-1]';
x = randg (N,1,0,beta);
y = randg (M,1,0,1);
for i = 1 : N
if (i > d) & (i <= d+M)
x(i) = x(i) + alpha*y(i-d);
end
end
graphxy (t,x,'Received Signal','k','x(k)')
% Compute cross correlation
pxy = crosscor (x,y);
graphxy (t,pxy,'Normalized Cross Correlation','i',...
'\rho_{xy}(i)')
%----------------------------------------------------------------
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?