赞
踩
说明:1K正弦波调制30KHz的载波
取10ms,240个采样点,采样频率为24000
sample=24000; %采样频率
SIZE=240; %10ms数据为240个点
SIZE2=1200; %240个点五倍插值后
j=1:SIZE;
freq=1000;
y_1k=sin(2*pi*freq*j/sample);
t=j/sample;
subplot 221
plot(t,y_1k);
title('1K正弦波')
对240个点进行5倍插值,链接: 原理链接如下,需要的自取:
代码如下:
len=SIZE; y_cha=zeros(1,SIZE+7); y_cha(SIZE+7)=0; y_cha2=zeros(1,SIZE2); coffe0=0.154830207920112*5, coffe1=0.147009839249942*5, coffe2=0.125337104718526*5, coffe3=0.094608021712450*5, coffe4=0.061139668733940*5, coffe5=0.030930241474728*5, coffe6=0.008127364075467*5, coffe7=-0.005711418466492*5, coffe8=-0.011436697663118*5, coffe9=-0.011435901979223*5, coffe10=-0.008517719961896*5, coffe11=-0.004993842265637*5, coffe12=-0.002219513516004*5, coffe13=-0.000610415386896*5, coffe14=0.000034684251061*5, coffe15=0.000140032519269*5; i=1; for i=1:1:8 y_cha(1,i) = y_cha(1,240 + i); for i=1:1:240 y_cha(1,i+8) = y_1k(1,i); end end for i = 0:1:(len-1) y_cha2(5*i+1) = coffe0*y_cha(i+3+1) + (coffe5*y_cha(i+2+1)) + (coffe5*y_cha(i+4+1)) + (coffe10*y_cha(i+1+1)) + (coffe10*y_cha(i+5+1)) + (coffe15*y_cha(i+1)) + (coffe15*y_cha(i+6+1)); y_cha2(5*i+1+1) = coffe1*y_cha(i+3+1) + (coffe6*y_cha(i+2+1)) + (coffe4*y_cha(i+4+1)) + (coffe11*y_cha(i+1+1)) + (coffe9*y_cha(i+5+1)) + (coffe14*y_cha(i+6+1)); y_cha2(5*i+2+1) = coffe2*y_cha(i+3+1) + (coffe7*y_cha(i+2+1)) + (coffe3*y_cha(i+4+1)) + (coffe12*y_cha(i+1+1)) + (coffe8*y_cha(i+5+1)) + (coffe13*y_cha(i+6+1)); y_cha2(5*i+3+1) = coffe3*y_cha(i+3+1) + (coffe8*y_cha(i+2+1)) + (coffe2*y_cha(i+4+1)) + (coffe13*y_cha(i+1+1)) + (coffe7*y_cha(i+5+1)) + (coffe12*y_cha(i+6+1)); y_cha2(5*i+4+1) = coffe4*y_cha(i+3+1) + (coffe9*y_cha(i+2+1)) + (coffe1*y_cha(i+4+1)) + (coffe14*y_cha(i+1+1)) + (coffe6*y_cha(i+5+1)) + (coffe11*y_cha(i+6+1)); end subplot 222 plot((1:SIZE2)/(5*sample),y_cha2) title('插值后的正弦波')
一个周期1K正弦波对应120个点,以4个点为一周期进行AM调制,其载波频率为1K*(120/4)=30KHz
y2=zeros(1,SIZE2);
for i=1:1:SIZE2
if (rem(i,4) == 0)
y2(i) = (1+0.85*y_cha2(i));
elseif (rem(i,4) == 1)
y2(i) = 0;
elseif (rem(i,4) == 2)
y2(i) = -(1+0.85*y_cha2(i));
elseif (rem(i,4) == 3)
y2(i) = 0;
end
end
subplot 223
plot((1:SIZE2)/(5*sample),y2)
title('AM调制波')
解调结果=根号(I(n)*I(n)+Q(n)*Q(n)),I(n)已知,Q(n)用拉格朗日插值法得出
因为AM正交调制是分IQ两路,解调部分也是如此,但是只能得到I(n),Q(n+1),I(n+2),Q(n+3)…
实际上解调序列就是一个相互间隔、交替出现的IQ序列,但IQ值在时间上正交的,如下所示:
因此需要拉格朗日插值算法插值得出Q(n)
具体插值计算过程可以通过链接: 传送门看看我以前写的
y_demo=zeros(1,1208);
y_demo2=zeros(1,240);
for i=1:1:SIZE2
y_demo(i+7) = y2(i);
end
for i=1:1:240
rssi=y_demo(1+5*i)*y_demo(1+5*i) + 0.00390625*(9*(y_demo(2+5*i)-y_demo(5*i))+y_demo(4+5*i)-y_demo(i*5-2)) * (9*(y_demo(2+5*i)-y_demo(5*i))+y_demo(4+5*i)-y_demo(i*5-2));
y_demo2(i)=sqrt(rssi);
end
subplot 224
plot((1:240)/sample,y_demo2)
title('AM解调波')
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。