📄 5-12.m
字号:
%例程5-12 利用特征向量法估计功率谱
% e.g.5-12.m for example5-12;
% to test function peig;
clf;
clear all;
% Generate the signal plus white noise and show
N=1024; % number of sampling data
n=0:N-1;
f1=0.1;
f2=0.9;
randn('state', 1);
wn=randn(size(n));
xn=sin(2*pi*f1*n)+2*cos(2*pi*f2*n)+wn;
subplot(211);
plot(n,xn); xlabel('Data sampling point n');
ylabel('Amplitude');
axis([0 1000 -10 10]);
title(' xn=sin(2*pi*f1*n)+2*cos(2*pi*f2*n)+wn');
%Autocorrelation matrix estimation
X=corrmtx(xn,12,'mod');
% Estimate the PSD using eigenvector method
subplot(212);
peig(X,10,'half');
xlabel('Normalized Frequency(rad/sample)');
ylabel('Power Spectrum Density(dB)');
title('PSD with eigenvector method');
grid on;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -