www.pudn.com > TCM_Modulation.rar > TCM_Modulation.m, change:2007-08-10,size:1266b


%%网格编码(TCM)调制端仿真
%%第一部分:突发数据加帧
src=zeros(1,176);
Sync_slot0=[1,0,0,1,1,1,0,0,1,1,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,1,1,1,1,0,1,0,0,1,0,0,1,1,1,0,0,1,1,1,1,1,1];
data_frame=randint(1,128);
src=[Sync_slot0 data_frame];
%%第二部分:卷积编码(3,2,3)
trellis = poly2trellis([2 3],[0 2 1;2 1 4]);
cnv_enc_out = convenc(src,trellis)
%%8PSK符号映射
R=reshape(cnv_enc_out,3,length(cnv_enc_out)/3);
B2D=bi2de(R','left-msb')+1;    
Temp=[0.9329+0.3827i  0.3827+0.9329i  -0.3827+0.9329i  -0.9329+0.3827i
     -0.9329-0.3827i  -0.3827-0.9329i  0.3827-0.9329i  0.9329-0.3827i];
for i=1:length(cnv_enc_out)/3
    symbol_out(i)=Temp(B2D(i));
    symbol_I(i)=real(symbol_out(i))*1024;
    symbol_Q(i)=imag(symbol_out(i))*1024;
end
%%成形滤波z
x=rcosflt(symbol_I,1,8,'fir/sqrt',0.35);
y=rcosflt(symbol_Q,1,8,'fir/sqrt',0.35);
x=x';
y=y';
plot(x);
title('成形滤波后的I路输出');
figure;
plot(y);
title('成形滤波后的Q路输出');
figure;
%%乘加调制
F = input('输入采样率为 : ');
Fs = input('输出采样率为 :');
N=length(x);
for j =1:N-8
I = x(j)*sqrt(2*F)*cos(2*pi*F/Fs*[0:(Fs/F)]);
Q = y(j)*sqrt(2*F)*sin(2*pi*F/Fs*[0:(Fs/F)]);
end
plot(I);
title('TCM-8PSK调制信号的I路');
figure;
plot(Q);
title('TCM-8PSK调制信号的Q路');
figure;
s=I-Q;
plot(s)
title('TCM-8PSK调制信号');