一、软件仿真部分:数字频带传输通信系统仿真.doc_第1页
一、软件仿真部分:数字频带传输通信系统仿真.doc_第2页
一、软件仿真部分:数字频带传输通信系统仿真.doc_第3页
一、软件仿真部分:数字频带传输通信系统仿真.doc_第4页
一、软件仿真部分:数字频带传输通信系统仿真.doc_第5页
已阅读5页,还剩24页未读 继续免费阅读

下载本文档

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

文档简介

内蒙古工业大学课程设计任务书参考格式学院(系): 信息工程学院 课程名称: 专业综合设计 指导教师(签名): 专业班级: 通信04-1班 学生姓名: 王兵 学号: 040204011 一、课程设计题目数字基带/频带通信系统的设计二、课程设计的目的“数字基带/频带通信系统的设计”是针对通信工程专业学生的实践教学环节。通过综合设计,要求学生利用所学专业知识和软件、硬件工具,掌握通信系统的分析、设计、仿真和调试技能,深入理解通信系统的基本组成,扩展专业背景知识,培养工程技能和实际操作能力。 三、课程设计的主要内容和要求(包括原始数据、技术参数、设计要求、工作量要求等) 1、 系统硬件设计2、 系统软件仿真3、 系统硬件调试4、 设计报告的完成四、工作进度安排 专业综合设计为期二周,具体分5个阶段进行:1、查阅资料:利用1-2天,去图书馆或上网查阅资料,熟悉通信系统的相关内容;2、系统设计:根据设计要求,提出设计方案; 3、系统仿真:利用matlab语言进行系统仿真; 4、系统调试:利用通信原理实验箱,合理选择电路板;5、报告整理考核:最后1-2天进行设计报告的整理和考核。五、主要参考文献1、通信原理樊昌信编著2、通信系统仿真技术黎玉玲编著(内部学习资料)审核批准意见系(教研室)主任(签字) 仿真部分:一、设计内容:数字频带传输系统的matlab仿真实现1个人单独完成部分:a/d转换(60分)(一)基本任务:单频正弦波模拟信号的简单数字化。即对一个单频正弦波模拟信号进行抽样、均匀量化、pcm二进制自然编码。1、 a/d转换部分的要求输入的信号幅度a 、频率f、相位p、量化电平d可变;仿真时间是02/f,抽样频率20f;输出信号要求是平顶正弦波;给出量化输出信号、抽样信号在同一图形窗口的波形;按照量化序号给出pcm二进制自然编码,在转换成数字序列;2、 a/d转换部分的步骤单频正弦波模拟信号的抽样对其进行均匀量化进行消顶处理二进制自然编码3、 程序代码说明function sampl,quant,pcm=a_d_1(a,f,p,d)%输入变量a、f、p、d;%输出变量:samp1为抽样后的输入信号;quant为均匀量化后输出信号;%pcm为编码后的二进制自然编码数字序列;4、a/d转换程序代码function sampl,quant,pcm,pcm2=a_d_1(a,f,p,d)t=0:1/(20*f):2/f;x=a*sin(2*pi*f*t+p);sampl=x/max(x) % 归一化后的抽样信号subplot(3,1,1)plot(t,x,m*); %粉色为原始抽样后信号hold onplot(t,sampl,m.) ; %归一化后的信号partition=-1:2/d:1codebook=-1-1/d:2/d:1indx,quant=quantiz(sampl,partition,codebook);m=min(quant);for i=1:length(quant) if quant(i)=m; quant(i)=quant(i)+2/d; end i=i+1;endhold onplot(t,quant,g*-) %绿色为处理后的平顶正弦波信号index=indx-1pcm=zeros(length(index)-1);i=1;while i=length(index) if index(i,1)=-1 index(i,1)=0; end i=i+1;endn=ceil(log2(d);pcm=dec2bin(index,n); %pcm为编码后输出m1=length(pcm);pcm1=pcm;pcm2=reshape(pcm1,1,m1*n); %将二进制转换为行矢量5、测试程序的结果(基本任务)测试信号:sampl,quant,pcm,pcm2=a_d_1(4,32000,0,14)%输入信号波形和归一化后量化后波形(进行消尖处理后)%samp1为抽样后值sampl = columns 1 through 7 0 0.3090 0.5878 0.8090 0.9511 1.0000 0.9511 columns 8 through 14 0.8090 0.5878 0.3090 0.0000 -0.3090 -0.5878 -0.8090 columns 15 through 21 -0.9511 -1.0000 -0.9511 -0.8090 -0.5878 -0.3090 -0.0000 columns 22 through 28 0.3090 0.5878 0.8090 0.9511 1.0000 0.9511 0.8090 columns 29 through 35 0.5878 0.3090 0.0000 -0.3090 -0.5878 -0.8090 -0.9511 columns 36 through 41 -1.0000 -0.9511 -0.8090 -0.5878 -0.3090 -0.0000量化后值(基本任务)quant = columns 1 through 7 -0.0714 0.3571 0.6429 0.7857 0.9286 0.9286 0.9286 columns 8 through 14 0.7857 0.6429 0.3571 0.0714 -0.3571 -0.6429 -0.7857 columns 15 through 21 -0.9286 -0.9286 -0.9286 -0.7857 -0.6429 -0.3571 -0.0714 columns 22 through 28 0.3571 0.6429 0.7857 0.9286 0.9286 0.9286 0.7857 columns 29 through 35 0.6429 0.3571 0.0714 -0.3571 -0.6429 -0.7857 -0.9286 columns 36 through 41 -0.9286 -0.9286 -0.7857 -0.6429 -0.3571 -0.0714二进制编码:(基本任务)pcm =01101001101111001101110111011100101110010111010000100001000000000000000100100100011010011011110011011101110111001011100101110100001000010000000000000001001001000110将pcm转换为数字序列(基本任务)pcm2 = columns 1 through 12 0 1 1 0 1 0 0 1 1 0 1 1 columns 13 through 24 1 1 0 0 1 1 0 1 1 1 0 1 columns 25 through 36 1 1 0 1 1 1 0 0 1 0 1 1 columns 37 through 48 1 0 0 1 0 1 1 1 0 1 0 0 columns 49 through 60 0 0 1 0 0 0 0 1 0 0 0 0 columns 61 through 72 0 0 0 0 0 0 0 0 0 0 0 1 columns 73 through 84 0 0 1 0 0 1 0 0 0 1 1 0 columns 85 through 96 1 0 0 1 1 0 1 1 1 1 0 0 columns 97 through 108 1 1 0 1 1 1 0 1 1 1 0 1 columns 109 through 120 1 1 0 0 1 0 1 1 1 0 0 1 columns 121 through 132 0 1 1 1 0 1 0 0 0 0 1 0 columns 133 through 144 0 0 0 1 0 0 0 0 0 0 0 0 columns 145 through 156 0 0 0 0 0 0 0 1 0 0 1 0 columns 157 through 164 0 1 0 0 0 1 1 0(二)选做任务:单频正弦波模拟信号的特殊数字化。按给定要求对一个单频正弦波模拟信号进行数字化。(10分)1、主要要求输入的信号幅度a 、频率f、相位p、量化电平d可变;仿真时间是02/f,抽样频率20f;杜输入正弦波信号进行非均匀量化实现,进行a,u率压缩;且a,u参数可变;输出信号要求是平顶正弦波;给出量化输出信号、抽样信号在同一图形窗口的波形;按照量化序号给出pcm二进制折叠编码,在转换成数字序列;2、 a/d转换部分的步骤单频正弦波模拟信号的抽样对其进行a,u率压缩并进行均匀量化进行消顶处理二进制折叠编码数字序列3、程序代码说明function samp1,quant1,quant2,pcm1,pcm2=a_d_2(a,f,p,d,a,u)%输入变量:a,f,p,d,a,u;%输出变量:samp1为抽样后的输入信号、quant1为a率压缩非均匀量化后的输出信号、quant2为u率压缩非均匀量化后的输出信号;%pcm1,pcm2为进行二进制折叠编码后输出;4、 a/d转换程序代码function samp1,quant1,quant2,pcm1,pcm2=a_d_6(a,f,p,d,a,u)t=0:1/(20*f):2/f;x=a*sin(2*pi*f*t+p);samp1=x/max(x); % 归一化后的抽样信号y=compand(samp1,a,1,a/compressor); %a率压缩后波形subplot(2,1,1);plot(t,samp1,m) ; %粉色为归一化后波形hold onplot(t,y,m*-) ; %压缩后的波形partition=-1:2/d:1;codebook=-1-1/d:2/d:1;indx1,quant1=quantiz(y,partition,codebook);m=min(quant1);for i=1:length(quant1) if quant1(i)=m; quant1(i)=m+2/d; end i=i+1;endhold onplot(t,quant1,b*); %量化后波形index1=indx1-1; % 量化序号pcm1=zeros(length(index1)-1);i=1;while i=length(index1) if index1(i,1)=-1; index1(i,1)=0; end i=i+1;endn=ceil(log2(d);for j=1:length(index1); %对量化序号进行调整 if index1(j,:)=2(n-1) index1(j,:)=2n/2-1-index1(j,:); else index1(j,:)=(2n)/2+(index1(j,:)-ceil(d/2); end i=i+1; endpcm1=dec2bin(index1,n); %pcm1为折叠二进制编码输出pcm11=pcm1;m1=length(pcm1);pcm111=reshape(pcm11,1,m1*n);%进行u率压缩z=compand(samp1,u,1,mu/compressor); %u率压缩后波形subplot(2,1,2)plot(t,samp1,m);hold onplot(t,z,m*-);partition=-1:2/d:1;codebook=-1-1/d:2/d:1;indx2,quant2=quantiz(z,partition,codebook);c=min(quant2);for i=1:length(quant2) if quant2(i)=c; quant2(i)=c+2/d; end i=i+1;endhold onplot(t,quant2,g*); index2=indx2-1;pcm=zeros(length(index2)-1);i=1;while i=length(index2) if index2(i,1)=-1 index2(i,1)=0; end i=i+1;endn=ceil(log2(d); for j=1:length(index2); if index2(j,:)=2(n-1) index2(j,:)=2n/2-1-index2(j,:); else index2(j,:)=(2n)/2+(index2(j,:)-ceil(d/2); end i=i+1; endpcm2=dec2bin(index2,n); %pcm2为折叠二进制编码后输出pcm22=pcm2;m1=length(pcm2);pcm222=reshape(pcm22,1,m1*n); %序列5、 测试结果samp1,quant1,quant2,pcm1,pcm2=a_d_6(4,32000,0,14,87.6,255) samp1 = columns 1 through 7 0 0.3090 0.5878 0.8090 0.9511 1.0000 0.9511 columns 8 through 14 0.8090 0.5878 0.3090 0.0000 -0.3090 -0.5878 -0.8090 columns 15 through 21 -0.9511 -1.0000 -0.9511 -0.8090 -0.5878 -0.3090 -0.0000 columns 22 through 28 0.3090 0.5878 0.8090 0.9511 1.0000 0.9511 0.8090 columns 29 through 35 0.5878 0.3090 0.0000 -0.3090 -0.5878 -0.8090 -0.9511 columns 36 through 41 -1.0000 -0.9511 -0.8090 -0.5878 -0.3090 -0.0000quant1 = columns 1 through 7 -0.0714 0.7857 0.9286 0.9286 0.9286 0.9286 0.9286 columns 8 through 14 0.9286 0.9286 0.7857 0.0714 -0.7857 -0.9286 -0.9286 columns 15 through 21 -0.9286 -0.9286 -0.9286 -0.9286 -0.9286 -0.7857 -0.0714 columns 22 through 28 0.7857 0.9286 0.9286 0.9286 0.9286 0.9286 0.9286 columns 29 through 35 0.9286 0.7857 0.0714 -0.7857 -0.9286 -0.9286 -0.9286 columns 36 through 41 -0.9286 -0.9286 -0.9286 -0.9286 -0.7857 -0.0714quant2 = columns 1 through 7 -0.0714 0.7857 0.9286 0.9286 0.9286 0.9286 0.9286 columns 8 through 14 0.9286 0.9286 0.7857 0.0714 -0.7857 -0.9286 -0.9286 columns 15 through 21 -0.9286 -0.9286 -0.9286 -0.9286 -0.9286 -0.7857 -0.0714 columns 22 through 28 0.7857 0.9286 0.9286 0.9286 0.9286 0.9286 0.9286 columns 29 through 35 0.9286 0.7857 0.0714 -0.7857 -0.9286 -0.9286 -0.9286 columns 36 through 41 -0.9286 -0.9286 -0.9286 -0.9286 -0.7857 -0.0714pcm1 =00011101111011101110111011101110111011010000011001110111011101110111011101110110000111011110111011101110111011101110110100000110011101110111011101110111011101100001 pcm2 =00011101111011101110111011101110111011010000011001110111011101110111011101110110000111011110111011101110111011101110110100000110011101110111011101110111011101100001 2合作完成部分:通信系统的建模和传输质量分析(一)基本任务:数字基带传输系统的matlab仿真实现。(20分)1、主要步骤和要求:数字基带传输系统的matlab仿真包括以下内容:单频正弦波模拟信号经过抽样(要求仿真时间从0到2/f,抽样频率为fs=20f)、均匀量化(量化电平数d可变)、pcm二进制自然编码、ami码型变换后,发送到信噪比snr可变的awgn信道,然后经过抽样判决、ami码型反变换、d/a转换(内插点数n可变)后恢复出单频正弦波模拟信号。要求给出抽样后的输入信号sampl和恢复出的输入信号re_sampl的波形图。2、程序代码及说明:function sampl,re_sampl=system_1(a,f,p,d,snr,n)%输入变量a ,f,p分别为输入信号的幅度、频率和相位,d为量化电平数,snr%为信道信噪比,n为d/a转换时的内插点数;输出变量sampl为抽样后的输入%信号,re_sampl为恢复出的输入信号。3、 数字频带传输通信系统仿真程序代码 function sampl,re_sampl=system_5(a,f,p,d,snr,fc,fd,fs,n)sampl,quant,pcm2=a_d_1(a,f,p,d);for i=1:length(pcm2); % 判断是数字还是字符 if ischar(pcm2(i)=1 pcm2(i)=str2num(pcm2(i); end i=i+1;endpsk_sig=modulat_1(pcm2,fc,fd,fs);psk_after_channel=channel_1(psk_sig,snr);adjudge_psk=adjudg_1(psk_after_channel);re_pcm=demodul_1(adjudge_psk,fc,fd,fs);re_voltag,re_sampl=d_a_1(re_pcm,d,n)% a/d*functionsampl,quant,pcm2=a_d_1(a,f,p,d) t=0:1/(20*f):2/f;sampl=a*sin(2*pi*f*t+p); c=sampl/max(sampl);partition=-1:2/d:1;codebook=-1-1/d:2/d:1;indx,quant=quantiz(c,partition,codebook);indx=indx-1;ind=zeros(length(indx),1);i=1;while i=length(indx) if indx(i,1)=-1 indx(i,1)=0 end i=i+1;enda=min(quant); %对信号消顶i=1;while i=length(quant) if quant(1,i)=a quant(1,i)=quant(1,i)+2/d end i=i+1;endsubplot(3,1,1);plot(t,c,g*-);pcm=dec2bin(indx,ceil(log2(d); %对量化后信号编码pcm1=reshape(pcm,1,length(pcm)*ceil(log2(d);for i=1:length(pcm1) pcm2(i)=str2num(pcm1(i) i=i+1;end%调制*function psk_sig=modulat_1(pcm2,fc,fd,fs)a=pcm2;psk_sig=dmod(a,fc,fd,fs,psk); %进入信道*function psk_after_channel=channel_1(psk_sig,snr);n1=length(psk_sig);psk_sig=psk_sig(:);psk_sig_a=zeros(n1,1);psk_sig_a=psk_sig_a(:); %产生列向量for i=1:n1 if ischar(psk_sig(i)=1 psk_sig_a(i)=str2num(psk_sig(i); else psk_sig(i)=psk_sig(i); endendpsk_after_channel=awgn(psk_sig,snr);%抽样判决*function adjudge_psk=adjudg_1(psk_after_channel)n2=length(psk_after_channel);adjudge_psk=zeros(1,n2);for i=1:n2 if ischar(psk_after_channel)=1 psk_after_channel(i)=str2num(psk_after_channel); endendfor i=1:n2 if round(psk_after_channel(i)=1 adjudge_psk(i)=1; elseif round(psk_after_channel(i)=0 adjudge_psk(i)=0; else adjudge_psk(i)=-1; end end%解调*function re_pcm=demodul_1(adjudge_psk,fc,fd,fs) for i=1:length(adjudge_psk) if ischar(adjudge_psk(i)=1 adjudge_psk=str2num(adjudge_psk(i); end endre_pcm=ddemod(adjudge_psk,fc,fd,fs,psk,2);% d/a*function re_voltag,re_sampl=d_a_1(re_pcm,d,n)for i=1:length(re_pcm) if ischar(re_pcm(i)=1; re_pcm(i)=str2num(re_pcm(i); endendn=ceil(log2(d); for i=2:n if rem(length(re_pcm),n); k=rem(length(re_pcm),n); b=zeros(1,(n-k); re_pcm1=re_pcm,b; else re_pcm1=re_pcm; endendre_pcm1=re_pcm1(:);m=ceil(length(re_pcm1)/n); for i=1:m a=re_pcm1(i-1)*n+1:(i-1)*n+n); c=reshape(a,1,n); e=fliplr(c); sum=0; for j=1:n sum=sum+e(j)*2(j-1); v(i)=sum; endends=2/d;for i=1:m re_voltag(i)=(v(i)*s+s/2-1); endfor i=1:length(re_voltag) re_sampl(i-1)*(n+1)+1)=re_voltag(i); for k=2:n re_sampl(i-1)*(n+1)+k)=0; endend h1=zeros(1,n);for j=1:n h1(j)=j/(n+1);endh=0,h1,1,fliplr(h1),0; h=h(:);re_sampl=conv(h,re_sampl);subplot(3,1,2);plot( re_voltag,m-*);subplot(3,1,3)plot(re_sampl,k*);4、 测试信号: sampl,re_sampl=system_5(4,32000,0,15,30,3200,1600,12800,8)sampl = columns 1 through 7 0 1.2361 2.3511 3.2361 3.8042 4.0000 3.8042 columns 8 through 14 3.2361 2.3511 1.2361 0.0000 -1.2361 -2.3511 -3.2361 columns 15 through 21 -3.8042 -4.0000 -3.8042 -3.2361 -2.3511 -1.2361 -0.0000 columns 22 through 28 1.2361 2.3511 3.2361 3.8042 4.0000 3.8042 3.2361 columns 29 through 35 2.3511 1.2361 0.0000 -1.2361 -2.3511 -3.2361 -3.8042 columns 36 through 41 -4.0000 -3.8042 -3.2361 -2.3511 -1.2361 -0.0000re_sampl = columns 1 through 7 0 0 0 0 0 0 0 columns 8 through 14 0 0 0 0.0296 0.0593 0.0889 0.1185 columns 15 through 21 0.1481 0.1778 0.2074 0.2370 0.2667 0.2963 0.3259 columns 22 through 28 0.3556 0.3852 0.4148 0.4444 0.4741 0.5037 0.5333 columns 29 through 35 0.5630 0.5926 0.6222 0.6519 0.6815 0.7111 0.7407 columns 36 through 42 0.7704 0.8000 0.8148 0.8296 0.8444 0.8593 0.8741 columns 43 through 49 0.8889 0.9037 0.9185 0.9333 0.9333 0.9333 0.9333 columns 50 through 56 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 columns 57 through 63 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 columns 64 through 70 0.9333 0.9185 0.9037 0.8889 0.8741 0.8593 0.8444 columns 71 through 77 0.8296 0.8148 0.8000 0.7704 0.7407 0.7111 0.6815 columns 78 through 84 0.6519 0.6222 0.5926 0.5630 0.5333 0.5037 0.4741 columns 85 through 91 0.4444 0.4148 0.3852 0.3556 0.3259 0.2963 0.2667 columns 92 through 98 0.2370 0.2074 0.1778 0.1481 0.1185 0.0889 0.0593 columns 99 through 105 0.0296 0 -0.0296 -0.0593 -0.0889 -0.1185 -0.1481 columns 106 through 112 -0.1778 -0.2074 -0.2370 -0.2667 -0.2963 -0.3259 -0.3556 columns 113 through 119 -0.3852 -0.4148 -0.4444 -0.4741 -0.5037 -0.5333 -0.5630 columns 120 through 126 -0.5926 -0.6222 -0.6519 -0.6815 -0.7111 -0.7407 -0.7704 columns 127 through 133 -0.8000 -0.8148 -0.8296 -0.8444 -0.8593 -0.8741 -0.8889 columns 134 through 140 -0.9037 -0.9185 -0.9333 -0.9333 -0.9333 -0.9333 -0.9333 columns 141 through 147 -0.9333 -0.9333 -0.9333 -0.9333 -0.9333 -0.9333 -0.9333 columns 148 through 154 -0.9333 -0.9333 -0.9333 -0.9333 -0.9333 -0.9333 -0.9333 columns 155 through 161 -0.9185 -0.9037 -0.8889 -0.8741 -0.8593 -0.8444 -0.8296 columns 162 through 168 -0.8148 -0.8000 -0.7704 -0.7407 -0.7111 -0.6815 -0.6519 columns 169 through 175 -0.6222 -0.5926 -0.5630 -0.5333 -0.5037 -0.4741 -0.4444 columns 176 through 182 -0.4148 -0.3852 -0.3556 -0.3259 -0.2963 -0.2667 -0.2370 columns 183 through 189 -0.2074 -0.1778 -0.1481 -0.1185 -0.0889 -0.0593 -0.0296 columns 190 through 196 0 0.0296 0.0593 0.0889 0.1185 0.1481 0.1778 columns 197 through 203 0.2074 0.2370 0.2667 0.2963 0.3259 0.3556 0.3852 columns 204 through 210 0.4148 0.4444 0.4741 0.5037 0.5333 0.5630 0.5926 columns 211 through 217 0.6222 0.6519 0.6815 0.7111 0.7407 0.7704 0.8000 columns 218 through 224 0.8148 0.8296 0.8444 0.8593 0.8741 0.8889 0.9037 columns 225 through 231 0.9185 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 columns 232 through 238 0.9333 0.9333 0.9333 0.9333 0.9333

温馨提示

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

评论

0/150

提交评论