Beruflich Dokumente
Kultur Dokumente
%
%
%
%
%
%
plot(BSx,BSy,'k^'), hold on
% Plot MS Positions
=====================================================
dMS0 = 100;
% initial distance of receiver (MS) from BS in
meters
thetaMS0 = 90; % angle of the initial position of the MS
w.r.t. x-axis
Vangle = 270; % the angle of the velocity vector w.r.t. xaxis and with MS
% at center of the coordinate system
MSx = zeros(Nsamples);
MSy = zeros(Nsamples);
MS0x = dMS0*cosd(thetaMS0); % initial x-coordinate of MS
MS0y = dMS0*sind(thetaMS0); % initial y-coordinate of MS
MSx = MS0x + V.*timeaxis*cosd(Vangle);
MSy = MS0y + V.*timeaxis*sind(Vangle);
plot(MSx,MSy,'k','LineWidth',5)
MINx = min(min(BSx,MSx))-1000;
MAXx = max(max(BSx,MSx))+1000;
MINy = min(min(BSy,MSy))-1000;
MAXy = max(max(BSy,MSy))+1000;
axis([MINx MAXx MINy MAXy])
plot([0 0],[MINy MAXy], 'k:')
plot([MINx MAXx],[0 0], 'k:')
xlabel('Distance (m)')
ylabel('Distance (m)')
% Positions of Scatterers
================================================
SCx = [0];
SCy = [500];
%a = [1; 0.5];
% x-coordinate of scatterers
% y-coordinate of scatterers
% magnitude of echoes
NSC = length(SCx);
plot(SCx,SCy,'+');
%% Calculations needed for the Frequency Response
% Calculate Distance from BS to SC to MS
distBSSC = sqrt((BSx-SCx).^2+(BSy-SCy).^2);
distBSSCext = repmat(distBSSC,1,Nsamples);
distSCMS = zeros(NSC,Nsamples);
for ii = 1:Nsamples
distSCMS(:,ii) = sqrt((SCx-MSx(ii)).^2+(SCyMSy(ii)).^2);
end
distBSSCMS = distBSSCext+distSCMS;
% Calculate new coordinates for angle of Doppler
========================
% The coordinates of SC w.r.t. the MS0 position
SCx_new = SCx - MS0x;
SCy_new = SCy - MS0y;
SC_new = [SCx_new SCy_new];
% The coordinates of final MS position w.r.t. the MS0
position
MSx_end = MSx(Nsamples) - MS0x;
MSy_end = MSy(Nsamples) - MS0y;
MS_end = [MSx_end MSy_end];
% Calculate the angle in Doppler equation for the link from
the SC to MS
for k3 =1 :NSC
alpha(k3) = acosd(dot(SC_new(k3,:),MS_end)/
(norm(SC_new(k3,:))*norm(MS_end)));
end
figure;mesh(faxis,timeaxis,abs(FreqResp))
ylabel('Time (s)')
xlabel('Frequency (MHz)')
zlabel('Level (l.u.)')
title('Time.varying frequency response')
figure;mesh(faxis,timeaxis,20*log10(abs(FreqResp)))
ylabel('Time (s)')
xlabel('Frequency (MHz)')
zlabel('Level (dB)')
title('Time-varying frequency response')
figure;plot(timeaxis,20*log10(abs(FreqResp(:,1))),'k')
xlabel('time (s)')
ylabel('level (dB)')
title('Complex envelope magnitude central frequency')
figure;plot(faxis,20*log10(abs(FreqResp(1,:))),'k')
xlabel('frequency (MHz)')
ylabel('level (dB)')
title('Frequency response for first route point')
figure;plot(faxis,angle(FreqResp(1,:)),'k')
xlabel('frequency (MHz)')
ylabel('phase (Rad)')
title('Frequency response for the first route point')
figure;mesh(tauaxis,MSx,abs(ImpResp))
xlabel('delay (s)')
ylabel('route point (m)')
zlabel('level (l.u.)')
title('Impulse response variable with time')
figure;plot(tauaxis,abs(ImpResp(1,:)),'k')
xlabel('delay (s)')
ylabel('level (l.u.)')
title('Impulse response for the first route point')
%===========================================================
============
taumax
step_tau
distBSSCMS(:,1)/cc
auxz=size(ImpResp);
%ScatMat=zeros(NFFT,auxz(2));
ScatMat=zeros(auxz(1),auxz(2));
for kk=1:auxz(2)
% for all delay bins
ScatMat(:,kk)=fftshift(abs(fft(ImpResp(:,kk))).^2);
%ScatMat(:,kk)=fftshift(abs(fft(ImpResp(:,kk),NFFT)).^2);
end
ScatMatdB=10*log10(ScatMat);
Floor=-50;
[ww,zz]=find(ScatMatdB==-inf);
ScatMatdB(ww,zz)=Floor;
figure;surf(tauaxis,Doppleraxis,ScatMatdB)
shading interp
colormap(jet)
ylabel('Doppler (Hz)')
xlabel('Delay (sec)')
zlabel('Level (dB)')
title('Scattering Function')