carrier_remod.m

来自「使用matlab程序实现了由随机序列到码元电平、m序列直接扩频解扩、qpsk调制」· M 代码 · 共 46 行

M
46
字号
function [liremod lif iremod iremodo lqremod lqf qremod qremodo]=carrier_remod(f0,l)
N=20;                                  %随机数点数20
td=0.1;
f0=3000;
wc=2e4*pi;
g=100;                                 %一个矩形电平采样点

t=linspace(0,td,length(l));
liremod=(-1)*sin(2*f0*pi*t).*l;        %I通道解调
[f,lif]=T2F(t,liremod);
[t,iremod]=lpf(f,lif,f0);              %经过低通滤波
iremodo=sign(iremod);                  %波形整形
lqremod=cos(2*f0*pi*t).*l;             %Q通道解调              
[f,lqf]=T2F(t,lqremod); 
[t,qremod]=lpf(f,lqf,f0);              %%经过低通滤波
qremodo=sign(qremod);                  %波形整形

t=linspace(0,td,length(l));
figure(6);
subplot(321);
plot(t,liremod,'LineWidth',1.5);
title('I remodulation');
grid on;                               %画I通路解调图
subplot(323);
plot(t,iremod,'LineWidth',1.5);
axis([0 td -0.5 0.5]);                 %画经过低通滤波后的图

t=linspace(0,td,length(liremod));
subplot(325);
plot(t,iremodo,'LineWidth',1.5);
grid on;                              
title('I remodulation over');
axis([0 td -1.5 1.5]);                %波行整形图
subplot(322);
plot(t,lqremod,'LineWidth',1.5);
title('Q remodulation');
grid on;                              %画Q通道解调图
subplot(324);
plot(t,qremod,'LineWidth',1.5);
axis([0 td -0.5 0.5]);                %画经过低通滤波后的图
t=linspace(0,td,length(lqremod));
subplot(326);
plot(t,qremodo,'LineWidth',1.5);
grid on;
title('Q remodulation over');      
axis([0 td -1.5 1.5]);                %波行整形图

⌨️ 快捷键说明

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