通信算法之131:无线通信-混频上下变频

读者1/2代码:

% 内插-->基带成型滤波-->正交上变频-->AWGN-->正交下变频-->匹配滤波




% 调制-->跳频-->信道-->解跳-->解调-->误码分析
% 企鹅号:1279682290。欢迎沟通交流。

clc;
clear;
close all;

M_binary = log2(64);      % 64QAM 中每个符号传输的比特数
Rs=Rb/M_binary;         % 符号速率(bps)
Tb=1/Rs;                % 符号周期(s)
fc=10e6;                % 载频   (Hz)
fs=40e6;                % 采样频率(Hz)
Ts=1/fs;                % 采样周期(s)
Interpolate_N=Tb/Ts;     % 内插倍数(调制器每个符号的采样点数)
root_squre_rolloff=0.4;    %根升余弦滤波器滚降系数
SNR = 30;              % 发送信噪比(dB) 
Interpolate_reci = 6;      % 内插倍数(解调器每个符号的采样6个点)
Decimation_N = (fs/Rs)/Interpolate_reci ;    % 抽取倍数(解调器每个符号的采样6个点)
N_transbit =3e4;                        % 发送的信息数
N_symbol = N_transbit / M_binary;         % 发送的符号数 

%--根升余弦滤波器系数---------
root_squre_rolloff_filter_coeffi= firrcos(32,Rs ,root_squre_rolloff,fs,'rolloff','sqrt'); 

%--内插----------------------
for k=1:N_symbol           
    baseband_signal_Interpolation_real((k-1)*Interpolate_N + 1 : k *Interpolate_N) = Constel_code_mapping_real(k);
    baseband_signal_Interpolation_imag((k-1)*Interpolate_N + 1 : k *Interpolate_N) = Constel_code_mapping_imag(k);
end

%--基带信号成型滤波-----------------
baseband_signal_shape_real=filter(root_squre_rolloff_filter_coeffi, 1 , baseband_signal_Interpolation_real);
baseband_signal_shape_imag=filter(root_squre_rolloff_filter_coeffi, 1 , baseband_signal_Interpolation_imag);

%--混频-正交调制--------------------
k = 1 : N_symbol * Interpolate_N;
Modulation_64QAM_ini = baseband_signal_shape_real.*cos(2*pi*fc*k*Ts)- baseband_signal_shape_imag.*sin(2*pi*fc*k*Ts);       

Modulation_64QAM_trans = awgn(Modulation_64QAM_ini,SNR,'measured') ;

% rootfilter_fre =0:1/32: 1;
% figure;
% plot(rootfilter_fre,20*log10(abs(fft(root_squre_rolloff_filter_coeffi))));
% freqz(root_squre_rolloff_filter_coeffi)
% figure;plot(abs(fft(Modulation_64QAM_ini)));
% title('发射的64QAM频谱图');

%--正交下变频-------------------------
Modulation_64QAM = Modulation_64QAM_trans;
fci=fc;%接收机本地载波频率
k=1:length(Modulation_64QAM);

reci_i = Modulation_64QAM.*cos(2*pi*fci*k*Ts);
reci_q = -Modulation_64QAM.*sin(2*pi*fci*k*Ts);

%--匹配滤波------------------------------  
base_matched_filtering_i= filter(root_squre_rolloff_filter_coeffi,1,reci_i);      
base_matched_filtering_q=filter(root_squre_rolloff_filter_coeffi,1,reci_q);

%--符号定时-------------------------------

你可能感兴趣的:(无线通信基带处理算法,软件无线电,MATLAB仿真,算法,matlab,5G)