% 系统子载波数为 64,调制方式为 16—QAM,前缀长度为 16,多径信道时延分别为 0、8 和 20 采样点,各径功率相等
仿真比较 OFDM 系统空白前缀与循环% 前缀支考虑前 2 径信道和 3 径信道下的性能clcclearN=64; % 系统子载波数x=randint(N,2,[0 15]); % 2 个符号周期的数据x1=qammod(x,16); % 16—QAM 调制x2=ifft(x1); %IFFTx3=[zeros(16,2);x2]; % 空白前缀x4=[x2(49:end,:);x2]; % 循环前缀x3=reshape(x3,1,160); % 并串变换x4=reshape(x4,1,160);h=sqrt(1/3)*(randn(1,3)); % 3 径信道y1=x3*h(1)+[zeros(1,8) x3(1:end-8)*h(2)]; % 只考虑前 2 径y2=x4*h(1)+[zeros(1,8) x4(1:end-8)*h(2)];y3=reshape(y1,80,2); % 串并转换y4=reshape(y2,80,2);y3=y3(17:end,2); % 只考虑第 2 个符号的影响y4=y4(17:end,2);y3=fft(y3); % FFTy4=fft(y4);h1=[h(1) zeros(1,7) h(2)]; % 信道 FFT 变换H=fft(h1,N)
';y3=y3
/H; % 信道均衡y4=y4
/H;stem(abs(x1(:,2)),’fill’);hold on;stem(abs(y3),'r〈');stem(abs(y4),'—gs’);legend(’原始信号',’空白前缀’,’循环前缀')axis([0 70 0 max(abs(y3))+2]);title(’2 径信道结果’)y1=y1+[zero