MATLAB实现2ASK,2PSK,2FSK

matlab小白,还希望多多交流~

问题描述

设二进制序列为 1011010010,画出 2ASK 2PSK 2FSK 波形

原理描述

1、2ASK
ASK即“幅移键控”又称为“振幅键控”,2ASK是二进制振幅键控。发送为二进制符号“0”时,2ASK信号取值为0;发送为二进制符号“1”时,2ASK信号取值为载波对应的值。可用下面表达式表示
在这里插入图片描述
在这里插入图片描述

2、2PSK
2PSK称为二进制相移键控,是相移键控的最简单的一种形式,它用两个初相相隔为180的载波来传递二进制信息。2PSK即发送为二进制符号“0”时,取0相位;发送为二进制符号“1”时,取π相位。或者也可以反过来。这种以载波的不同相位直接去表示相应二进制数字信号的调制方式,称为二进制绝对相移方式。
在这里插入图片描述

3、2FSK
2FSK为二进制数字频率调制(二进制频移键控),用载波的频率来传送数字信息,即用所传送的数字信息控制载波的频率。2FSK信号便是符号“0”对应于载频 f1,而符号“1”对应于载频 f2(与 f1 不同的另一载频)的已调波形,而且 f1 与 f2 之间的改变是瞬间的。传“0”信号时,发送频率为 f1 的载波; 传“1”信号时,发送频率为 f2的载波。可见,FSK 是用不同频率的载波来传递数字消息的。
在这里插入图片描述

MATLAB代码

%调制信号
y=[1 0 1 1 0 1 0 0 1 0]
t_begin=0
t_end=1
mt=0
t=0:0.01:10
for i=1:length(y)
%     t=t_begin:0.01:t_end
    if(y(i)==1)
        mt=mt+1.*(t>=t_begin&t<t_end)
    else mt=mt+0.*(t>=t_begin&t<t_end)
    end
    t_begin=t_begin+1
    t_end=t_end+1
end
figure
subplot(2,2,1)
plot(t,mt);
ylim([-0.25,1.25]);
title('调制信号')
%2ASK
y=[1 0 1 1 0 1 0 0 1 0]
t_begin=0
t_end=1
ASK=0
t=0:0.01:10
for i=1:length(y)
%     t=t_begin:0.01:t_end
    if(y(i)==1)
        ASK=ASK+sin(2*pi*t).*(t>=t_begin&t<t_end)
    else ASK=ASK+0.*(t>=t_begin&t<t_end)
    end
    t_begin=t_begin+1
    t_end=t_end+1
end
subplot(2,2,2)
plot(t,ASK);
ylim([-1.5,1.5]);
title('2ASK信号')
%2PSK
PSK=0
t_begin=0
t_end=1
for i=1:length(y)
%     t=t_begin:0.01:t_end
    if(y(i)==1)
        PSK=PSK+sin(2*pi*t).*(t>=t_begin&t<t_end)
    else PSK=PSK+sin(2*pi*t+pi).*(t>=t_begin&t<t_end)
    end
    t_begin=t_begin+1
    t_end=t_end+1
end
subplot(2,2,3)
plot(t,PSK);
ylim([-1.5,1.5]);
title('2PSK信号')
%2FSK
FSK=0
t_begin=0
t_end=1
for i=1:length(y)
%     t=t_begin:0.01:t_end
    if(y(i)==1)
        FSK=FSK+sin(4*pi*t).*(t>=t_begin&t<t_end)
    else FSK=FSK+sin(2*pi*t).*(t>=t_begin&t<t_end)
    end
    t_begin=t_begin+1
    t_end=t_end+1
end
subplot(2,2,4)
plot(t,FSK);
ylim([-1.5,1.5]);
title('2FSK信号')

结果

在这里插入图片描述

  • 38
    点赞
  • 253
    收藏
    觉得还不错? 一键收藏
  • 6
    评论
评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值