Matlab实现QPSK调制解调

https://blog.csdn.net/wxr308/article/details/104944488

以上是使用C++语言完成的QAM调制解调,这个是为了验证QAM解调是否正确采用的练习Matlab程序

仅是验证是否能够成功解调,所以没有设置可以输入的数据。

fre = 2000;
fre_Flo = fre * pi;
sam_Fre = fre * 10;
all_Sig = fre * x * 10;

car_Num = 10;
car_Sam = 10;
code_Num = car_Num * car_Sam;

code_Len=20;

len=code_Len*code_Num;
time=len/sam_Fre;
po=1/sam_Fre;

x=0:po:time;
y=0:po:time;

for i=1:1:len/4
    y(i)=cos(4000*pi*x(i));
end

for i=len/4+1:1:len/2
    y(i)=cos(4000*pi*x(i)+pi/2);
end

for i=len/2+1:1:len/4*3
    y(i)=cos(4000*pi*x(i)+pi);
end

for i=len/4*3+1:1:len
    y(i)=cos(4000*pi*x(i)+pi*1.5);
end

y1=x;
y2=x;

for i=1:1:len
    y1(i)=cos(4000*pi*x(i));
end

for i=1:1:len
    y2(i)=cos(4000*pi*x(i)+pi/2);
end

yo1=x;
yo2=x;

d = designfilt('lowpassfir', ...        % Response type
       'FilterOrder',50, ...            % Filter order
       'PassbandFrequency',200, ...     % Frequency constraints
       'StopbandFrequency',350, ...
       'DesignMethod','ls', ...         % Design method
       'PassbandWeight',1, ...          % Design method options
       'StopbandWeight',2, ...
       'SampleRate',20000);              % Sample rate

for i=1:1:len
    yo1(i)=y1(i)*y(i);
end

for i=1:1:len    
    yo2(i)=y2(i)*y(i);
end

figure(1)
subplot(2,1,1)
plot(x,yo1);
subplot(2,1,2)
plot(x,yo2);

yoo1=filter(d,yo1);
yoo2=filter(d,yo2);

figure(2)
subplot(2,1,1)
plot(x,yoo1);
subplot(2,1,2)
plot(x,yoo2);

  • 0
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值