%以下为手动编程方法,也可调用matlab集成函数dmod,具体调制方式见doc.
n = [0:0.01:5.99];
x1 = ones(1,100);
x2 = zeros(1,100);
x3 = [x1,x2,x1,x2,x1,x2];
fc = 5;
Wask = cos(2pifcn);
Yask = x3.Wask;
subplot(3,1,1);
plot(n, Yask);
hold on;
plot(n,x3,'r','LineWidth',2);
title('BASK');
grid on ;
fc1 = 5;
fc2 = 1;
x4 = [x2,x1,x2,x1,x2,x1];
Wfsk1 = cos(2pifc1n);
Wfsk2 = cos(2pifc2n);
Yfsk1 = x3.Wfsk1;
Yfsk2 = x4.Wfsk2;
Yfsk = Yfsk1 + Yfsk2;
subplot(3,1,2);
plot(n, Yfsk);
hold on;
plot(n,x3,'r','LineWidth',2);
title('BFSK');
grid on;
x5 = [x1, -x1, x1, -x1, x1, -x1];
fc3 = 1;
Wpsk = cos(2pifc3n);
Ypsk = x5.Wpsk;
subplot(3,1,3);
plot(n, Ypsk);
hold on;
plot(n,x3,'r','LineWidth',2);
title('BPSK');
grid on;
%调制波形如下: