?? 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 + -