⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 par_to_ser.m

📁 使用matlab程序实现了由随机序列到码元电平、m序列直接扩频解扩、qpsk调制解调
💻 M
字号:
function [z,a,b,y1,y2,m]=par_to_ser(x,N,g)
N=20;                                  %随机数点数20
td=0.1;
f0=3000;
wc=2e4*pi;
g=100;

x=randint(1,N,[0,1]);
z=reshape(x,2,N/2);                    %并串转换
a=z(1,:);
b=z(2,:);
figure(1);
subplot(311);
stem(x,'LineWidth',1.5);grid on;
subplot(312);
stem(a,'LineWidth',1.5);grid on;
subplot(313);
stem(b,'LineWidth',1.5);grid on;

y1=dpxs(g,a);                          %I通道脉冲形式
y2=dpxs(g,b);                          %Q通道脉冲形式
connections =[1 0 0 1]; 
mseq = m_sequence(connections);        %m序列
m=dpxs(100,mseq); 
figure(2);
subplot(311);
t=linspace(0,td,length(y1));
plot(t,y1,'LineWidth',1.5);grid on;
title('I Channel');
axis([0 td -1.5 1.5]);                 %画I通道电平 
subplot(312);
t=linspace(0,td,length(y2));
plot(t,y2,'LineWidth',1.5);grid on;
title('Q Channel');
axis([0 td -1.5 1.5]);                 %画Q通道电平
subplot(313);
t=linspace(0,(td*2)/N,length(m)); 
plot(t,m,'LineWidth',1.5);grid on;
title('m sequence pulse'); 
axis([0 td -1.5 1.5]);                 %画m序列电平

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -