wodeqpsk.m
来自「这是基于MATLAB的数字调相技术编程,包括对调制解调过程的编程以及其有效性和可」· M 代码 · 共 34 行
M
34 行
%...assume the symbol T=1
clear all
close all
bit_in = randint(1e3, 1, [0 1]);
bit_I = bit_in(1:2:1e3);
bit_Q = bit_in(2:2:1e3);
data_in=-2*bit_in+1;
data_I = -2*bit_I+1;
data_Q = -2*bit_Q+1;
t=(1:1:1e3);
figure(1)
subplot(3,1,1);stem(t,data_in);axis([0 20 -1 1]);title('基带源信号');grid on;
t=(1:2:1e3);
subplot(3,1,2);stem(t,data_I);axis([0 20 -1 1]);title('I支路源信号');grid on;
t=(2:2:1e3);
subplot(3,1,3);stem(t,data_Q);axis([0 20 -1 1]);title('Q支路源信号');grid on;
data_in1=repmat(data_in',20,1);%data_in'为data_in的共轭转置,repmat为把data_in'重排成(20*1)的数组,
data_I1=repmat(data_I',20,1);
data_Q1=repmat(data_Q',20,1);
f1=1;
t=0:0.1:1e3;
in_rc=data_in1.*cos(2*pi*f1*t);
I_rc=data_I1.*cos(2*pi*f1*t);
Q_rc=data_Q1.*sin(2*pi*f1*t);
QPSK_rc=I_rc+(-Q_rc);
figure(2)
subplot(3,1,1);plot(t,I_rc);axis([0 le3 -3 3]);title('I支路载波调制后信号');grid on;
subplot(3,1,2);plot(t,Q_rc);axis([0 le3 -3 3]);title('Q支路载波调制后信号');grid on;
subplot(3,1,3);plot(t,QPSK_rc);axis([0 le3 -3 3]);title('QPSK已调信号');grid on;
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?