compare.m

来自「现代通信系统使用-matlab (书中代码),自己慢慢写的,并经过调试的,希望对」· M 代码 · 共 19 行

M
19
字号
ts=0.001;                          
fs=1/ts;                           
t=[0:ts:10];                       
x=cos(2*pi*47*t)+cos(2*pi*219*t);  
p=spower(x);                        
psd1=spectrum(x,512);   
psd2=spectrum(x,1024);   
psd3=spectrum(x,2048); 
pause   % Press a key to see the power in the signal.
p
pause   % Press a key to see the power spectrum.
figure(1)
specplot(psd1,fs)
pause
figure(2)
specplot(psd2,fs)
pause
figure(3)
specplot(psd3,fs)

⌨️ 快捷键说明

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