fg_07_07.m

来自「英文书《Digital Signal Processing with Examp」· M 代码 · 共 26 行

M
26
字号
% fg_07_07          Frequency functions.
%
N=10000;
rand('seed',0); randn('seed',0);
x=zeros(2,N);
x(1,:)=15*(rand(1,N)-.5);
x(2,:)=2*randn(1,N);
sp_fig(1,9,4);
ax=[-8 8 0 .08; -8 8 0 .2];
pos=[0.1300    0.1500    0.3270    0.73; 0.5780    0.1500    0.3270    0.73];
clr=['r','b'];
tl=['Uniform; \sigma=4.33 ';'Gaussian; \sigma=2.00'];
for ip=1:2,
   [f,x1,x2]=freq(x(ip,:));
   subplot(1,2,ip);
   set(gca,'position',pos(ip,:));
   axis(ax(ip,:));
   set(gca,'fontsize',16);
   xa=x1:x2;
   line([xa;xa],[zeros(1,x2-x1+1);f],'color','k'); grid;
   line(xa,f,'color',clr(ip),'linestyle','none','marker','*');
   xlabel('n'); ylabel('           f_n');
   title(tl(ip,:));
   set(gca,'xtick',[-8:2:8]);
end

⌨️ 快捷键说明

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