⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 adda.m

📁 在matlab中实现信号的模数以及数模转换
💻 M
字号:
clf reset
H=axes('unit','normalized','position',[0,0,1,1],'visible','off');
set(gcf,'currentaxes',H);
str='\fontname{楷书}AD-DA转换';
text(0.30,0.94,str,'fontsize',10);
h_fig=get(H,'parent');
set(h_fig,'unit','normalized','position',[0.1,0.2,0.7,0.4]);
h_axes=axes('parent',h_fig,'unit','normalized','position',...
  [0.1,0.15,0.55,0.7],'xlim',[0 15],'ylim',[0 1.8],'fontsize',8);


h_text1=uicontrol(h_fig,'style','text','unit','normalized','position',...
    [0.67,0.72,0.21,0.10],'horizontal','left','string',...
    {'输入采样频率Fs,Fs='},'fontsize',12);
h_edit=uicontrol(h_fig,'style','edit','unit','normalized',...
    'position',[0.89,0.72,0.08,0.10],'horizontal','left',...
    'callback' ,[ ...
    'Fs=str2num(get(gcbo,''string''));' , ...
    'Ts=1/Fs;',...
    'Dt=0.001;',...
    't=0:Dt:10;',...
    'xa1=exp(-t);',...
    'ty=t(length(t));',...
    'n=0:1:(ty/Ts);',...
    'nTs=n*Ts;',...
    'xn=exp(-nTs);',...
    'hn=nTs.*exp(-nTs/2);',...
    'yn=Ts*conv(xn,hn);',...
    'ny=0:(2*n(length(n)));',...
    'plot(ny*Ts,yn,''g'',''linewidth'',2.5);',...
    'axis([0,2*ty,0,1]);',...
    'hold on;',...
    't2=0:Dt:20;',...
    'yt=spline(ny*Ts,yn,t2);',...
    'plot(t2,yt,''r'');',...
    'axis([0,2*ty,0,1]);',...
    'hold on;',...
    'syms tao;',...
    'x=sym(''x'',''positive'');',...
    'ux=exp(-x);',...
    'hx=x*exp(-x/2);',...
    'uh_tao=subs(ux,x,tao)*subs(hx,x,x-tao);',...
    'yx=int(uh_tao,tao,0,x);',...
    'yt=simple(yx);',...
    'ezplot(yx,[0,2*ty]);',...
    'axis([0,2*ty,0,1]);',...
    'legend(''y(n)离散系统'',''y(t)离散系统'',''y(t)模拟系统'');',...
    ]); 

h_push1=uicontrol(h_fig,'style','push','unit','normalized',...
    'position',[0.67,0.47,0.12,0.15],'string','grid on',...
    'callback','grid on');
h_push2=uicontrol(h_fig,'style','push','unit','normalized',...
    'position',[0.67,0.25,0.12,0.15],'string','grid off',...
    'callback','grid off');

⌨️ 快捷键说明

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