clear all; close all; fprintf( '\n OFDM 仿真\n \n') ; % --------------------------------------------- % % 参数定义 % % --------------------------------------------- % IFFT_bin_length = 1024; carrier_count = 200; bits_per_symbol = 2; symbols_per_carrier = 50; % 子载波数 200 % 位数/ 符号 2 % 符号数/ 载波 50 % 训练符号数 10 % 循环前缀长度 T/4(作者注明) All-zero CP % 调制方式 QDPSK % 多径信道数 2、3、4(缺省) % 信道最大时延 7 (单位数据符号) % 仿真条件 收发之间严格同步 %SNR=input('SNR='); % 输入信噪比参数 SNR=3:14;%定义信噪比范围 BER=zeros(1,length(SNR)); baseband_out_length = carrier_count * symbols_per_carrier * bits_per_symbol;% 计算发送的二进制序列长度 carriers = (1: carrier_count) + (floor(IFFT_bin_length/4) - floor(carrier_count/2)); % 坐标: (1 to 200) + 156 , 157 -- 356 conjugate_carriers=IFFT_bin_length-carriers+2; % 坐 标 : 1024 - (157:356) + 2 = 1026 - (157:356) = (869:670) % 构造共轭时间-载波矩阵,以便应用所谓的 RCC,Reduced Computational Complexity 算法,即 ifft 之后结果为实数 % Define the conjugate time-carrier matrix % 也可以用 flipdim 函数构造对称共轭矩阵 % --------------------------------------------- % % 信号发射 % % --------------------------------------------- % %out = rand(1,baseband_out_length); %baseband_out1 = round(out) ; %baseband_out2 = floor(out*2) ; %baseband_out3 = ceil(out*2)-1 ; %baseband_out4 = randint(1,baseband_out_length); % 四种生成发送的二进制序列的方法,任取一种产生要发送的二进制序列 %if (baseband_out1 == baseband_out2 & baseband_out1 == baseband_out3 ) % fprintf('Transmission Sequence Generated \n \n'); % baseband_out = baseband_out1 ; %else % fprintf('Check Code \n \n'); %end % 验证四种生成发送的二进制序列的方法 baseband_out=round( rand(1,baseband_out_length)); convert_matrix = reshape(baseband_out,bits_per_symbol,length(baseband_out)/...