📄 plot_lte.m
字号:
% Plots the impulse responses, the PDPs, the correlation properties
% and the Doppler spectra of the MIMO channel stored in the global
% variable H produced by script example_MIMO.m. plot_MIMO.m also
% relies on other global variables of example_MIMO.m
%
%
% STANDARD DISCLAIMER
%
% CSys is furnishing this item "as is". CSys does not provide any
% warranty of the item whatsoever, whether express, implied, or
% statutory, including, but not limited to, any warranty of
% merchantability or fitness for a particular purpose or any
% warranty that the contents of the item will be error-free.
%
% In no respect shall CSys incur any liability for any damages,
% including, but limited to, direct, indirect, special, or
% consequential damages arising out of, resulting from, or any way
% connected to the use of the item, whether or not based upon
% warranty, contract, tort, or otherwise; whether or not injury was
% sustained by persons or property or otherwise; and whether or not
% loss was sustained from, or arose out of, the results of, the
% item, or any services that may be provided by CSys.
%
% (c) Laurent Schumacher, AAU-TKN/IES/KOM/CPK/CSys - February 2002
close all;
figure(1)
colour = ['b','r','k','m','g','c','y','.','*'];
abscissa = (1:size(H,4)).*NumberOfChipsPerIteration.*ChipOversamplingFactor./ChipRate_Hz;
for ii = 1:NumberOfTxAntennas
for jj = 1:NumberOfRxAntennas
for kk = 1:NumberOfPaths
subplot(NumberOfTxAntennas,NumberOfRxAntennas,((ii-1)*NumberOfRxAntennas)+jj),...
semilogy(abscissa,abs(reshape(H(ii,jj,kk,:),1,NumberOfIterations)),colour(kk)), ...
hold on;
end;
grid;
xlabel('Time [s]');
title(['Tx#',num2str(ii),' - Rx#',num2str(jj)]);
end;
end;
% Check PDP
figure(2);
for ii = 1:NumberOfTxAntennas
for jj = 1:NumberOfRxAntennas
pdp = zeros(1,NumberOfPaths);
for kk = 1:NumberOfPaths
pdp(kk) = sum((abs(reshape(H(ii,jj,kk,:),1,NumberOfIterations))).^2)./NumberOfIterations;
end;
if ((sum(pdp) < .9) | (sum(pdp) > 1.1))
disp('Warning! sum(pdp) <> 1');
end;
subplot(NumberOfTxAntennas,NumberOfRxAntennas,(ii-1)*NumberOfRxAntennas+jj),...
stem(1:NumberOfPaths,10*log10(PDP_linear(1,:)./PDP_linear(1,1)),'r--'), hold on, ...
stem(1:NumberOfPaths,10*log10(pdp./pdp(1)),'b'), grid,...
title(['Tx#',num2str(ii),' - Rx#',num2str(jj),' - Sum PDP = ',num2str(sum(pdp))]);
axe = axis;
axe(1) = 1;
axis(axe);
if (jj==1)
subplot(NumberOfTxAntennas,NumberOfRxAntennas,(ii-1)*NumberOfRxAntennas+jj),...
ylabel('Power [dB]');
end;
if (ii==NumberOfTxAntennas)
subplot(NumberOfTxAntennas,NumberOfRxAntennas,(ii-1)*NumberOfRxAntennas+jj),...
xlabel('Tap index');
end;
end;
end;
% Check Doppler spectrum
figure(3)
normalised_frequency = (-NumberOfIterations/2+1:1:NumberOfIterations/2)...
* (ChipRate_Hz * ChipOversamplingFactor) ...
/ (NumberOfChipsPerIteration * NumberOfIterations * Max_Doppler_shift);
for ii = 1:NumberOfTxAntennas
for jj = 1:NumberOfRxAntennas
for kk = 1:NumberOfPaths
spectrum = (abs(fftshift(fft(reshape(H(ii, jj, kk, :), 1, NumberOfIterations))))./NumberOfIterations);
subplot(NumberOfTxAntennas*NumberOfRxAntennas,NumberOfPaths,...
(((ii-1)*NumberOfRxAntennas)+(jj-1))*NumberOfPaths+kk),plot(normalised_frequency,spectrum);
axe = axis;
axe(1) = max(-2,axe(1));
axe(2) = min(2,axe(2));
axis(axe);
lower_bound = line(ones(1,2),[axe(3) axe(4)]);
set(lower_bound,'Color',[1 0 0],'LineStyle',':');
upper_bound = line(-1*ones(1,2),[axe(3) axe(4)]);
set(upper_bound,'Color',[1 0 0],'LineStyle',':');
title(['Tap h_{',num2str(ii),num2str(jj),'}^',num2str(kk)]);
end;
end;
end;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -