exp2.m.svn-base

来自「平稳信号的模拟与特征估计 随机信号课程实验」· SVN-BASE 代码 · 共 29 行

SVN-BASE
29
字号
Fs=256; 
n=0:1/Fs:1;
x=sin(2*pi*0.05*n)+2*cos(2*pi*0.12*n)+randn(size(n));
figure;
subplot(1,2,1);
R=xcorr(x);
plot(R);
title('256 auto-correlation');
window=rectwin(length(x)); 
nfft=256; 
[Pxx,f]=periodogram(x,window,nfft,Fs); 
subplot(1,2,2);
plot(f,10*log10(Pxx));
title('256 power-spectrum');

Fs=1024; 
n=0:1/Fs:1;
x=sin(2*pi*0.05*n)+2*cos(2*pi*0.12*n)+randn(size(n));
figure;
subplot(1,2,1);
R=xcorr(x);
plot(R);
title('1024 auto-correlation');
window=rectwin(length(x)); 
nfft=1024; 
[Pxx,f]=periodogram(x,window,nfft,Fs); 
subplot(1,2,2);
plot(f,10*log10(Pxx));
title('1024 power-spectrum');

⌨️ 快捷键说明

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