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

📄 5-4.m

📁 经典数字信号处理滤波器的源代码 重点是利用巴特沃斯模拟滤波器转而设计其它数字滤波器
💻 M
字号:
%例程5-4  计算随机信号的自协方差函数与互协方差函数

% e.g.5-4.m for example5-4 to test function of xcov;
clear;
N=256;
f=.1;
t=[0:N-1];
a1=3;
a2=4;
Mlag=N/4;
% Generate two sine waves plus white noise respectively
x=a1*sin(2*pi*f*t)+a2*randn(1,N);
y=a2*sin(2*pi*f*t)+a1*randn(1,N);
subplot(2,2,1);
plot(x(1:N/2));
grid on;
title('Original signal x');
subplot(222);
plot(y(1:N/2));
grid on;
title('Original signal y');
%  Estimate the biased autocovariance of random process x
auto_cx=xcov(x,Mlag,'biased');
subplot(223);
plot((-Mlag:Mlag),auto_cx);
title('Autocovariance of x');
% Estimate the biased cross-covariance of random processes x and y
cross_cxy=xcov(x,y,Mlag,'biased');
subplot(224);
plot((-Mlag:Mlag),cross_cxy);
title('Cross-Covariance of x and y');

⌨️ 快捷键说明

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