Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG UE
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
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
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
Michael Black
OpenXG UE
Commits
ff30b76e
Commit
ff30b76e
authored
Nov 19, 2013
by
Florian Kaltenberger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
git-svn-id:
http://svn.eurecom.fr/openair4G/trunk@4435
818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent
b6bee922
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
53 additions
and
33 deletions
+53
-33
targets/PROJECTS/TDDREC/initparams.m
targets/PROJECTS/TDDREC/initparams.m
+3
-3
targets/PROJECTS/TDDREC/runmeas_full_duplex.m
targets/PROJECTS/TDDREC/runmeas_full_duplex.m
+16
-13
targets/PROJECTS/TDDREC/runmeas_long_chanest.m
targets/PROJECTS/TDDREC/runmeas_long_chanest.m
+34
-17
No files found.
targets/PROJECTS/TDDREC/initparams.m
View file @
ff30b76e
...
...
@@ -30,14 +30,14 @@ autocal_mode=active_rf;
%rf_mode=(TXLPFNORM+TXLPFEN+TXLPF25+RXLPFNORM+RXLPFEN+RXLPF25+LNA1ON+LNAMax+RFBBNORM) * active_rf;
% we have to enable both DMA transfers so that the switching signal in the LSB of the TX buffer gets set
rf_mode
=
(
TXLPFNORM
+
TXLPFEN
+
TXLPF25
+
RXLPFNORM
+
RXLPFEN
+
RXLPF25
+
LNA1ON
+
LNAMax
+
RFBBNORM
+
DMAMODE_TX
+
TXEN
+
DMAMODE_RX
+
RXEN
)
*
active_rf
;
tdd_config
=
DUPLEXMODE_FDD
+
TXRXSWITCH_LSB
;
LSBSWITCH_FLAG
=
false
;
%we also need the LSB switching for the woduplex script, otherwise we don't receive anything
%tdd_config = DUPLEXMODE_FDD+TXRXSWITCH_LSB;
LSBSWITCH_FLAG=true;
tdd_config
=
DUPLEXMODE_FDD
+
TXRXSWITCH_LSB
;
%we also need the LSB switching for the woduplex script, otherwise we don't receive anything
%tdd_config = DUPLEXMODE_FDD+TXRXSWITCH_LSB;
syncmode
=
SYNCMODE_FREE
;
rf_local
=
[
8254744
8255063
8257340
8257340
];
%eNB2tx 1.9GHz
rf_vcocal
=
rf_vcocal_19G
*
active_rf
;
rffe_rxg_low
=
63
*
active_rf
;
rffe_rxg_final
=
[
30
40
30
2
0
];
rffe_rxg_final
=
[
30
30
30
3
0
];
rffe_band
=
B19G_TDD
*
active_rf
;
rf_rxdc
=
rf_rxdc
*
active_rf
;
...
...
targets/PROJECTS/TDDREC/runmeas_full_duplex.m
View file @
ff30b76e
...
...
@@ -2,7 +2,7 @@
% Organisation: Eurecom (and Linkoping University)
% E-mail: mirsad.cirkic@liu.se
if
(
paramsinitialized
&&
~
LSBSWITCH_FLAG
)
if
(
paramsinitialized
)
disp
([
'\n\n------------\nThis code is, so far, only written for single runs. Multiple '
...
'runs will overwrite the previous measurement data, i.e., the '
...
'data structures are not defined for multiple runs. You will need to '
...
...
...
@@ -115,9 +115,9 @@ if(paramsinitialized && ~LSBSWITCH_FLAG)
end
HB2A
=
conj
(
repmat
(
Db2a_T
,
Niter
,
1
))
.*
repmat
(
Db2a_R
(:,:,
meas
),
1
,
Nantb
);
phasesB2A
=
unwrap
(
angle
(
HB2A
));
if
(
mean
(
var
(
phasesB2A
))
>
0.5
)
disp
(
'The phases of your estimates from B to A are a bit high (larger than 0.5 rad.), something is wrong.'
);
end
#
if
(
mean
(
var
(
phasesB2A
))
>
0.5
)
#
disp
(
'The phases of your estimates from B to A are a bit high (larger than 0.5 rad.), something is wrong.'
);
#
end
if
(
chanest_full
)
chanestsB2A
(:,:,
meas
)
=
zeros
(
301
,
Nantb
);
...
...
@@ -140,15 +140,17 @@ if(paramsinitialized && ~LSBSWITCH_FLAG)
end
%% -- Some plotting code -- %% (you can uncomment what you see fit)
received
=
receivedB2A
;
received
=
[
receivedB2A
(:,
indA
)
receivedA2B
(:,
indB
)]
;
phases
=
phasesB2A
;
tchanests
=
[
tchanestsA2B
(:,:,
end
),
tchanestsB2A
(:,:,
end
)];
fchanests
=
[
fchanestsA2B
(:,:,
end
),
fchanestsB2A
(:,:,
end
)];
clf
figure
(
1
)
for
i
=
1
:
4
subplot
(
220
+
i
);
plot
(
20
*
log10
(
abs
(
fftshift
(
fft
(
received
(:,
i
))))));
for
i
=
1
:
size
(
received
,
2
);
subplot
(
220
+
i
);
plot
(
20
*
log10
(
abs
(
fftshift
(
fft
(
received
(:,
i
))))));
ylim
([
20
140
])
end
figure
(
2
)
...
...
@@ -159,7 +161,7 @@ if(paramsinitialized && ~LSBSWITCH_FLAG)
legend
(
'A->B1'
,
'A->B2'
,
'A->B3'
,
'B1->A'
,
'B2->A'
,
'B3->A'
);
%legend('A->B1','A->B2','B1->A','B2->A');
figure
(
4
)
figure
(
3
)
plot
(
20
*
log10
(
abs
(
fchanests
)));
ylim
([
40
100
])
xlabel
(
'freq'
)
...
...
@@ -168,7 +170,7 @@ if(paramsinitialized && ~LSBSWITCH_FLAG)
%legend('A->B1','A->B2','B1->A','B2->A');
if
(
0
)
figure
(
3
)
figure
(
4
)
wndw
=
50
;
for
i
=
1
:
5
:
Nantb
*
301
%# sliding window size
phamean
=
filter
(
ones
(
wndw
,
1
)/
wndw
,
1
,
phases
(:,
i
));
%# moving average
...
...
@@ -203,15 +205,16 @@ if(paramsinitialized && ~LSBSWITCH_FLAG)
end
figure
(
5
)
plot_style
=
{
'rx'
,
'
bo'
,
'g
s'
};
plot_style
=
{
'rx'
,
'
go'
,
'b
s'
};
hold
off
for
n
=
1
:
Nantb
plot
((
squeeze
(
Fhatloc
(:,:,
n
))),
plot_style
{
n
})
hold
on
end
axis
([
-
2
2
-
2
2
])
disp
(
squeeze
(
mean
(
Fhatloc
,
2
)));
else
if
(
LSBSWITCH_FLAG
)
error
(
'You have to unset the LSB switch flag (LSBSWITCH_FLAG) in initparams.m.\n'
)
else
error
(
'You have to run init.params.m first!'
)
end
error
(
'You have to run init.params.m first!'
)
end
targets/PROJECTS/TDDREC/runmeas_long_chanest.m
View file @
ff30b76e
...
...
@@ -2,7 +2,7 @@
% Organisation: Eurecom (and Linkoping University)
% E-mail: mirsad.cirkic@liu.se
if
(
paramsinitialized
&&
~
LSBSWITCH_FLAG
)
if
(
paramsinitialized
)
disp
([
'\n\n------------\nThis code is, so far, only written for single runs. Multiple '
...
'runs will overwrite the previous measurement data, i.e., the '
...
'data structures are not defined for multiple runs. You will need to '
...
...
...
@@ -27,6 +27,7 @@ if(paramsinitialized && ~LSBSWITCH_FLAG)
%% ------- Prepare the signals for A2B ---------- %%
signalA2B
=
zeros
(
N
,
4
,
Nmeas
);
signalB2A
=
zeros
(
N
,
4
,
Nmeas
);
Da2b_T
=
[];
Db2a_T
=
[];
for
meas
=
1
:
Nmeas
ia
=
1
;
ib
=
1
;
...
...
@@ -34,7 +35,8 @@ if(paramsinitialized && ~LSBSWITCH_FLAG)
for
i
=
1
:
4
if
(
indA
(
ia
)
==
i
)
[
tmpd
,
tmps
]
=
genrandpskseq
(
N
,
M
,
amp
);
signalA2B
(:,
i
,
meas
)
=
tmps
;
%make sure LSB is 0 (switch=tx)
signalA2B
(:,
i
,
meas
)
=
tmps
*
2
;
%make sure LSB is 0 (switch=tx)
signalB2A
(:,
i
,
meas
)
=
repmat
(
1
+
1
j
,
76800
,
1
);
%make sure LSB is 1 (switch=rx)
Dtmp
=
[
Dtmp
tmpd
];
if
(
length
(
indA
)
>
ia
)
ia
=
ia
+
1
;
end
end
...
...
@@ -118,9 +120,9 @@ if(paramsinitialized && ~LSBSWITCH_FLAG)
%% ------- Do the B to A channel estimation ------- %%
HB2A
=
conj
(
Db2a_T
.*
repmat
(
Db2a_R
,
1
,
Nantb
));
phasesB2A
=
unwrap
(
angle
(
HB2A
));
if
(
mean
(
var
(
phasesB2A
))
>
0.5
)
disp
(
'The phases of your estimates from B to A are a bit high (larger than 0.5 rad.), something is wrong.'
);
end
#
if
(
mean
(
var
(
phasesB2A
))
>
0.5
)
#
disp
(
'The phases of your estimates from B to A are a bit high (larger than 0.5 rad.), something is wrong.'
);
#
end
if
(
chanest_full
)
chanestsB2A
=
zeros
(
301
,
Nantb
);
...
...
@@ -141,20 +143,18 @@ if(paramsinitialized && ~LSBSWITCH_FLAG)
fchanestsB2A
=
[
zeros
(
1
,
Nantb
);
chanestsB2A
([
1
:
150
],:);
zeros
(
210
,
Nantb
);
chanestsB2A
(
151
:
301
,:)];
tchanestsB2A
=
ifft
(
fchanestsB2A
);
% save *chanests*
% save DA2B_T DA2B_R DB2A_T DB2A_R in seperate file
%% -- Some plotting code -- %% (you can uncomment what you see fit)
received
=
receivedB2A
;
received
=
[
receivedB2A
(:,
indA
)
receivedA2B
(:,
indB
)]
;
phases
=
phasesB2A
;
tchanests
=
[
tchanestsA2B
(:,:,
end
),
tchanestsB2A
(:,:,
end
)];
fchanests
=
[
fchanestsA2B
(:,:,
end
),
fchanestsB2A
(:,:,
end
)];
clf
figure
(
1
)
for
i
=
1
:
4
subplot
(
220
+
i
);
plot
(
20
*
log10
(
abs
(
fftshift
(
fft
(
received
(:,
i
))))));
for
i
=
1
:
size
(
received
,
2
)
subplot
(
220
+
i
);
plot
(
20
*
log10
(
abs
(
fftshift
(
fft
(
received
(:,
i
))))));
ylim
([
20
140
])
end
figure
(
2
)
...
...
@@ -165,7 +165,7 @@ if(paramsinitialized && ~LSBSWITCH_FLAG)
legend
(
'A->B1'
,
'A->B2'
,
'A->B3'
,
'B1->A'
,
'B2->A'
,
'B3->A'
);
%legend('A->B1','A->B2','B1->A','B2->A');
figure
(
4
)
figure
(
3
)
plot
(
20
*
log10
(
abs
(
fchanests
)));
ylim
([
40
100
])
xlabel
(
'freq'
)
...
...
@@ -174,7 +174,7 @@ if(paramsinitialized && ~LSBSWITCH_FLAG)
%legend('A->B1','A->B2','B1->A','B2->A');
if
(
0
)
figure
(
3
)
figure
(
4
)
wndw
=
50
;
for
i
=
1
:
5
:
Nantb
*
301
%# sliding window size
phamean
=
filter
(
ones
(
wndw
,
1
)/
wndw
,
1
,
phases
(:,
i
));
%# moving average
...
...
@@ -197,8 +197,25 @@ if(paramsinitialized && ~LSBSWITCH_FLAG)
ylabel
(
'phase variance'
)
end
else
if
(
LSBSWITCH_FLAG
)
error
(
'You have to unset the LSB switch flag (LSBSWITCH_FLAG) in initparams.m.\n'
)
else
error
(
'You have to run init.params.m first!'
)
%% estimate F matrix assuming it is diagonal for sanity checking
Fhatloc
=
zeros
(
301
,
Nantb
);
for
s
=
1
:
301
ya
=
chanestsB2A
(
s
,:);
yb
=
chanestsA2B
(
s
,:);
Fhatloc
(
s
,:)
=
(
yb
.*
conj
(
ya
))
.
/(
ya
.*
conj
(
ya
));
end
figure
(
5
)
plot_style
=
{
'rx'
,
'go'
,
'bs'
};
hold
off
for
n
=
1
:
Nantb
plot
((
squeeze
(
Fhatloc
(:,
n
))),
plot_style
{
n
})
hold
on
end
axis
([
-
2
2
-
2
2
])
disp
(
squeeze
(
mean
(
Fhatloc
,
1
)));
else
error
(
'You have to run init.params.m first!'
)
end
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