实验报告册
课 程: 通讯系统原理教程
实 验: 模拟信号调制实验
实验一: 模拟信号调制实验
一、实验目的
1、基于matlab函数对模拟信号的调制.
2.可以熟悉的掌握用matlab对模拟信号的调制、解调。
3.可以深刻的了解模拟调制、解调的过程,及一些基本思想,且得到一些应用。 二、实验原理
评语: 成绩: 签名: 日期: 1、
2、调制就是按调制信号(基带信号)的变化规律去改变载波某些参数的过程。参数(或特征值)
以不同的参数“表征”基带信号的特点构成AM、FM、PM的调制。 3、常规双边带调制(AM)
常规双边带调制就是标准幅度调制,它用调制信号去控制高频载波的振幅,使已调波的振幅按照调制信号的振幅规律线性变化。AM调制器模型下图所示。
假设调制信号为 x(t) ,冲击响应
,即滤波器 H(W)=1 ,是
全通网络。载波信号为调制信号 c(t)=coswct, xt叠加直流A0后与载波相乘,经过滤波器后就得到标准调制信号(AM信号),AM信号的时域和频域表示式分别为
2
4.、抑制载波双边带调幅(DSB)
基本思想:抑制不携带信息的载波分量的功率,将有效功率用于边带传输,从而提高调制效率。
令载波信号的A0=0,得到DSB调制信号的时域和频域描述
DSB调制器的数学模型:
三、实验内容
实验步骤(即Matlab编程过程):
产生一个频率为1Hz、功率为1的余弦信源,设载波频率为10Hz,试画出:(其中调制信号x(t)= cos(πt))。 (1)A=2的AM调制信号; (2)DSB调制信号; (3)SSB调制信号;
(4)在信道中各自加入经过带同滤波器后的窄带高斯白噪声,功率为0.1,解调
各个信号,并画出解调后的波形。 %先画出调制信号x(t)= cos(πt)的波形t=-5:0.1:5; 本实验前要先定义几个有用的matlabxt=cos(pi*t); 函数:T2F(傅里叶变换)、F2T(傅里叶subplot(111) 反变换)、lpf(低通滤波器)、bpf(带plot(t,xt);grid on; title('调制信号
x(t)=cos(\\pi*t)的波形');
3
通滤波器)、noise、noise_nb(噪声影响)。否 则,无法运行。 T2F函数:
%T2F(傅里叶变换)
function [f,sf]=T2F(t,st)
% this is a function using the FFT function to calculate a signal's fourier
%Translation
%input is the time and the signal vectors,the length of time must greater % than 2
% output is the frequency and the signal spectrum dt = t(2)-t(1);
T=t(end); df=1/T; N=length(st); f=-N/2*df:df:N/2*df-df; sf=fft(st);
sf=T/N*fftshift(sf); F2T(傅里叶反变换):
function[t,st]=F2T(f,sf)
% this function calculate the time signal using ifft function for the input
% signal's spectrum df=f(2)-f(1);
Fmx=(f(end)-f(1)+df); dt=1/Fmx;
N=length(sf); T=dt*N;
%t=-T/2:dt:T/2-dt; t=0:dt:T-dt; sff=fftshift(sf); st=Fmx*ifft(sff); lpf(低通滤波器):
function [t,st]=lpf(f,sf,B) % 本函数为通带为B的低通滤波器 % 入口参数:f:频率样本向量 % sf:频谱向量
% B:低通滤波器带宽 % 出口参数:t:时间向量 % st:输出信号向量 df=f(2)-f(1);
4
T=1/df;
hf=zeros(1,length(f));
bf=[-floor(B/df):floor(B/df)]+floor(length(f)/2); hf(bf)=1; yf=hf.*sf;
[t,st]=F2T(f,yf); st=real(st); bpf(带通滤波器):
function[t,st]=bpf(f,sf,B1,B2) df=f(2)-f(1); T=1/df;
hf=zeros(1,length(f));
bf=[floor(B1/df):floor(B2/df)]; bf1=floor(length(f)/2)+bf; bf2=floor(length(f)/2)-bf; hf(bf1)=1/sqrt(2*B2-B1); hf(bf2)=1/sqrt(2*B2-B1);
yf=hf.*sf.*exp(-j*2*pi*f*0.1*T); [t,st]=F2T(f,yf);
noise、noise_nb(噪声影响):
function noise(filename) %noise Image=imread(filename); subplot(2,2,1);
imshow(Image,[]); % 原图像 title('原图像');
noise_g=imnoise(Image,'gaussian');%增加高斯白噪声 subplot(2,2,2); imshow(noise_g,[]);
%imwrite(noise_g,'noise_g.bmp') title('高斯白噪声');
noise_s=imnoise(Image,'salt & pepper');
subplot(2,2,3); imshow(noise_s,[]);
title('黑白象素点噪声(椒盐)'); %imwrite(noise)
function[out]=noise_nb(fc,B,N0,t) % noise_nb dt=t(2)-t(1); Fmx=1/dt;
n_len=length(t); p=N0*Fmx;
rn=sqrt(p)*randn(1,n_len);
[f,rf]=T2F(t,rn);
[t,out]=bpf(f,rf,fc-B/2,fc+B/2); plot(t,mt,'r--');
title('DSB信号');xlabel('t');
调制过程编程如下:(在没有noise影响的情况) %信源
close all; clear all; dt=0.001; fm=1; fc=10; t=0:dt:5;
mt=cos(pi*t).*cos(2*pi*fm*t); N0=0.1;
%幅度AM调制 A=2;
s_am=(A+mt).*cos(2*pi*fc*t); B=2*fm; figure(1) subplot(321)
plot(t,s_am);hold on; plot(t,A+mt,'r--'); %AM解调
rt=s_am.*cos(2*pi*fc*t); rt=rt-mean(rt); [f,rf]=T2F(t,rt);
[t,rt]=lpf(f,rf,2*fm);
title('AM信号');xlabel('t'); subplot(322)
plot(t,rt);hold on; plot(t,mt/2,'r--');
title('AM解调信号');xlabel('t');
%DSB调制
s_dsb=mt.*cos(2*pi*fc*t); B=2*fm;
subplot(323)
plot(t,s_dsb);hold on;
四、实验结论:
%DSB解调
rt=s_dsb.*cos(2*pi*fc*t); rt=rt-mean(rt); [f,rf]=T2F(t,rt);
[t,rt]=lpf(f,rf,2*fm); subplot(324)
plot(t,rt);hold on; plot(t,mt/2,'r--'); title('DSB解调信号');xlabel('t');
%SSB调制
s_ssb=real(hilbert(mt).*exp(j*2*pi*fc*t)); B=fm;
s_ssb=s_ssb; subplot(325) plot(t,s_ssb);
title('SSB信号');xlabel('t'); %SSB解调
rt=s_ssb.*cos(2*pi*fc*t); rt=rt-mean(rt); [f,rf]=T2F(t,rt);
[t,rt]=lpf(f,rf,2*fm); subplot(326)
plot(t,rt);hold on; plot(t,mt/2,'r--');
title('SSB解调信号');xlabel('t'); 编程后输出图形如下:(在没有noise影响的情况)
5
通过上面的实验过程和结果与理论过程与结果对比分析,以上这个实验结果是比较准确的。通过解调信号图(A)与调制信号图(B)的比较,二者波形相同就是存在一些时移。实验中完成了信号的调制和解调的过程,达到了预期的目的。
6
因篇幅问题不能全部显示,请点此查看更多更全内容