MATLAB信号的幅度调制和解调.doc_第1页
MATLAB信号的幅度调制和解调.doc_第2页
MATLAB信号的幅度调制和解调.doc_第3页
MATLAB信号的幅度调制和解调.doc_第4页
MATLAB信号的幅度调制和解调.doc_第5页
已阅读5页,还剩12页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

一、任务与题目分析:1.设计任务:在MATLAB的图形窗口中,实现2-3个有限带宽信号的调制与解调。显示各个信号的时域波形及频谱图;通过按钮选择其中的一个信号进行解调并显示解调信号的波形。2.任务分析:设带限信号的频谱为,现将乘以载波信号,即得到已调信号:,如下图。实现信号解调的原理图如下图。若要从多个已调信号中解调出其中的一个信号,只需将已调信号再乘以该已调信号的载波信号,并进行低通率波即可得到原信号。下图是多路频分复用系统的示意图。二、方案设计 信号设计:。,。载波信号频率应远大于。方案一:使用GUI图形届面显示信号的时域及频域波形。低通滤波器:可以使用理想数字低通滤波器。方案二:使用Simulink界面实现信号的处理,使用示波器观测信号的时域波形;使用频谱仪显示信号的频谱图。模拟低通滤波器:可选用巴特沃斯低通滤波器。综合两种方案的特点,最终选择方案一.三、算法设计1. GUI界面设计2.GUI程序设计信号时域波形与频谱显示控制程序部分:% - Executes on button press in pushbutton1.function pushbutton1_Callback(hObject, eventdata, handles)% hObject handle to pushbutton1 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) st1=str2double(get(handles.edit3,string);st2=str2double(get(handles.edit2,string);t = eval(get(handles.edit4,String); m1=get(handles.radiobutton1,value);m2=get(handles.radiobutton2,value);m3=get(handles.radiobutton3,value);persistent cif isempty(c) c=0endc=c+1;if(m1=1) if(st2=(5*st1) errordlg(输入数值违规,输入w0值应大于5倍的信号频率 ,请重新输入!) elsef=sin(st1.*t)+sin(3*st1.*t)/3; g=cos(st2.*t); w1=st1 w2=3*st1 h=fft(f) Fp=abs(h); Xp=angle(h) if(mod(c,2)=0) % Create frequency plotaxes(handles.shiyu)plot(t,f,r);set(handles.shiyu,XMinorTick,on)grid on; % Create pinyu plotaxes(handles.pinyu)plot(t,Fp,b);set(handles.pinyu,XMinorTick,on)xlabel(幅频特性)grid on str=sprintf(f1=sin(%d*t)+sin(%d*t)/%d,w1,w2,w2);set(handles.text9,string,str); str=sprintf(g=cos(%d*t),st2);set(handles.text6,string,str);endif(mod(c,2)=0) axes(handles.pinyu)plot(t,Xp,b);set(handles.pinyu,XMinorTick,on)xlabel(相频特性)grid on axes(handles.shiyu)plot(t,f,r);set(handles.shiyu,XMinorTick,on)grid on; str=sprintf(f1=sin(%d*t)+sin(%d*t)/%d,w1,w2,w2);set(handles.text9,string,str); str=sprintf(g=cos(%d*t),st2);set(handles.text6,string,str); endendend if(m2=1) if(st2=(5*st1) errordlg(输入数值违规,输入w0值应大于5倍的信号频率 ,请重新输入!) else f=sin(st1.*t)+sin(3*st1.*t)/3+cos(2*st1.*t)/2; g=cos(st2.*t); w1=st1 w2=3*st1 w3=2*st1 h=fft(f) Fp=abs(h); Xp=angle(h) if(mod(c,2)=0) % Create frequency plotaxes(handles.shiyu)plot(t,f,r);set(handles.shiyu,XMinorTick,on)grid on; % Create pinyu plotaxes(handles.pinyu)plot(t,Fp,b);set(handles.pinyu,XMinorTick,on)xlabel(幅频特性)grid on str=sprintf(f2=sin(%d*t)+sin(%d*t)/%d+cos(%d*t)/%d,w1,w2,w2,w3,w3);set(handles.text9,string,str); str=sprintf(g=cos(%d*t),st2);set(handles.text6,string,str);endif(mod(c,2)=0) axes(handles.pinyu)plot(t,Xp,b);set(handles.pinyu,XMinorTick,on)xlabel(相频特性)grid on axes(handles.shiyu)plot(t,f,r);set(handles.shiyu,XMinorTick,on)grid on; str=sprintf(f2=sin(%d*t)+sin(%d*t)/%d+cos(%d*t)/%d,w1,w2,w2,w3,w3);set(handles.text9,string,str); str=sprintf(g=cos(%d*t),st2);set(handles.text6,string,str); endendend if(m3=1) if(st2=(5*st1) errordlg(输入数值违规,输入w0值应大于5倍的信号频率 ,请重新输入!) else f=sin(st1.*t)+cos(3*st1.*t)/3; g=cos(st2.*t); w1=st1 w2=3*st1 h=fft(f) Fp=abs(h); Xp=angle(h) if(mod(c,2)=0) % Create frequency plotaxes(handles.shiyu)plot(t,f,r);set(handles.shiyu,XMinorTick,on)grid on; % Create pinyu plotaxes(handles.pinyu)plot(t,Fp,b);set(handles.pinyu,XMinorTick,on)xlabel(幅频特性)grid on str=sprintf(f3=sin(%d*t)+cos(%d*t)/%d,w1,w2,w2);set(handles.text9,string,str); str=sprintf(g=cos(%d*t),st2);set(handles.text6,string,str);endif(mod(c,2)=0) axes(handles.pinyu)plot(t,Xp,b);set(handles.pinyu,XMinorTick,on)xlabel(相频特性)grid on axes(handles.shiyu)plot(t,f,r);set(handles.shiyu,XMinorTick,on)grid on; str=sprintf(f3=sin(%d*t)+cos(%d*t)/%d,w1,w2,w2);set(handles.text9,string,str); str=sprintf(g=cos(%d*t),st2);set(handles.text6,string,str); endendend 信号调制波形显示程序:% - Executes on button press in pushbutton2.function pushbutton2_Callback(hObject, eventdata, handles)% hObject handle to pushbutton2 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)st1=str2double(get(handles.edit3,string);st2=str2double(get(handles.edit2,string)t = eval(get(handles.edit4,String); m1=get(handles.radiobutton1,value);m2=get(handles.radiobutton2,value);m3=get(handles.radiobutton3,value);if(m1=1) if(st2=(5*st1) errordlg(输入数值违规,输入w0值应大于5倍的信号频率 ,请重新输入!) else f=sin(st1.*t)+sin(3*st1.*t)/3; g=cos(st2.*t); ft=f.*g w1=st1 w2=3*st1 axes(handles.tiaozhi)plot(t,ft,r);set(handles.tiaozhi,XMinorTick,on)xlabel(调制波形)grid on axes(handles.shiyu)plot(t,f,b);set(handles.shiyu,XMinorTick,on)grid on; str=sprintf(f1=sin(%d*t)+sin(%d*t)/%d,w1,w2,w2);set(handles.text9,string,str); str=sprintf(g=cos(%d*t),st2);set(handles.text6,string,str); endend if(m2=1) if(st2=(5*st1) errordlg(输入数值违规,输入w0值应大于5倍的信号频率 ,请重新输入!) else f=sin(st1.*t)+sin(3*st1.*t)/3+cos(2*st1.*t)/2; g=cos(st2.*t); ft=f.*g w1=st1 w2=3*st1 axes(handles.tiaozhi)plot(t,ft,r);set(handles.tiaozhi,XMinorTick,on)xlabel(调制波形)grid on axes(handles.shiyu)plot(t,f,b);set(handles.shiyu,XMinorTick,on)grid on; str=sprintf(f2=sin(%d*t)+sin(%d*t)/%d+cos(%d*t)/%d,w1,w2,w2,w3,w3);set(handles.text9,string,str); str=sprintf(g=cos(%d*t),st2);set(handles.text6,string,str); endend if(m3=1) if(st2=(5*st1) errordlg(输入数值违规,输入w0值应大于5倍的信号频率 ,请重新输入!) else f=sin(st1.*t)+cos(3*st1.*t)/3; g=cos(st2.*t); ft=f.*g w1=st1 w2=3*st1 axes(handles.tiaozhi)plot(t,ft,r);set(handles.tiaozhi,XMinorTick,on)xlabel(调制波形)grid on axes(handles.shiyu)plot(t,f,b);set(handles.shiyu,XMinorTick,on)grid on; str=sprintf(f3=sin(%d*t)+cos(%d*t)/%d,w1,w2,w2);set(handles.text9,string,str); str=sprintf(g=cos(%d*t),st2);set(handles.text6,string,str); endend 解调信号波形显示程序: % - Executes on button press in pushbutton6.function pushbutton6_Callback(hObject, eventdata, handles)% hObject handle to pushbutton6 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) st1=str2double(get(handles.edit3,string);st2=str2double(get(handles.edit2,string)t = eval(get(handles.edit4,String); m1=get(handles.radiobutton1,value);m2=get(handles.radiobutton2,value);m3=get(handles.radiobutton3,value);if(m1=1) if(st2=(5*st1) errordlg(输入数值违规,输入w0值应大于5倍的信号频率 ,请重新输入!) else f=sin(st1.*t)+sin(3*st1.*t)/3; g=cos(st2.*t); ft=f.*g.*g w1=st1 w2=3*st1 axes(handles.jietiao)plot(t,ft,r);set(handles.jietiao,XMinorTick,on)xlabel(解调波形)grid on axes(handles.shiyu)plot(t,f,b);set(handles.shiyu,XMinorTick,on)grid on; str=sprintf(f1=sin(%d*t)+sin(%d*t)/%d,w1,w2,w2);set(handles.text9,string,str); str=sprintf(g=cos(%d*t),st2);set(handles.text6,string,str); endend if(m2=1) if(st2=(5*st1) errordlg(输入数值违规,输入w0值应大于5倍的信号频率 ,请重新输入!) else f=sin(st1.*t)+sin(3*st1.*t)/3+cos(2*st1.*t)/2; g=cos(st2.*t); ft=f.*g.*g w1=st1 w2=3*st1 axes(handles.jietiao)plot(t,ft,r);set(handles.jietiao,XMinorTick,on)xlabel(解调波形)grid on axes(handles.shiyu)plot(t,f,b);set(handles.shiyu,XMinorTick,on)grid on; str=sprintf(f2=sin(%d*t)+sin(%d*t)/%d+cos(%d*t)/%d,w1,w2,w2,w3,w3);set(handles.text9,string,str); str=sprintf(g=cos(%d*t),st2);set(handles.text6,string,str); endend if(m3=1) if(st2=(5*st1) errordlg(输入数值违规,输入w0值应大于5倍的信号频率 ,请重新输入!) else f=sin(st1.*t)+cos(3*st1.*t)/3; g=cos(st2.*t); ft=f.*g.*g w1=st1 w2=3*st1 axes(handles.jietiao)plot(t,ft,r);set(handles.jietiao,XMinorTick,on)xlabel(解调波形)grid on axes(handles.shiyu)plot(t,f,b)set(handles.shiyu,XMinorTick,on)grid on; str=sprintf(f3=sin(%d*t)+cos(%d*t)/%d,w1,w2,w2);set(handles.text9,string,str); str=sprintf(g=cos(%d*t),st2);set(handles.text6,string,str); endend四、MATLAB实现1. 载波信号:g=cos(w0*t); 选取信号1: f1=sin(w1*t)+sin(3*w1*t)/t; 设定载波频率w0=6;信号频率w1=1;时间向量t:0:0.01:2*pi; 执行情况一: 幅频特性执行情况二:相频特性2. 载波信号:g=cos(w0*t); 选取信号2: f2=sin(w1*t)+sin(3*w1*t)/t+cos(2*w1*t); 设定载波频率w0=6;信号频率w1=1;时间向量t:0:0.01:2*pi;执行情况一:幅频特性执行情况二:(相频特性)五、结果分析 (1)原始信号以及频谱的分析:由于原始信号是正信号,所以经傅里叶变换后经设计得出图形。故正确得出了原始信号的频谱 (2)对于已调信号则是由原信号与载波信号相乘的结果。由于正弦函数幅度均匀,故与载波相乘后,幅度分

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论