资源简介
这是一个有关qpsk的beamforming的代码程序,可以通过它得到波束成形和不波束成形的对比图,有利于学习beamforming
代码片段和文件信息
% BER for QPSK modulation in a Rayleigh fading channel using multiple taps Taps
%with and without transmit beamforming
clear
N = 10^5% number of bits
% Transmitter
ip = (2*(rand(1N)>0.5)-1) + j*(2*(rand(1N)>0.5)-1); %symbols or constellation points
s = (1/sqrt(2))*ip; % normalization of energy to 1
Th=input(‘Enter the number of Channel Taps :‘);%take input from user 1234....
Eb_N0_dB = [0:35]; % multiple Eb/N0 values
for ii = 1:length(Eb_N0_dB)
n = 1/sqrt(2)*[randn(1N) + j*randn(1N)]; % white gaussian noise
h =1/sqrt(2)*[randn(ThN) + j*randn(ThN)]; % Rayleigh fading channel
signal = (1/sqrt(Th))*kron(ones(Th1)s);
% Channel and noise Noise addition
phase= exp(j*angle(h));%calculate the phase of channel
phase_conjugate=conj(phase);%conjugate of phase
bf_ch= h.*phase_conjugate;
y1 = sum(h.*signal1) + 10^(-Eb_N0_dB(ii)/20)*n; %signal received without Beamforming
y2 = sum(bf_ch.*signal1) + 10^(-Eb_N0_dB(ii)/20)*n; %receivd with Beamforming
% Receiver side-Equalization
y1Hat = y1./sum(h1);
y2Hat = y2./sum(bf_ch1);
y_re1 = real(y1Hat); % real
y_im1 = imag(y1Hat); % imaginary
ipHat1(find(y_re1 < 0 & y_im1 < 0)) = -1 + -1*j;
ipHat1(find(y_re1 >
- 上一篇:同步电机MATLAB仿真模型
- 下一篇:自抗扰控制器 simuli
nk
评论
共有 条评论