【数字信号调制】Matlab实现PCM编码和QAM调制

1 简介

基于MATLAB的QAM信号的调制与解调仿真分析

2 部分代码

%PCM编码function[out]=pcm_encode(x)n=length(x);                    %-4096<x<4096for i=1:n    if x(i)>0        out(i,1)=1;    else         out(i,1)=0;    end    if abs(x(i))>=0 & abs(x(i))<32        out(i,2)=0;out(i,3)=0;out(i,4)=0;step=2;st=0;    elseif 32<=abs(x(i)) & abs(x(i))<64        out(i,2)=0;out(i,3)=0;out(i,4)=1;step=2;st=32;    elseif 64<=abs(x(i)) & abs(x(i))<128        out(i,2)=0;out(i,3)=1;out(i,4)=0;step=4;st=64;    elseif 128<=abs(x(i)) & abs(x(i))<256        out(i,2)=0;out(i,3)=1;out(i,4)=1;step=8;st=128;    elseif 256<=abs(x(i)) & abs(x(i))<512        out(i,2)=1;out(i,3)=0;out(i,4)=0;step=16;st=256;    elseif 512<=abs(x(i)) & abs(x(i))<1024        out(i,2)=1;out(i,3)=0;out(i,4)=1;step=32;st=512;    elseif 1024<=abs(x(i)) & abs(x(i))<2048        out(i,2)=1;out(i,3)=1;out(i,4)=0;step=64;st=1024;    elseif 2048<=abs(x(i)) & abs(x(i))<4096        out(i,2)=1;out(i,3)=1;out(i,4)=0;step=128;st=2048;    else         out(i,2)=1;out(i,3)=1;out(i,4)=1;step=128;st=2048;    end        if (abs(x(i))>=4096)        out(i,2:8) = [1 1 1 1 1 1 1];    else        tmp = floor( (abs(x(i)) - st/step ) );        t = dec2bin(tmp,4) - 48;        out(i,5:8) =t(1:4);    endendout=reshape(out',1,8*n);

3 仿真结果

4 参考文献

[1]赵阳. 基于MATLAB的QAM信号的调制与解调仿真分析[J]. 数码世界, 2016(10):2.

博主简介:擅长智能优化算法、神经网络预测、信号处理、元胞自动机、图像处理、路径规划、无人机等多种领域的Matlab仿真,相关matlab代码问题可私信交流。

部分理论引用网络文献,若有侵权联系博主删除。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

matlab科研助手

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值