Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenXG
OpenXG-RAN
Commits
223c5a8a
Commit
223c5a8a
authored
Jul 23, 2014
by
Byiringi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
git-svn-id:
http://svn.eurecom.fr/openair4G/trunk@5586
818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent
ba29e737
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
170 additions
and
91 deletions
+170
-91
targets/PROJECTS/CORRIDOR/emos_read_v2.m
targets/PROJECTS/CORRIDOR/emos_read_v2.m
+170
-91
No files found.
targets/PROJECTS/CORRIDOR/emos_read_v2.m
View file @
223c5a8a
...
...
@@ -12,8 +12,8 @@ primary_synch; %loads the primary sync signal
%load('E:\EMOS\corridor\ofdm_pilots_sync_2048_v7.mat');
load
(
'ofdm_pilots_sync_30MHz.mat'
);
n_carriers
=
1
;
% use 1 for UHF and 2 for 2.6GHz
n_trials
=
1
;
%use 1 for trial1 and 2 for trial2
n_carriers
=
2
;
% use 1 for UHF and 2 for 2.6GHz
n_trials
=
2
;
%use 1 for trial1 and 2 for trial2
symbols_per_slot
=
6
;
slots_per_frame
=
20
;
...
...
@@ -36,9 +36,9 @@ switch n_carriers
pss_t
=
upsample
(
primary_synch0_time
,
4
*
4
);
% this assumes we are doing the sync on the first 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_run
2
.EMOS';
%filename = 'E:/byiringi/emosFiles/trials1/eNB_data_20140331_2.6GHz_run
1
.EMOS';
%filename = 'E:\EMOS\corridor\trials2\eNB_data_20140519_2.6GHz_run2.EMOS';
filename
=
'E:/byiringi/emosFiles/trials2/eNB_data_20140519_2.6GHz_run
1
.EMOS'
;
filename
=
'E:/byiringi/emosFiles/trials2/eNB_data_20140519_2.6GHz_run
2
.EMOS'
;
nframes
=
50
;
% frames in one block
threshold
=
3e+4
;
% maybe should change that !!!!
...
...
@@ -195,12 +195,21 @@ while ~feof(fid)
if
flag1
==
1
[
corr
,
lag
]
=
xcorr
(
v1
(:,
1
),
pss_t
);
if
(
n_carriers
==
2
)
[
corrb
,
lag
]
=
xcorr
(
v2
(:,
1
),
pss_t
);
end
%[m,idx]=max(abs(corr));
%[m,idx]=peaksfinder(corr,frame_length);
tmp
=
corr
(
nframes
*
slots_per_frame
*
p
(
1
)
.
samples_slot
:
end
);
tmp2
=
reshape
(
tmp
,
slots_per_frame
*
p
(
1
)
.
samples_slot
,
nframes
);
[
m
,
idx
]
=
max
(
abs
(
tmp2
),[],
1
);
if
(
n_carriers
==
2
)
tmp
=
corrb
(
nframes
*
slots_per_frame
*
p
(
2
)
.
samples_slot
:
end
);
tmp2
=
reshape
(
tmp
,
slots_per_frame
*
p
(
2
)
.
samples_slot
,
nframes
);
[
m
,
idx
]
=
max
(
abs
(
tmp2
),[],
1
);
end
idx
(
m
<
threshold
)
=
[];
if
size
(
idx
,
2
)
<=
3
...
...
@@ -208,6 +217,7 @@ while ~feof(fid)
flag2
=
0
;
vStorage1
=
[];
vStorage2
=
[];
% elseif size(idx,2) == nframes
%
% flag1 = 0;
...
...
@@ -219,6 +229,9 @@ while ~feof(fid)
end
frame_offset
=
round
(
median
(
idx
))
-
p
(
1
)
.
prefix_length
;
if
(
n_carriers
==
2
)
frame_offset
=
round
(
median
(
idx
))
-
p
(
2
)
.
prefix_length
;
end
if
enable_plots
>=
2
...
...
@@ -262,8 +275,11 @@ while ~feof(fid)
fprintf
(
1
,
'.'
);
frame_start1
=
(
slots_per_frame
*
p
(
1
)
.
samples_slot
)
*
(
i
-
1
)
+
frame_offset
+
1
;
if
n_carriers
==
2
frame_start2
=
(
slots_per_frame
*
p
(
2
)
.
samples_slot
)
*
(
i
-
1
)
+
round
(
frame_offset
/
2
)
+
1
;
% frame_start2 = (slots_per_frame*p(2).samples_slot)*(i-1)+round(frame_offset/2)+1;
frame_start1
=
(
slots_per_frame
*
p
(
1
)
.
samples_slot
)
*
(
i
-
1
)
+
2
*
frame_offset
+
1
;
frame_start2
=
(
slots_per_frame
*
p
(
2
)
.
samples_slot
)
*
(
i
-
1
)
+
frame_offset
+
1
;
end
if
i
<
nframes
...
...
@@ -313,6 +329,7 @@ while ~feof(fid)
PDP
=
mean
(
abs
(
Ht
)
.^
2
,
1
);
PDP_all
=
squeeze
(
mean
(
mean
(
PDP
,
3
),
4
));
PDD
=
sum
(
abs
(
fftshift
(
fft
(
Ht
,[],
1
)))
.^
2
,
2
);
if
(
carrier
==
1
)
PDP_totala
((
block
-
1
)
*
NFRAMES
+
i
,:,:,:)
=
PDP
;
Ha
=
H
;
...
...
@@ -322,21 +339,21 @@ while ~feof(fid)
PDP_totalb
((
block
-
1
)
*
NFRAMES
+
i
,:,:,:)
=
PDP
;
Hb
=
H
;
end
%
% Hprime=H*exp(2*i*pi*167E-6*f_offset);
% Htprime = ifft(Hprime,[],2); %impulse response
% PDPprime = mean(abs(Htprime).^2,1);
%
% PDDprime=sum(abs(fftshift(fft(Htprime,[],1))).^2,2);
% if(carrier==1)
% PDP_totala((block-1)*NFRAMES+i,:,:,:) = PDP;
% Ha=H;
% end
%
% if(carrier==2)
% PDP_totalb((block-1)*NFRAMES+i,:,:,:) = PDP;
% Hb=H;
% end
%
% Hprime=H*exp(2*i*pi*167E-6*f_offset);
% Htprime = ifft(Hprime,[],2); %impulse response
% PDPprime = mean(abs(Htprime).^2,1);
%
% PDDprime=sum(abs(fftshift(fft(Htprime,[],1))).^2,2);
% if(carrier==1)
% PDP_totala((block-1)*NFRAMES+i,:,:,:) = PDP;
% Ha=H;
% end
%
% if(carrier==2)
% PDP_totalb((block-1)*NFRAMES+i,:,:,:) = PDP;
% Hb=H;
% end
if
enable_plots
>=
1
figure
(
3
+
3
*
(
carrier
-
1
))
...
...
@@ -389,6 +406,8 @@ while ~feof(fid)
drawnow
end
if
(
n_carriers
==
1
)
if
carrier
==
1
% adjust frame offset base on channel estimate to compensate for
% timing drift. We try to keep the peak of the impulse response at
...
...
@@ -402,6 +421,26 @@ while ~feof(fid)
frame_offset
=
frame_offset
+
round
(
offset
/
4
);
end
end
end
if
(
n_carriers
==
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.
[
m
,
idx
]
=
max
(
fft
(
ifft
(
PDP_all
),
p
(
carrier
)
.
num_carriers
));
offset
=
idx
-
p
(
carrier
)
.
prefix_length
/
8
;
if
offset
>
p
(
carrier
)
.
prefix_length
offset
=
offset
-
p
(
carrier
)
.
num_carriers
;
end
if
abs
(
offset
)
>
5
frame_offset
=
frame_offset
+
round
(
offset
/
4
);
end
end
end
end
H1a
=
cat
(
1
,
H1a
,
Ha
);
...
...
@@ -416,10 +455,11 @@ while ~feof(fid)
Ht1a
=
ifft
(
H1a
,[],
2
);
PDD1a
=
sum
(
abs
(
fftshift
(
fft
(
Ht1a
,[],
1
)))
.^
2
,
2
);
delayPDD1a
=
abs
(
fftshift
(
fft
(
Ht1a
,[],
1
)))
.^
2
;
if
(
n_carriers
==
2
)
Ht1b
=
ifft
(
H1b
,[],
2
);
PDD1b
=
sum
(
abs
(
fftshift
(
fft
(
Ht1b
,[],
1
)))
.^
2
,
2
);
delayPDD1b
=
abs
(
fftshift
(
fft
(
Ht1b
,[],
1
)))
.^
2
;
end
if
(
enable_plots
>=
2
)
...
...
@@ -460,10 +500,49 @@ while ~feof(fid)
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
PDD_totala
(:,
block
,:,:)
=
PDD1a
;
if
(
n_carriers
==
2
)
PDD_totalb
(:,
block
,:,:)
=
PDD1b
;
end
...
...
@@ -570,8 +649,8 @@ end
%%
if
(
enable_plots
>=
2
)
figure
(
11
)
for
itx
=
1
:
p
(
1
)
.
nant_tx
figure
(
11
)
for
itx
=
1
:
p
(
1
)
.
nant_tx
for
irx
=
1
:
p
(
1
)
.
nant_rx
T
=
1
:
1
:
block
-
1
;
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
;
...
...
@@ -587,9 +666,9 @@ for itx=1:p(1).nant_tx
ylabel
(
'F=f-ftx [Hz]'
)
xlabel
(
'time [s]'
)
end
end
end
if
(
n_carriers
==
2
)
if
(
n_carriers
==
2
)
figure
(
12
)
for
itx
=
1
:
p
(
2
)
.
nant_tx
for
irx
=
1
:
p
(
2
)
.
nant_rx
...
...
@@ -605,7 +684,7 @@ if(n_carriers==2)
xlabel
(
'time [s]'
)
end
end
end
end
end
%% Mean Delay
...
...
@@ -717,7 +796,7 @@ figure(17)
title
(
''
);
plot
(
doppler_freq_of_max_a
);
xlabel
(
'time [s]'
);
ylabel
(
'f-ftx [Hz]'
);
ylabel
(
'f-ftx [Hz]'
);
if
(
n_carriers
==
2
)
figure
(
18
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment