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

📄 fg_03_02.m

📁 英文书《Digital Signal Processing with Examples in MATLAB》附带的MATLAB实例
💻 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 + -