QPSK信号调制之ASCII码

clear;close all;clc;
sym_dec=(32:126).';
sym_bit=de2bi(sym_dec,8,'left-msb');
sym_bit=reshape(sym_bit.',1,[]);
bits = repmat(sym_bit,1,50).';
% bit2 = reshape(bits,2,[]).';
N=length(bits)/2;

M=4;
pha_qpsk = qammod(bits,M,'InputType','bit','PlotConstellation',true); % 生成相位
Fs = 65536; % 采样率
fc = 25120; % 载频
RB = 4096;
fd=Fs/RB;
alpha = 0.25;
h = rcosdesign(alpha,6,Fs/RB,'sqrt'); % 根升余弦成形
len_x = length(pha_qpsk);
xx = zeros(1,(len_x)*fd);
for i = 1:len_x
    xx((i-1)*fd+1)=pha_qpsk(i);
end
bas_qpsk = conv(xx,h,'same'); % 成形滤波
Len = N*Fs/RB;
t = 0:1/Fs:(Len-1)/Fs;
sig_qpsk_pure = bas_qpsk.*exp(1j*2*pi*(fc)*t); % 混频
sig_qpsk = 0.7*sig_qpsk_pure./max(abs(sig_qpsk_pure));
fid = fopen('QPSK_regu_32-126.mod','wb');
fwrite(fid,real(sig_qpsk),'single');
fclose(fid);

你可能感兴趣的:(编程小识,QPSK,调制,ASCII,成型滤波)