📄 fg_03_02.m
字号:
% fg_03_02
% Chapter 3, fig. 3.2. Correlation detection.
%
sp_fig(1)
% Signal at N/5 and 4N/5-600.
N=5000;
w=[-ones(1,50),ones(1,50)];
y=[w -w w];
signal=[zeros(1,N/5),y,zeros(1,3*N/5-600),y,zeros(1,N/5)];
size=16;
subplot(3,1,1);
plot([y,zeros(1,4700)],'color','k'); grid;
axis([0 N -1.5 1.5]);
set(gca,'fontsize',16);
ylabel('Signal');
title('Example of Correlation Detection');
randn('state',123);
noise=2*randn(1,N);
x=signal+noise;
subplot(3,1,2);
plot(x,'k'); grid;
axis([0 N -10 10]);
set(gca,'fontsize',16);
ylabel('Signal+noise');
%rxy=crosscorr([y,zeros(1,N-100)],x,0,N);
rxy=crosscorr(y,x,0,N);
subplot(3,1,3);
plot(rxy,'k'); grid;
set(gca,'fontsize',16);
xlabel('Sample number');
ylabel('\phi_{xy}(m)');
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -