信号与系统仿真
课程设计报告书
设计题目: 信号的幅度调制和解调
姓 名:_
学 号:
班 级: 电子 101
信息与电子工程学院
2012 年 12 月 19 日
cos(
0t ,即得到已调信号:
)
一、题目分析
设带限信号 )(t
f 的频谱为
( jF
)
,现将 )(t
f 乘以载波信号
)(
ty
f
)(
t
cos(
0t
)
,如下图。
实现信号解调的原理图如下图。
若要从多个已调信号中解调出其中的一个信号,只需将已调信号再乘以该已调信号的载波信号,并进
行低通率波即可得到原信号 )(t
f 。下图是多路频分复用系统的示意图。
二、方案设计
信号设计:
f
1
)(
t
sin(
0
t
)
sin(
3
0
t
3/)
sin(
5
0
t
5/)
。
f
2
)(
t
sin(
0
t
)
sin(
3
0
t
3/)
cos(
2
0
t
/)
t
,
f
3
)(
t
sin(
)
t
0
cos(
3
0
t
3/)
。
载波信号频率应远大于 05 。
方案一:使用 GUI 图形届面显示信号的时域及频域波形。
低通滤波器:可以使用理想数字低通滤波器。
方案二:使用 Simulink 界面实现信号的处理,使用示波器观测信号的时域波形;使用频谱仪显示信
号的频谱图。
模拟低通滤波器:可选用巴特沃斯低通滤波器。
综合两种方案的特点,最终选择方案一.
三、算法设计
1.GUI 界面设计
2.GUI 程序设计
信号时域波形与频谱显示控制程序部分:
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)
% --- Executes on button press in pushbutton2.
st1=str2double(get(handles.edit2,'string'));
st2=str2double(get(handles.edit1,'string'));
t = eval(get(handles.edit3,'String'));
m1=get(handles.radiobutton1,'value');
m2=get(handles.radiobutton2,'value');
m3=get(handles.radiobutton3,'value');
persistent c
if isempty(c)
c=0
end
c=c+1;
if(m1==1)
if(st2<=(5*st1))
errordlg('输入数值违规,输入 w0 值应大于 5 倍的信号频率 ,请重新输入!')
else
f=sin(st1.*t)+sin(3*st1.*t)/3+sin(5*st1.*t)/5;
g=cos(st2.*t);
w1=st1
w2=3*st1
w3=5*st1
h=fft(f)
Fp=abs(h);
Xp=angle(h)
if(mod(c,2)~=0)
% Create frequency plot
axes(handles.shiyu)
plot(t,f,'r');
set(handles.shiyu,'XMinorTick','on')
grid on;
% Create pinyu plot
axes(handles.pinyu)
plot(t,Fp,'b');
set(handles.pinyu,'XMinorTick','on')
xlabel('幅频特性')
grid on
str=sprintf('f1=sin(%d*t)+sin(%d*t)/%d+sin(%d*t)/%d',w1,w2,w2,w3,w3);
set(handles.text3,'string',str);
str=sprintf('g=cos(%d*t)',st2);
set(handles.text4,'string',str);
end
if(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.text3,'string',str);
str=sprintf('g=cos(%d*t)',st2);
set(handles.text4,'string',str);
end
end
end
if(m2==1)
if(st2<=(5*st1))
errordlg('输入数值违规,输入 w0 值应大于 5 倍的信号频率 ,请重新输入!')
else
f=sin(st1.*t)+sin(5*st1.*t)/5;
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 plot
axes(handles.shiyu)
plot(t,f,'r');
set(handles.shiyu,'XMinorTick','on')
grid on;
% Create pinyu plot
axes(handles.pinyu)
plot(t,Fp,'b');
set(handles.pinyu,'XMinorTick','on')
xlabel('幅频特性')
grid on
str=sprintf('f2=sin(%d*t)+sin(%d*t)/%d',w1,w2,w2);
set(handles.text3,'string',str);
str=sprintf('g=cos(%d*t)',st2);
set(handles.text4,'string',str);
end
if(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',w1,w2,w2);
set(handles.text3,'string',str);
str=sprintf('g=cos(%d*t)',st2);
set(handles.text4,'string',str);
end
end
end
if(m3==1)
if(st2<=(5*st1))
errordlg('输入数值违规,输入 w0 值应大于 5 倍的信号频率 ,请重新输入!')
else
f=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 plot
axes(handles.shiyu)
plot(t,f,'r');
set(handles.shiyu,'XMinorTick','on')