Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
OAI-RAN-5G-sheduler_MaxTBS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MAQ5G-PFC
OAI-RAN-5G-sheduler_MaxTBS
Commits
223c5a8a
Commit
223c5a8a
authored
11 years ago
by
Byiringi
Browse files
Options
Downloads
Patches
Plain Diff
git-svn-id:
http://svn.eurecom.fr/openair4G/trunk@5586
818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent
ba29e737
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
targets/PROJECTS/CORRIDOR/emos_read_v2.m
+170
-91
170 additions, 91 deletions
targets/PROJECTS/CORRIDOR/emos_read_v2.m
with
170 additions
and
91 deletions
targets/PROJECTS/CORRIDOR/emos_read_v2.m
+
170
−
91
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
;
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment