Commit 1a1504bc authored by Byiringi's avatar Byiringi

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@5676 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 7f5fb1c9
close all;
clear all;
%n_carriers=1;% 1 for UHF files, 2 for 2.6GHz files
%file='E:\EMOS\corridor\postprocessed data\eNB_data_UHF_20140519_run4.mat'; % mat file
%file='E:\EMOS\corridor\postprocessed data\eNB_data_20140331_UHF_run2.mat'; % mat file
n_carriers=1;
n_trials=1;
n_runs=1;
%file='E:\EMOS\corridor\postprocessed data\eNB_data_20140331_2.6GHz_run2.mat'; % mat file
%file='eNB_data_UHF_20140519_run2.mat'; % mat file
file='eNB_data_20140331_UHF_run1.mat'; % mat file
post_processed_data=load(file, 'PDD_totala','PDP_totala','delay_doppler_profile_beforea','delay_doppler_profile_duringa','delay_doppler_profile_aftera');
%post_processed_data=load(file, 'PDD_totala','PDP_totala');
if(n_carriers==2)
post_processed_data=load(file, 'PDD_totala','PDP_totala','delay_doppler_profile_beforea','delay_doppler_profile_duringa','delay_doppler_profile_aftera','PDD_totalb','PDP_totalb','delay_doppler_profile_beforeb','delay_doppler_profile_duringb','delay_doppler_profile_afterb');
end
PDDta=post_processed_data(1,1).PDD_totala;
PDPta=post_processed_data(1,1).PDP_totala;
delay_doppler_profile_beforea=post_processed_data(1,1).delay_doppler_profile_beforea;
delay_doppler_profile_duringa=post_processed_data(1,1).delay_doppler_profile_duringa;
delay_doppler_profile_aftera=post_processed_data(1,1).delay_doppler_profile_aftera;
if(n_carriers==2)
PDDtb=post_processed_data(1,1).PDD_totalb;
PDPtb=post_processed_data(1,1).PDP_totalb;
delay_doppler_profile_beforeb=post_processed_data(1,1).delay_doppler_profile_beforeb;
delay_doppler_profile_duringb=post_processed_data(1,1).delay_doppler_profile_duringb;
delay_doppler_profile_afterb=post_processed_data(1,1).delay_doppler_profile_afterb;
end
if n_trials==1
if n_runs==1
block_before=50;
block_during=90;
block_after=130;
end
if n_runs==2
if n_carriers==1% we have changed the orientation of the antennas for the UHF channel in Trial 1 Run 2
block_before=60;
block_during=155;
block_after=190;
end
if n_carriers==2
block_before=60;
block_during=107;
block_after=140;
end
end
end
if n_trials==2
if n_runs==1
block_before=50;
block_during=91;
block_after=140;
end
if n_runs==2
block_before=45;
block_during=77;
block_after=120;
end
if n_runs==3
block_before=45;
block_during=83;
block_after=120;
end
if n_runs==4
block_before=34;
block_during=43;
block_after=90;
end
end
%% Doppler spectrum (choose the block you want to read)
block = 60;
figure(1)
for i=1:size(PDDta,3)
for j=1:size(PDDta,4)
subplot(size(PDDta,3),size(PDDta,4),(i-1)*size(PDDta,4)+j)
F=-(100*120/2-1)*7.68E6/(2*100*120/2)/1280:7.68E6/(100*120/2)/1280:(100*120/2-1)*7.68E6/(2*100*120/2)/1280;
if (n_carriers==2)
F=-(50*120/2-1)*30.72E6/(2*50*120/2)/5120:30.72E6/(50*120/2)/5120:(50*120/2-1)*30.72E6/(2*50*120/2)/5120;
end
plot(F,10*log(PDDta(:,block,i,j)));
end
end
if(n_carriers==2)
figure(2)
for i=1:size(PDDtb,3)
for j=1:size(PDDtb,4)
subplot(size(PDDtb,3),size(PDDtb,4),(i-1)*size(PDDtb,4)+j)
F=-(50*120/2-1)*15.36E6/(2*50*120/2)/2560:15.36E6/(50*120/2)/2560:(50*120/2-1)*15.36E6/(2*50*120/2)/2560;
plot(F,10*log(PDDtb(:,block,i,j)));
end
end
end
%% Power Delay Profile (choose the frame you want to read)
frame = 6000;
figure(3)
for i=1:size(PDDta,3)
for j=1:size(PDDta,4)
T=1:1:(size(PDPta,1));
tau=linspace(0,300/4/4.5E6,300);
T=1:1:(size(PDPta,1));
if n_carriers==2
tau=linspace(0,1200/4/18E6,1200/4);
end
subplot(size(PDDta,3),size(PDDta,4),(i-1)*size(PDDta,4)+j)
plot(10*log10(PDPta(frame,:,i,j)));
xlabel('delay [s]')
ylabel('time [*10 ms]')
end
end
if(n_carriers==2)
figure(4)
for i=1:size(PDDtb,3)
for j=1:size(PDDtb,4)
T=1:1:(size(PDPtb,1));
tau=linspace(0,600/4/18E6,600/4);
subplot(size(PDDtb,3),size(PDDtb,4),(i-1)*size(PDDtb,4)+j)
plot(10*log10(PDPtb(frame,:,i,j)));
xlabel('delay [s]')
ylabel('time [*10 ms]')
end
end
end
%% Total doppler spectrum in pseudocolor plot
figure(5)
hold off
for i=1:size(PDDta,3)
for j=1:size(PDDta,4)
T=1:1:size(PDDta,2);
F=-(100*120/2-1)*7.68E6/(2*100*120/2)/1280:7.68E6/(100*120/2)/1280:(100*120/2-1)*7.68E6/(2*100*120/2)/1280;
if(n_carriers==2)
F=-(50*120/2-1)*30.72E6/(2*50*120/2)/5120:30.72E6/(50*120/2)/5120:(50*120/2-1)*30.72E6/(2*50*120/2)/5120;
end
subplot(size(PDDta,3),size(PDDta,4),(i-1)*size(PDDta,4) + j);
pcolor(T,F,10*log10( PDDta(:,:,i,j)));
shading flat
colormap hot
bara=colorbar;
%ylim([])
%xlim([])
xlabel('time [s]')
ylabel('Doppler shift [Hz]')
end
end
% for i=1:size(PDDta,1)
% for j=1:size(PDDta,2)
% if 10*log10(PDDta(i,j,1,1))<115
% PDDta(i,j,1,1)=10^11.5;
% end
% end
%
% end
% figure (15)
%
% T=1:1:size(PDDta,2);
% F=-(100*120/2-1)*7.68E6/(2*100*120/2)/1280:7.68E6/(100*120/2)/1280:(100*120/2-1)*7.68E6/(2*100*120/2)/1280;
% if(n_carriers==2)
% F=-(50*120/2-1)*30.72E6/(2*50*120/2)/5120:30.72E6/(50*120/2)/5120:(50*120/2-1)*30.72E6/(2*50*120/2)/5120;
% end
%
%
%
%
% pcolor(T,F,10*log10( PDDta(:,:,1,1)));
% shading flat
% colormap hot
% bara=colorbar;
% %ylim([])
% %xlim([])
% xlabel('time [s]')
% ylabel('Doppler shift [Hz]')
if(n_carriers==2)
figure(6)
for i=1:size(PDDtb,3)
for j=1:size(PDDtb,4)
T=1:1:size(PDDtb,2);
F=-(50*120/2-1)*15.36E6/(2*50*120/2)/2560:15.36E6/(50*120/2)/2560:(50*120/2-1)*15.36E6/(2*50*120/2)/2560;
subplot(size(PDDtb,3),size(PDDtb,4),(i-1)*size(PDDtb,4) + j);
pcolor(T,F,10*log10( PDDtb(:,:,i,j)));
shading flat
barb=colorbar;
colormap hot
%ylim([])
%xlim([])
xlabel('time [s]')
ylabel('Doppler shift [Hz]')
end
end
end
%% Total Power Delay Profile in pseudocolor
figure(7)
for i=1:size(PDDta,3)
for j=1:size(PDDta,4)
tau=linspace(0,300/4/4.5E6,300/4);
T=1:1:(size(PDPta,1));
if n_carriers==2
tau=linspace(0,1200/4/18E6,1200/4);
end
subplot(size(PDDta,3),size(PDDta,4),(i-1)*size(PDDta,4)+j)
pcolor(tau,T,10*log10(PDPta(:,:,i,j)));
bara=colorbar;
shading flat
colormap hot
xlabel('delay [s]')
ylabel('time [*10 ms]')
end
end
% for i=1:size(PDPta,1)
% for j=1:size(PDPta,2)
% if 10*log10(PDPta(i,j,1,1))<57
% PDPta(i,j,1,1)=10^5.7;
% end
% end
%
% end
% figure (17)
% tau=linspace(0,300/4/4.5E6,300/4);
% T=1:1:(size(PDPta,1));
% if n_carriers==2
% tau=linspace(0,1200/4/18E6,1200/4);
% end
%
% pcolor(tau,T,10*log10(PDPta(:,:,1,1)));
% bara=colorbar;
% shading flat
% colormap hot
% xlabel('delay [s]')
% ylabel('time [*10 ms]')
if(n_carriers==2)
figure(8)
for i=1:size(PDDtb,3)
for j=1:size(PDDtb,4)
tau=linspace(0,600/4/18E6,600/4);
T=1:1:(size(PDPtb,1));
subplot(size(PDDtb,3),size(PDDtb,4),(i-1)*size(PDDtb,4)+j)
pcolor(tau,T,10*log10(PDPtb(:,:,i,j)));
barb=colorbar;
shading flat
colormap hot
xlabel('delay [s]')
ylabel('time [*10 ms]')
end
end
end
%% Delay Doppler Spectrum before, during and after the passing of the train
figure(9)
tau=linspace(0,300/4/4.5E6,300/4);
F=-(100*120/2-1)*7.68E6/(2*100*120/2)/1280:7.68E6/(100*120/2)/1280:(100*120/2-1)*7.68E6/(2*100*120/2)/1280;
if(n_carriers==2)
tau=linspace(0,1200/4/18E6,1200/4);
F=-(50*120/2-1)*30.72E6/(2*50*120/2)/5120:30.72E6/(50*120/2)/5120:(50*120/2-1)*30.72E6/(2*50*120/2)/5120;
end
subplot(1,3,1)
pcolor(tau,F,10*log10(delay_doppler_profile_beforea(:,:)))
shading flat
colormap hot
bar1=colorbar;
xlabel('delay [s]')
ylabel('Doppler shift [Hz]')
title(sprintf('Delay Doppler Spectrum for UHF-Trial %d-Run %d-Block %d ',n_trials,n_runs,block_before));
if(n_carriers==2)
title(sprintf('Delay Doppler Spectrum for 2.6GHz Carrier 1-Trial %d-Run %d-Block %d ',n_trials,n_runs,block_before));
end
subplot(1,3,2)
pcolor(tau,F,10*log10(delay_doppler_profile_duringa(:,:)))
shading flat
colormap hot
bar2=colorbar;
xlabel('delay [s]')
ylabel('Doppler shift [Hz]')
title(sprintf('Delay Doppler Spectrum for UHF-Trial %d-Run %d-Block %d ',n_trials,n_runs,block_during));
if(n_carriers==2)
title(sprintf('Delay Doppler Spectrum for 2.6GHz Carrier 1-Trial %d-Run %d-Block %d ',n_trials,n_runs,block_during));
end
subplot(1,3,3)
pcolor(tau,F,10*log10(delay_doppler_profile_aftera(:,:)))
shading flat
bar3=colorbar;
xlabel('delay [s]')
ylabel('Doppler shift [Hz]')
title(sprintf('Delay Doppler Spectrum for UHF-Trial %d-Run %d-Block %d ',n_trials,n_runs,block_after));
if(n_carriers==2)
title(sprintf('Delay Doppler Spectrum for 2.6GHz Carrier 1-Trial %d-Run %d-Block %d ',n_trials,n_runs,block_after));
end
if(n_carriers==2)
figure(10)
tau=linspace(0,600/4/9E6,600/4);
F=-(50*120/2-1)*15.36E6/(2*50*120/2)/2560:15.36E6/(50*120/2)/2560:(50*120/2-1)*15.36E6/(2*50*120/2)/2560;
subplot(1,3,1)
pcolor(tau,F,10*log10(delay_doppler_profile_beforeb(:,:)))
shading flat
bar4=colorbar;
xlabel('delay [s]')
ylabel('Doppler shift [Hz]')
title(sprintf('Delay Doppler Spectrum for 2.6GHz Carrier 2-Trial %d-Run %d-Block %d ',n_trials,n_runs,block_before));
subplot(1,3,2)
pcolor(tau,F,10*log10(delay_doppler_profile_duringb(:,:)))
shading flat
bar5=colorbar;
xlabel('delay [s]')
ylabel('Doppler shift [Hz]')
title(sprintf('Delay Doppler Spectrum for 2.6GHz Carrier 2-Trial %d-Run %d-Block %d ',n_trials,n_runs,block_during));
subplot(1,3,3)
pcolor(tau,F,10*log10(delay_doppler_profile_afterb(:,:)))
shading flat
bar6=colorbar;
xlabel('delay [s]')
ylabel('Doppler shift [Hz]')
title(sprintf('Delay Doppler Spectrum for 2.6GHz Carrier 2-Trial %d-Run %d-Block %d ',n_trials,n_runs,block_after));
end
\ No newline at end of file
......@@ -13,7 +13,8 @@ primary_synch; %loads the primary sync signal
load('ofdm_pilots_sync_30MHz.mat');
n_carriers = 2; % use 1 for UHF and 2 for 2.6GHz
n_trials=2;%use 1 for trial1 and 2 for trial2
n_trials=1;%use 1 for trial1 and 2 for trial2
n_run=1;
symbols_per_slot = 6;
slots_per_frame = 20;
......@@ -23,9 +24,9 @@ switch n_carriers
pss_t = upsample(primary_synch0_time,4);
%filename = 'E:\EMOS\corridor\trials1\eNB_data_20140331_UHF_run1.EMOS';
filename = 'E:/byiringi/emosFiles/trials1/eNB_data_20140331_UHF_run2.EMOS';
%filename = 'E:/byiringi/emosFiles/trials1/eNB_data_20140331_UHF_run1.EMOS';
%filename = 'E:/byiringi/emosFiles/trials1/eNB_data_20140331_UHF_run2.EMOS';
%filename = 'E:/byiringi/emosFiles/trials2/eNB_data_UHF_20140519_run1.EMOS';
filename = 'E:/byiringi/emosFiles/trials2/eNB_data_UHF_20140519_run4.EMOS';
%filename = 'E:/byiringi/emosFiles/trials2/eNB_data_UHF_20140519_run4.EMOS';
nframes = 100; % frames in one block
......@@ -33,12 +34,12 @@ switch n_carriers
case 2,
p(1) = init_params(100,2,4);
p(2) = init_params(50,2,4);
pss_t = upsample(primary_synch0_time,4*4); % this assumes we are doing the sync on the first carrier, which is 10MHz
pss_t = upsample(primary_synch0_time,4*4); % this assumes we are doing the sync on the second carrier, which is 10MHz
%filename = 'E:\EMOS\corridor\trials1\eNB_data_20140331_UHF_run1.EMOS';
%filename = 'E:/byiringi/emosFiles/trials1/eNB_data_20140331_2.6GHz_run1.EMOS';
filename = 'E:/byiringi/emosFiles/trials1/eNB_data_20140331_2.6GHz_run2.EMOS';
%filename = 'E:\EMOS\corridor\trials2\eNB_data_20140519_2.6GHz_run2.EMOS';
filename = 'E:/byiringi/emosFiles/trials2/eNB_data_20140519_2.6GHz_run2.EMOS';
%filename = 'E:/byiringi/emosFiles/trials2/eNB_data_20140519_2.6GHz_run2.EMOS';
nframes = 50; % frames in one block
threshold = 3e+4 ; % maybe should change that !!!!
......@@ -84,11 +85,77 @@ end
PDP_totala = zeros(nblocks*nframes,p(1).useful_carriers/4,p(1).nant_tx,p(1).nant_rx);
PDD_totala = zeros(nframes*num_symbols_frame/2,nblocks,p(1).nant_tx,p(1).nant_rx);
% delay doppler spectrum
delay_doppler_profile_beforea=zeros(nframes*num_symbols_frame/2,p(1).useful_carriers/4);%contains the delay doppler spectrum for a block before the passing of the train
delay_doppler_profile_duringa=zeros(nframes*num_symbols_frame/2,p(1).useful_carriers/4);%contains the delay doppler spectrum for a block during the passing of the train
delay_doppler_profile_aftera=zeros(nframes*num_symbols_frame/2,p(1).useful_carriers/4);%contains the delay doppler spectrum for a block after the passing of the train
if n_carriers==2
delay_doppler_profile_beforeb=zeros(nframes*num_symbols_frame/2,p(2).useful_carriers/4);%contains the delay doppler spectrum for a block before the passing of the train
delay_doppler_profile_duringb=zeros(nframes*num_symbols_frame/2,p(2).useful_carriers/4);%contains the delay doppler spectrum for a block during the passing of the train
delay_doppler_profile_afterb=zeros(nframes*num_symbols_frame/2,p(2).useful_carriers/4);%contains the delay doppler spectrum for a block after the passing of the train
end
if n_trials==1
if n_run==1
block_before=50;
block_during=90;
block_after=130;
end
if n_run==2
if n_carriers==1% we have changed the orientation of the antennas for the UHF channel in Trial 1 Run 2
block_before=60;
block_during=155;
block_after=190;
end
if n_carriers==2
block_before=60;
block_during=107;
block_after=140;
end
end
end
if n_trials==2
if n_run==1
block_before=50;
block_during=91;
block_after=140;
end
if n_run==2
block_before=45;
block_during=77;
block_after=120;
end
if n_run==3
block_before=45;
block_during=83;
block_after=120;
end
if n_run==4
block_before=34;
block_during=43;
block_after=90;
end
end
if(n_carriers==2)
PDP_totalb = zeros(nblocks*nframes,p(2).useful_carriers/4,p(2).nant_tx,p(2).nant_rx);
PDD_totalb=zeros(nframes*num_symbols_frame/2,nblocks,p(2).nant_tx,p(2).nant_rx);
interesting_delay_doppler_profileb=zeros(nframes*num_symbols_frame/2,p(2).useful_carriers/4);%contains the delay doppler spectrum for the wanted block
if (n_trials==2)
interesting_block=60;%contains the value of one interesting block for the delay_doppler_spectrum
end
end
......@@ -425,7 +492,7 @@ while ~feof(fid)
if(n_carriers==2)
if carrier==2
if carrier==2
% adjust frame offset base on channel estimate to compensate for
% timing drift. We try to keep the peak of the impulse response at
% sample prefix_length/8.
......@@ -455,11 +522,11 @@ while ~feof(fid)
Ht1a=ifft(H1a,[],2);
PDD1a=sum(abs(fftshift(fft(Ht1a,[],1))).^2,2);
delayPDD1a=abs(fftshift(fft(Ht1a,[],1))).^2;
delayPDD1a=mean(mean(abs(fftshift(fft(Ht1a,[],1))).^2,3),4);
if(n_carriers==2)
Ht1b=ifft(H1b,[],2);
PDD1b=sum(abs(fftshift(fft(Ht1b,[],1))).^2,2);
delayPDD1b=abs(fftshift(fft(Ht1b,[],1))).^2;
delayPDD1b=mean(mean(abs(fftshift(fft(Ht1b,[],1))).^2,3),4);
end
if(enable_plots>=2)
......@@ -472,10 +539,14 @@ while ~feof(fid)
end
subplot(p(1).nant_tx,p(1).nant_rx,(itx-1)*p(1).nant_rx + irx);
title(sprintf('Doppler Spectrum for UHF-Trial %d-Run %d-Block %d ',n_trials,n_run,block));
if n_carriers==2
title(sprintf('Doppler Spectrum for 2.6GHz Carrier 1-Trial %d-Run %d-Block %d ',n_trials,n_run,block));
end
plot(F,10*log10(PDD1a(:,:,itx,irx)))
%ylim([])
%xlim([])
xlabel('F=f-ftx [Hz]')
ylabel('power [dB]')
end
......@@ -488,10 +559,10 @@ while ~feof(fid)
F=-(NFRAMES*num_symbols_frame/2-1)*15.36E6/(2*NFRAMES*num_symbols_frame/2)/2560:15.36E6/(NFRAMES*num_symbols_frame/2)/2560:(NFRAMES*num_symbols_frame/2)*15.36E6/(2*NFRAMES*num_symbols_frame/2)/2560;
subplot(p(2).nant_tx,p(2).nant_rx,(itx-1)*p(2).nant_rx + irx);
title(sprintf('Doppler Spectrum for 2.6GHz Carrier 2-Trial %d-Run %d-Block %d ',n_trials,n_run,block));
plot(F,10*log10(PDD1b(:,:,itx,irx)))
%ylim([])
%xlim([])
xlabel('F=f-ftx [Hz]')
ylabel('power [dB]')
end
......@@ -499,50 +570,77 @@ while ~feof(fid)
end
end
% figure(20)
% for itx=1:p(1).nant_tx
% for irx=1:p(1).nant_rx
% D=1:300;
% F=-(NFRAMES*num_symbols_frame/2-1)*7.68E6/(2*NFRAMES*num_symbols_frame/2)/1280:7.68E6/(NFRAMES*num_symbols_frame/2)/1280:(NFRAMES*num_symbols_frame/2-1)*7.68E6/(2*NFRAMES*num_symbols_frame/2)/1280;
% if(n_carriers==2)
% F=-(NFRAMES*num_symbols_frame/2-1)*30.72E6/(2*NFRAMES*num_symbols_frame/2)/5120:30.72E6/(NFRAMES*num_symbols_frame/2)/5120:(NFRAMES*num_symbols_frame/2)*30.72E6/(2*NFRAMES*num_symbols_frame/2)/5120;
% end
%
% subplot(p(1).nant_tx,p(1).nant_rx,(itx-1)*p(1).nant_rx + irx);
% % plot(F,10*log10(delayPDD1a(:,180,itx,irx)),F,10*log10(delayPDD1a(:,250,itx,irx)))
% waterfall(plot(10*log10(delayPDD1a(:,:,itx,irx))))
% %ylim([])
% %xlim([])
% % xlabel('F=f-ftx [Hz]')
% % ylabel('power [dB]')
% end
% end
%
% if(n_carriers==2)
% figure(21)
% for itx=1:p(1).nant_tx
% for irx=1:p(1).nant_rx
% D=1:300;
% F=-(NFRAMES*num_symbols_frame/2-1)*15.36E6/(2*NFRAMES*num_symbols_frame/2)/2560:15.36E6/(NFRAMES*num_symbols_frame/2)/2560:(NFRAMES*num_symbols_frame/2)*15.36E6/(2*NFRAMES*num_symbols_frame/2)/2560;
%
% subplot(p(2).nant_tx,p(2).nant_rx,(itx-1)*p(2).nant_rx + irx);
% % plot(F,10*log10(delayPDD1b(:,90,itx,irx)),F,10*log10(delayPDD1b(:,120,itx,irx)))
% waterfall(plot(10*log10(delayPDD1b(:,:,itx,irx))))
% %ylim([])
% %xlim([])
% % xlabel('F=f-ftx [Hz]')
% % ylabel('power [dB]')
% end
% end
% end
if enable_plots>=2
figure(20)
tau=linspace(0,p(1).useful_carriers/4/4.5E6,p(1).useful_carriers/4);
F=-(NFRAMES*num_symbols_frame/2-1)*7.68E6/(2*NFRAMES*num_symbols_frame/2)/1280:7.68E6/(NFRAMES*num_symbols_frame/2)/1280:(NFRAMES*num_symbols_frame/2-1)*7.68E6/(2*NFRAMES*num_symbols_frame/2)/1280;
if(n_carriers==2)
tau=linspace(0,p(1).useful_carriers/4/18E6,p(1).useful_carriers/4);
F=-(NFRAMES*num_symbols_frame/2-1)*30.72E6/(2*NFRAMES*num_symbols_frame/2)/5120:30.72E6/(NFRAMES*num_symbols_frame/2)/5120:(NFRAMES*num_symbols_frame/2)*30.72E6/(2*NFRAMES*num_symbols_frame/2)/5120;
end
title(sprintf('Delay Doppler Spectrum for UHF-Trial %d-Run %d-Block %d ',n_trials,n_run,block));
if(n_carriers==2)
title(sprintf('Delay Doppler Spectrum for 2.6GHz Carrier 1-Trial %d-Run %d-Block %d ',n_trials,n_run,block));
end
pcolor(tau,F,10*log10(delayPDD1a(:,:)))
shading flat
bara=colorbar;
xlabel('delay [s]')
ylabel('Doppler shift [Hz]')
if(n_carriers==2)
figure(21)
tau=linspace(0,p(2).useful_carriers/4/9E6,p(2).useful_carriers/4);
F=-(NFRAMES*num_symbols_frame/2-1)*15.36E6/(2*NFRAMES*num_symbols_frame/2)/2560:15.36E6/(NFRAMES*num_symbols_frame/2)/2560:(NFRAMES*num_symbols_frame/2)*15.36E6/(2*NFRAMES*num_symbols_frame/2)/2560;
title(sprintf('Delay Doppler Spectrum for 2.6GHz Carrier 2-Trial %d-Run %d-Block %d ',n_trials,n_run,block));
pcolor(tau,F,10*log10(delayPDD1b(:,:)))
shading flat
barb=colorbar;
xlabel('delay [s]')
ylabel('Doppler shift [Hz]')
end
end
PDD_totala(:,block,:,:)=PDD1a;
if(block==block_before)
delay_doppler_profile_beforea=delayPDD1a;
end
if(block==block_during)
delay_doppler_profile_duringa=delayPDD1a;
end
if(block==block_after)
delay_doppler_profile_aftera=delayPDD1a;
end
if(n_carriers==2)
PDD_totalb(:,block,:,:)=PDD1b;
if(block==block_before)
delay_doppler_profile_beforeb=delayPDD1b;
end
if(block==block_during)
delay_doppler_profile_duringb=delayPDD1b;
end
if(block==block_after)
delay_doppler_profile_afterb=delayPDD1b;
end
end
......@@ -658,11 +756,15 @@ if(enable_plots>=2)
F=-(NFRAMES*num_symbols_frame/2-1)*30.72E6/(2*NFRAMES*num_symbols_frame/2)/5120:30.72E6/(NFRAMES*num_symbols_frame/2)/5120:(NFRAMES*num_symbols_frame/2)*30.72E6/(2*NFRAMES*num_symbols_frame/2)/5120;
end
subplot(p(1).nant_tx,p(1).nant_rx,(itx-1)*p(1).nant_rx + irx);
title(sprintf('Doppler spectrum UHF Trial %d-Run %d',n_trials,n_run));
if n_carriers==2
title(sprintf('Doppler spectrum 2.6GHz Carrier 1 Trial %d-Run %d',n_trials,n_run));
end
pcolor(T,F,10*log10( PDD_totala(:,:,itx,irx)));
shading flat
bara=colorbar;
%ylim([])
%xlim([])
ylabel(bara, 'dBm')
ylabel('F=f-ftx [Hz]')
xlabel('time [s]')
end
......@@ -675,11 +777,12 @@ if(enable_plots>=2)
T=1:1:block-1;
F=-(NFRAMES*num_symbols_frame/2-1)*15.36E6/(2*NFRAMES*num_symbols_frame/2)/2560:15.36E6/(NFRAMES*num_symbols_frame/2)/2560:(NFRAMES*num_symbols_frame/2)*15.36E6/(2*NFRAMES*num_symbols_frame/2)/2560;
subplot(p(2).nant_tx,p(2).nant_rx,(itx-1)*p(2).nant_rx + irx);
title(sprintf('Doppler spectrum 2.6GHz Carrier 2 Trial %d-Run %d',n_trials,n_run));
pcolor(T,F,10*log10( PDD_totalb(:,:,itx,irx)));
shading flat
barb=colorbar;
%ylim([])
%xlim([])
ylabel(barb, 'dBm')
ylabel('F=f-ftx [Hz]')
xlabel('time [s]')
end
......@@ -687,13 +790,15 @@ if(enable_plots>=2)
end
end
%%
%% Mean Delay
Pma=zeros((block-1)*NFRAMES,1,p(1).nant_tx,p(1).nant_rx);% zeroth-order moment
Pma1=zeros((block-1)*NFRAMES,1,p(1).nant_tx,p(1).nant_rx);
atau=linspace(0,p(1).useful_carriers/4/4.5E6,p(1).useful_carriers/4);
if(n_carriers==2)
atau=linspace(0,p(1).useful_carriers/4/9E6,p(1).useful_carriers/4);
atau=linspace(0,p(1).useful_carriers/4/18E6,p(1).useful_carriers/4);
end
for i=1:p(1).useful_carriers/4
Pma(:,1,:,:)=Pma(:,1,:,:)+PDP_totala(:,i,:,:);
......@@ -706,7 +811,7 @@ mean_delay_a=Pma1./Pma;% mean delay: first-order moment
if(n_carriers==2)
Pmb=zeros((block-1)*NFRAMES,1,p(2).nant_tx,p(2).nant_rx);
Pmb1=zeros((block-1)*NFRAMES,1,p(2).nant_tx,p(2).nant_rx);
btau=linspace(0,p(2).useful_carriers/4/18E6,p(2).useful_carriers/4);
btau=linspace(0,p(2).useful_carriers/4/9E6,p(2).useful_carriers/4);
for i=1:p(2).useful_carriers/4
Pmb(:,1,:,:)=Pmb(:,1,:,:)+PDP_totalb(:,i,:,:);
Pmb1(:,1,:,:)=Pmb1(:,1,:,:)+btau(i)*PDP_totalb(:,i,:,:);
......@@ -719,6 +824,10 @@ for itx=1:p(1).nant_tx
for irx=1:p(1).nant_rx
subplot(p(1).nant_tx,p(1).nant_rx,(itx-1)*p(1).nant_rx + irx);
title(sprintf('Mean Delay UHF Trial %d-Run %d',n_trials,n_run));
if n_carriers==2
title(sprintf('Mean Delay 2.6GHz Carrier 1 Trial %d-Run %d',n_trials,n_run));
end
plot(mean_delay_a(:,:,itx,irx));
ylabel('delay [s]')
xlabel('time [s]')
......@@ -732,6 +841,7 @@ if (n_carriers==2)
for irx=1:p(2).nant_rx
subplot(p(2).nant_tx,p(2).nant_rx,(itx-1)*p(2).nant_rx + irx);
title(sprintf('Mean Delay 2.6GHz Carrier 2 Trial %d-Run %d',n_trials,n_run));
plot(mean_delay_b(:,:,itx,irx));
ylabel('delay [s]')
xlabel('time [s]')
......@@ -773,6 +883,10 @@ for itx=1:p(1).nant_tx
for irx=1:p(1).nant_rx
subplot(p(1).nant_tx,p(1).nant_rx,(itx-1)*p(1).nant_rx + irx);
title(sprintf('Mean Doppler shift UHF Trial %d-Run %d',n_trials,n_run));
if n_carriers==2
title(sprintf('Mean Doppler shift 2.6GHz Carrier 1 Trial %d-Run %d',n_trials,n_run));
end
plot(mean_doppler_shift_a(:,:,itx,irx));
ylabel('f-ftx [Hz]')
xlabel('time [s]')
......@@ -785,6 +899,7 @@ if (n_carriers==2)
for irx=1:p(2).nant_rx
subplot(p(2).nant_tx,p(2).nant_rx,(itx-1)*p(2).nant_rx + irx);
title(sprintf('Mean Doppler shift 2.6GHz Carrier 2 Trial %d-Run %d',n_trials,n_run));
plot(mean_doppler_shift_b(:,:,itx,irx));
ylabel('f-ftx [Hz]')
xlabel('time [s]')
......@@ -793,14 +908,17 @@ if (n_carriers==2)
end
%%
figure(17)
title('');
title(sprintf('Main Doppler peak for UHF Trial %d-Run%d',n_trials,n_run));
if n_carriers==2
title(sprintf('Main Doppler peak for 2.6GHz Carrier 1 Trial %d-Run%d',n_trials,n_run));
end
plot(doppler_freq_of_max_a);
xlabel('time [s]');
ylabel('f-ftx [Hz]');
if(n_carriers==2)
figure(18)
title('');
title(sprintf('Main Doppler peak for 2.6GHz Carrier 2 Trial %d-Run%d',n_trials,n_run));
plot(doppler_freq_of_max_b);
xlabel('time [s]');
ylabel('f-ftx [Hz]');
......@@ -836,8 +954,10 @@ fclose(fid);
%% save processed data
[path,name,ext]=fileparts(filename);
if(n_carriers==1)
save([name '.mat'],'PDP_totala','PDD_totala','mean_delay_a','mean_doppler_shift_a','doppler_freq_of_max_a');
save([name '.mat'],'PDP_totala','PDD_totala','mean_delay_a','mean_doppler_shift_a','doppler_freq_of_max_a','delay_doppler_profile_beforea','delay_doppler_profile_duringa','delay_doppler_profile_aftera');
end
if(n_carriers==2)
save([name '.mat'],'PDP_totala','PDD_totala','mean_delay_a','mean_doppler_shift_a','doppler_freq_of_max_a','PDP_totalb','PDD_totalb','mean_delay_b','mean_doppler_shift_b','doppler_freq_of_max_b');
save([name '.mat'],'PDP_totala','PDD_totala','mean_delay_a','mean_doppler_shift_a','doppler_freq_of_max_a','delay_doppler_profile_beforea','delay_doppler_profile_duringa','delay_doppler_profile_aftera','PDP_totalb','PDD_totalb','mean_delay_b','mean_doppler_shift_b','doppler_freq_of_max_b','delay_doppler_profile_beforeb','delay_doppler_profile_duringb','delay_doppler_profile_afterb');
end
\ No newline at end of file
......@@ -7,12 +7,16 @@ d2 = dir(fullfile(top_dir,'2.6GHz','*.log'));
start_time = [1.400489088000000e+09 1.400493112000000e+09 1.400499696000000e+09 1.400506864000000e+09];
for idx=1:length(d1)
data1{idx}=csvread(fullfile(top_dir,'UHF',d1(idx).name),1,0);
data2{idx}=csvread(fullfile(top_dir,'2.6GHz',d2(idx).name),1,0);
frame_start1(idx) = ceil(data1{idx}(find(data1{idx}(:,1)>start_time(idx),1,'first'),3)/92160000)*100;
frame_start2(idx) = ceil(data2{idx}(find(data2{idx}(:,1)>start_time(idx),1,'first'),3)/368640000)*100;
......@@ -94,7 +98,7 @@ for idx=1:length(d1)
new_distances2=(TGV_speed*abs(rtime2-time02))/1000+min(distances2)*ones(length(rtime2),1);% distance in km
if (idx==2)%For Run 2, there is an anomalous peak for the RSSI at the end. Here we ignore it
if (idx==2)%For Run 2, there is an anomalous peak for the RSSI at the end. Here we ignore it
[RSSI_max2,I_RSSI_max2]=max(data2{idx}(1:32900,13));
time02=rtime2(I_RSSI_max2)*ones(length(rtime2),1);
new_distances2=(TGV_speed*abs(rtime2-time02))/1000+min(distances2)*ones(length(rtime2),1);% distance in km
......@@ -118,45 +122,45 @@ for idx=1:length(d1)
%% rssi(dBm) versus distance (log scale)
% We will plot the rssi versus the distance with the data before the passing of the train, and with the data after the passingof the train
% we heuristically determine a starting point and a ending point for the linear fitting
% We will plot the rssi versus the distance with the data before the passing of the train, and with the data after the passingof the train
% we heuristically determine a starting point and a ending point for the linear fitting
if idx==1
distance_before_break1_start=0.3913;%in km
distance_before_break1_end=27.71;
distance_before_break2_start=0.3282;
distance_before_break2_end=15.24;
distance_before_break1_start=0.4;%in km
distance_before_break1_end=7.5;
distance_before_break2_start=0.4;
distance_before_break2_end=7.5;
distance_after_break1_start=0.85;%in km
distance_after_break1_end=9;
distance_after_break2_start=0.2911;
distance_after_break2_end=9;
distance_after_break1_start=0.9;%in km
distance_after_break1_end=4.5;
distance_after_break2_start=0.9;
distance_after_break2_end=4.5;
end
if idx==2
distance_before_break1_start=0.8468;%in km
distance_before_break1_end=9;
distance_before_break2_start=0.4822;
distance_before_break2_end=7.099;
distance_before_break1_start=0.8;%in km
distance_before_break1_end=4.5;
distance_before_break2_start=0.8;
distance_before_break2_end=4.5;
distance_after_break1_start=0.5812;%in km
distance_after_break1_end=18.76;
distance_after_break2_start=0.4402;
distance_after_break2_end=10;
distance_after_break1_start=0.5;%in km
distance_after_break1_end=7.5;
distance_after_break2_start=0.5;
distance_after_break2_end=7.5;
end
if idx==3
distance_before_break1_start=4.258;%in km
distance_before_break1_end=29.46;
distance_before_break2_start=8.375;
distance_before_break2_end=29.66;
distance_before_break1_start=5;%in km
distance_before_break1_end=23;
distance_before_break2_start=5;
distance_before_break2_end=23;
distance_after_break1_start=2.274;%in km
distance_after_break1_end=5.376;
......@@ -170,10 +174,10 @@ for idx=1:length(d1)
distance_before_break2_start=0.1344;
distance_before_break2_end=3.78;
distance_after_break1_start=0.3793;%in km
distance_after_break1_end=9;
distance_after_break2_start=0.5443;
distance_after_break2_end=9;
distance_after_break1_start=0.5;%in km
distance_after_break1_end=8;
distance_after_break2_start=0.5;
distance_after_break2_end=8;
end
% indexes of the starting and ending points with the data before the passing of the
......@@ -244,6 +248,7 @@ for idx=1:length(d1)
semilogx(new_distances2(1:I_RSSI_max2),data2{idx}(1:I_RSSI_max2,13),'bx',new_distances2(index_break2_before_end:index_break2_before_start),linearFit2_before,'b-')
display(sprintf('Run %d :slope 2.6GHz before: %f',idx,linearCoef2_before(1)))
title(sprintf('Run %d: With the data before the passing of the train',idx))
legend('UHF','UHF:linear fitting','2.6GHz card 1','2.6GHz card 1:linear fitting');
xlabel('distance [km]')
......@@ -270,9 +275,55 @@ for idx=1:length(d1)
ylabel('RSSI [dBm]')
% Zoom on the linear fitting
figure(idx*10+4)
subplot(2,1,1)
hold off
linearCoef1_before = polyfit(10*log10(new_distances1(index_break1_before_end:index_break1_before_start)),data1{idx}(index_break1_before_end:index_break1_before_start,13),1);
linearFit1_before = polyval(linearCoef1_before,10*log10(new_distances1(index_break1_before_end:index_break1_before_start)));
semilogx(new_distances1(index_break1_before_end:index_break1_before_start),data1{idx}(index_break1_before_end:index_break1_before_start,13),'rx',new_distances1(index_break1_before_end:index_break1_before_start),linearFit1_before,'r-')
%display(sprintf('Run %d :slope UHF before: %f',idx,linearCoef1_before(1)))
hold on
linearCoef2_before = polyfit(10*log10(new_distances2(index_break2_before_end:index_break2_before_start)),data2{idx}(index_break2_before_end:index_break2_before_start,13),1);
linearFit2_before = polyval(linearCoef2_before,10*log10(new_distances2(index_break2_before_end:index_break2_before_start)));
semilogx(new_distances2(index_break2_before_end:index_break2_before_start),data2{idx}(index_break2_before_end:index_break2_before_start,13),'bx',new_distances2(index_break2_before_end:index_break2_before_start),linearFit2_before,'b-')
%display(sprintf('Run %d :slope 2.6GHz before: %f',idx,linearCoef2_before(1)))
title(sprintf('Run %d: With the data before the passing of the train',idx))
legend('UHF','UHF:linear fitting','2.6GHz card 1','2.6GHz card 1:linear fitting');
xlabel('distance [km]')
ylabel('RSSI [dBm]')
subplot(2,1,2)
hold off
linearCoef1_after = polyfit(10*log10(new_distances1(index_break1_after_start:index_break1_after_end)),data1{idx}(index_break1_after_start:index_break1_after_end,13),1);
linearFit1_after = polyval(linearCoef1_after,10*log10(new_distances1(index_break1_after_start:index_break1_after_end)));
semilogx(new_distances1(index_break1_after_start:index_break1_after_end),data1{idx}(index_break1_after_start:index_break1_after_end,13),'rx',new_distances1(index_break1_after_start:index_break1_after_end),linearFit1_after,'r-')
%display(sprintf('Run %d :slope UHF after: %f',idx,linearCoef1_after(1)))
hold on
linearCoef2_after = polyfit(10*log10(new_distances2(index_break2_after_start:index_break2_after_end)),data2{idx}(index_break2_after_start:index_break2_after_end,13),1);
linearFit2_after = polyval(linearCoef2_after,10*log10(new_distances2(index_break2_after_start:index_break2_after_end)));
semilogx(new_distances2(index_break2_after_start:index_break2_after_end),data2{idx}(index_break2_after_start:index_break2_after_end,13),'bx',new_distances2(index_break2_after_start:index_break2_after_end),linearFit2_after,'b-')
%display(sprintf('Run %d :slope 2.6GHz after: %f',idx,linearCoef2_after(1)))
title(sprintf('Run %d: With the data after the passing of the train',idx))
legend('UHF','UHF:linear fitting','2.6GHz card 1','2.6GHz card 1:linear fitting');
xlabel('distance [km]')
ylabel('RSSI [dBm]')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment