300字范文,内容丰富有趣,生活中的好帮手!
300字范文 > 64qam星座图matlab 16QAM_星形和矩形星座图调制解调MATLAB代码(最新整理)

64qam星座图matlab 16QAM_星形和矩形星座图调制解调MATLAB代码(最新整理)

时间:2021-08-05 01:59:17

相关推荐

64qam星座图matlab 16QAM_星形和矩形星座图调制解调MATLAB代码(最新整理)

《16QAM_星形和矩形星座图调制解调MATLAB代码(最新整理)》由会员分享,可在线阅读,更多相关《16QAM_星形和矩形星座图调制解调MATLAB代码(最新整理)(8页珍藏版)》请在人人文库网上搜索。

1、 %软件无线电课程设计%方形、星形 16QAM 调制解调仿真%-%主程序clcclear% 定义参数fd=250*106;%码元速率 250Mfs=2500*106;%滤波器采样率fc=2500*106;%载波频率 2.5Gf=10000*106;%对载波采样data_len=200000;%数据长度sym_len=data_len/4; %码元序列长度M_QAM=16;%QAM 数k=log2(M_QAM); SNR=1:12;%白噪声信噪比,% bit_tx=randint(1,data_len);%产生随机序列echo off;rec_qam16=QamMod(bit_tx,16);%方。

2、形 16QAM 调制star_qam16=SrarQamMod(bit_tx);%星形 16QAM 调制base_rec=base_shape(fd,fs,f,rec_qam16);%基带成型滤波base_star=base_shape(fd,fs,f,star_qam16);%基带成型滤波for i=1:length(SNR)%信噪比从 1dB 到 12dB 计算误码率SNR_=i%方形映射 16QAMrf_rec_qam16=CarrierMod(fc,f,base_rec);%载波调制rf_rec_qam16_n=awgn(rf_rec_qam16,SNR(i),measured);% 。

3、加 噪 声 rec_qam16_rx base_rec_rx=CarrierDemod(fd,fs,fc,f,rf_rec_qam16_n);%载波解调bit_rec_rx=QamDemod(rec_qam16_rx,16);%MQAM 解调num_qam16,perr_qam16_rec(i)=biterr(bit_tx,bit_rec_rx);%误码率qam16_data_rec(i,:)=rec_qam16_rx;%scatterplot(rec_qam16_rx);%星形映射 16QAMrf_star_qam16=CarrierMod(fc,f,base_star);%载波调制rf_s。

4、tar_qam16_n=awgn(rf_star_qam16,SNR(i),measured);%加噪声star_qam16_rx base_star_rx=CarrierDemod(fd,fs,fc,f,rf_star_qam16_n);%载波解调bit_star_rx=StarQamDemod(star_qam16_rx);%MQAM 解调num_qam16,perr_qam16_star(i)=biterr(bit_tx,bit_star_rx);%误码率qam16_data_star(i,:)=star_qam16_rx;%scatterplot(star_qam16_rx);end%。

5、 理论误码率计算SNRtheo=0:0.1:length(SNR); for i=1:length(SNRtheo)SNRdec=10.(SNRtheo(i)/10); theo_perr_qam16(i)=(3/8)*erfc(sqrt(SNRdec*2/5);end% 基带波形N=200; n=1:N; t=1:N*10;%发送端波形figure;stem(n,bit_tx(n);title(发送序列);%发送序列figure(Name,发送端基带信号); subplot(411);plot(t,real(base_rec(t);title(方形映射-Q 路); subplot(412);。

6、plot(t,imag(base_rec(t);title(方形映射-I 路); subplot(413);plot(t,real(base_star(t);title(星形映射-Q 路); subplot(414);plot(t,imag(base_star(t);title(星形映射-I 路);%接收端波形figure; subplot(211);stem(n,bit_rec_rx(n);title(方形接收序列); subplot(212);stem(n,bit_star_rx(n);title(星形接收序列); figure(Name,接收端基带信号);subplot(411);plo。

7、t(t,real(base_rec_rx(t);title(方形映射-Q 路); subplot(412);plot(t,imag(base_rec_rx(t);title(方形映射-I 路); subplot(413);plot(t,real(base_star_rx(t);title(星形映射-Q 路); subplot(414);plot(t,imag(base_star_rx(t);title(星形映射-I 路);%基带眼图N1=20000;Tn=f/fd; eye_rex=base_rec(1:N1);eyediagram(eye_rex,Tn*4,Tn);title(方形基带眼图)。

8、; eye_star=base_star(1:N1); eyediagram(eye_star,Tn*4,Tn);title(星形基带眼图);% 接收端星座图%scatterplot(qam16_data_rec(12,:); figure(Name,方形 16QAM 接收端星座图); for i=3:3:12subplot(2,2,i/3); plot(real(qam16_data_rec(i,:),imag(qam16_data_rec(i,:),.); xmax=5;axis(-xmax xmax -xmax xmax) title(Snr=,num2str(SNR(i), dB);e。

9、ndfigure(Name,星形 16QAM 接收端星座图); for i=3:3:12subplot(2,2,i/3); plot(real(qam16_data_star(i,:),imag(qam16_data_star(i,:),.); xmax=3;axis(-xmax xmax -xmax xmax)grid on; title(Snr=,num2str(SNR(i), dB);end% 功率谱密度f_plot;% 误码率分析%16QAM 误码率曲线figure(Name,16QAM 误码性能对比);% semilogy(SNRtheo,theo_perr_qam16);% hol。

10、d on; semilogy(SNR,perr_qam16_rec,*); hold on; semilogy(SNR,perr_qam16_star,o); xlabel(SNR in dB);ylabel(Prb of Err);legend(方形 16QAM,星形 16QAM); title(16QAM 误码性能对比);%-% 基带成型function base_info=base_shape(fd,fs,f,seq_16QAM)%平方根升余弦滤波器,滚降系数 0.5,延迟 3 个采样点flt=rcosine(fd,fs,sqrt,0.5);%I 路和 Q 路seq_Q=real(seq。

11、_16QAM); seq_I=imag(seq_16QAM);%增采样R=fs/fd;up_seq_Q=upsample(seq_Q,R); up_seq_I=upsample(seq_I,R);%升余弦调制rcos_Q=conv(up_seq_Q,flt); rcos_I=conv(up_seq_I,flt);%提升rcos_Q_up=interp(rcos_Q,f/fs); rcos_I_up=interp(rcos_I,f/fs);base_info=rcos_Q_up+j*rcos_I_up;%-% 载波解调function data_rx base_rx=CarrierDemod(f。

12、d,fs,fc,f,receive)% 分两路乘正交高频载波rc_length=length(receive); flt=rcosine(fd,fs,sqrt,0.5);t=0:rc_length-1;rc_Q=receive .* sin(2*pi*fc*t/f); rc_I=receive .* cos(2*pi*fc*t/f);%减采样后根升余弦匹配滤波,注意对齐采样点down_Q=downsample(0 rc_Q,f/fs); down_I=downsample(rc_I,f/fs); low_Q_rcos=conv(down_Q,flt); low_I_rcos=conv(down。

13、_I,flt); base_rx=low_Q_rcos(1:length(low_I_rcos)+j*low_I_rcos;%两次根升余弦滤波延迟,定位初始信号位置%delay+1:end-delay-1 R=fs/fd; delay=3*R*2;rc_Q_seq=(downsample(low_Q_rcos(delay+1:end-delay-1),R); rc_I_seq=(downsample(low_I_rcos(delay+1:end-delay-1),R);%类型转换data_rx=rc_Q_seq+j*rc_I_seq;%-% 载波调制function transmit=Carr。

14、ierMod(fc,f,base)%载波调制t=0:length(base)-1;high_freq_Q=real(base) .* sin(2*pi*fc*t/f); high_freq_I=imag(base) .* cos(2*pi*fc*t/f);transmit=high_freq_Q+high_freq_I;%-%QAM 解调程序,将 MQAM 码元还原为二进制数据%入口参数:data_QAM:QAM 码元数据%M_QAM:MQAM 中 M 的大小%出口参数:二进制数据比特流%-function data_out=QamDemod(data_QAM,M_QAM)k=log2(M_Q。

15、AM);%每个 M 进制码元的 bit 数data_len=length(data_QAM);%码元长度%-%QAM 信号放缩至与发送端相同比例data_temp=data_QAM(find(real(data_QAM0); aver=mean(real(data_temp); data_Qam_temp=data_QAM/aver*(2(k/2-1);%-%平移到第一象限data_Qam_temp2=(data_Qam_temp+(2(k/2)-1)*(1+j)/2;%-%将实部虚部分别映射为二进制数据%实部data_real=round(real(data_Qam_temp2);%实部判决。

16、data_real(find(data_real(2(k/2)-1)=2(k/2)-1;%大于 2(k/2)-1 的数据判定为 2(k/2)-1 data_real(find(data_real(2(k/2)-1)=2(k/2)-1;%大于 2(k/2)-1 的数据判定为 2(k/2)-1 data_imag(find(data_imag2)=2;%幅度大于 2 的判定为 2am(find(am7)=0; data_dec=8*(round(am)-1)+ang_n;%data_dec(find(data_dec15)=15;%大于 15 的判定为 15%data_dec(find(data_。

17、dec0)=0;%小于 0 的判定为 0 data_bit_rec=dec2bin(data_dec); data_bit=reshape(data_bit_rec,1,length(qam_rev)*4)-0;“”“”At the end, Xiao Bian gives you a passage. Minand once said, people who learn to learn are very happy people. In every wonderful life, learning is an eternal theme. As a professional clerica。

18、l and teaching position, I understand the importance of continuous learning, life is diligent, nothing can be gained, only continuous learning can achieve better self. Only by constantly learning and mastering the latest relevant knowledge, can employees from all walks of life keep up with the pace of enterprise development and innovate to meet the needs of the market. This document is also edited by my studio professionals, there may be errors in the document, if there are errors, please correct, thank you。

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。