Tìm hiểu mô phỏng hệ thống MIMO - OFDM và đánh giá chất lượng hệ thống - 12

NA = length(ChA); % so kenh song mang


H = ChA.^2/(N0); % H la gia tri rieng/cong suat nhieu

PowerAllo = (PtotA + sum(1./H))/NA - 1./H; %cong suat tren mot kenh song mang while(any(PowerAllo < 0 )) %Tim cong suat phat tren mot kenh < 0

IndexN = find(PowerAllo <= 0 ); IndexP = find(PowerAllo > 0); MP = length(IndexP); PowerAllo(IndexN) = 0;

ChAT = ChA(IndexP); HT = ChAT.^2/(N0);

PowerAlloT = (PtotA + sum(1./HT))/MP - 1./HT; PowerAllo(IndexP) = PowerAlloT;

end

PowerAllo = (PowerAllo.');

Capacity = sum(log2(1+ PowerAllo.' .* H));

Có thể bạn quan tâm!

Xem toàn bộ 97 trang tài liệu này.

5. Không có CSI

function p_kocsi_Callback(hObject, eventdata, handles)

Tìm hiểu mô phỏng hệ thống MIMO - OFDM và đánh giá chất lượng hệ thống - 12

% hObject handle to p_kocsi (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB

% handles structure with handles and user data (see GUIDATA)

% Ergodic_Capacity_vs_SNR.m clear all, close all

SNR_dB=[0:5:20]; SNR_linear=10.^(SNR_dB/10); N_iter=10000; sq2 = sqrt(0.5);

for Icase=1:6

if Icase==1, nT=1; nR=1; % 1x1v

elseif Icase==2, nT=1; nR=2; % 1x2 elseif Icase==3, nT=2; nR=1; % 2x1

elseif Icase==4, nT=2; nR=2; % 2x2 elseif Icase==5, nT=4; nR=4; % 4x4 else nT=8; nR=8; % 8x8

end

n=min(nT,nR); I = eye(n);

C(Icase,:) = zeros(1,length(SNR_dB));

for iter=1:N_iter

H = sq2*(randn(nR,nT)+j*randn(nR,nT));

if nR>=nT, HH = H'*H; else HH = H*H'; end

for i=1:length(SNR_dB) % Random channel generation

C(Icase,i) = C(Icase,i)+log2(real(det(I+SNR_linear(i)/nT*HH)));


end


end

end

C = C/N_iter; f1=figure(1);

plot(SNR_dB,C(1,:),'b-o', SNR_dB,C(2,:),'r-', SNR_dB,C(3,:),'g-s');

hold on, plot(SNR_dB,C(4,:),'y->', SNR_dB,C(5,:),'b-^',SNR_dB,C(6,:),'c-*');

%hold on, plot(); set(f1,'color',[1 1 1])

xlabel('SNR[dB]'); ylabel('bps/Hz');grid on;

legend('NT=1,NR=1', 'NT=1,NR=2',...

'NT=2,NR=1','NT=2,NR=2','NT=4,NR=4','NT=8,NR=8');

Xem tất cả 97 trang.

Ngày đăng: 23/05/2023
Trang chủ Tài liệu miễn phí