Commit 2fa26a00 authored by Xiwen JIANG's avatar Xiwen JIANG

preparation for WSA Berlin demo

parent e956a3e9
......@@ -1409,7 +1409,7 @@ x0[1+*jj]);
// mapping ue specific beamforming weights from UE specified DLSCH structure to common space
for (aa=0;aa<frame_parms->nb_antennas_tx;aa++) {
//phy_vars_eNB->common_vars.beam_weights[0][5][aa][re_off+re] = phy_vars_eNB->dlsch[0][0]->ue_spec_bf_weights[0][aa][re_off+re];
phy_vars_eNB->common_vars.beam_weights[0][5][aa][re_off+re] = phy_vars_eNB->dlsch[0][0]->ue_spec_bf_weights[0][aa][385];
phy_vars_eNB->common_vars.beam_weights[0][5][aa][re_off+re] = phy_vars_eNB->dlsch[0][0]->ue_spec_bf_weights[0][aa][395];
//printf("allocate_REs_in_RB: phy_vars_eNB->common_vars.beam_weights[0][5][%d][%d,%d]=%d, phy_vars_eNB->dlsch[0][0]->ue_spec_bf_weights[0][%d][%d]=%d\n", aa, re_off,re, phy_vars_eNB->common_vars.beam_weights[0][5][aa][re_off+re], aa, re_off+re, phy_vars_eNB->dlsch[0][0]->ue_spec_bf_weights[0][aa][re_off+re]);
}
......
......@@ -43,7 +43,7 @@ void estimate_DLCSI_from_ULCSI(int32_t **calib_dl_ch_estimates, LTE_eNB_PUSCH *p
uint8_t shift;
int32_t **ul_ch_estimates = pusch_vars->drs_ch_estimates[eNB_id];
int *ulsch_power = pusch_vars->ulsch_power;
int beta = 1.2;
int beta = 1;
for (aa=0; aa<frame_parms->nb_antennas_tx; aa++) {
shift = log2_approx(ulsch_power[aa]*beta)>>1;
......
......@@ -3000,8 +3000,7 @@ void phy_procedures_eNB_uespec_RX(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,const
((fp->tdd_config == 5) && (subframe == 2)) ||
((fp->tdd_config == 6) && ((subframe == 4) || (subframe == 8))))) {
LOG_I(PHY, "UE %d: Estimating DLSCI from ULCSI based on TDD reciprocity calibration: Estimating DLSCI from ULCSI based on TDD reciprocity calibration\n", i);
//printf(PHY, "UE %d: Estimating DLSCI from ULCSI based on TDD reciprocity calibration: Estimating DLSCI from ULCSI based on TDD reciprocity calibration\n", i);
//LOG_I(PHY, "UE %d: Estimating DLSCI from ULCSI based on TDD reciprocity calibration: Estimating DLSCI from ULCSI based on TDD reciprocity calibration\n", i);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_ULCSI_TO_DLCSI,1);
estimate_DLCSI_from_ULCSI(eNB->dlsch[i][0]->calib_dl_ch_estimates,
......
......@@ -67,6 +67,8 @@ double t_rx_min = 1000000000; /*!< \brief initial min process time for rx */
int n_tx_dropped = 0; /*!< \brief initial max process time for tx */
int n_rx_dropped = 0; /*!< \brief initial max process time for rx */
char tdd_recip_calib_file[1024];
void handler(int sig)
{
void *array[10];
......
......@@ -124,6 +124,7 @@ int main(int argc, char **argv)
//int32_t **cell_spec_bf_weights;
int32_t *ue_spec_bf_weights;
uint8_t tdd_calib=0;
char tdd_recip_calib_file[1024];
int eNB_id = 0, eNB_id_i = 1;
unsigned char mcs1=0,mcs2=0,mcs_i=0,dual_stream_UE = 0,awgn_flag=0,round,dci_flag=0;
......@@ -2170,10 +2171,16 @@ PMI_FEEDBACK:
}
estimate_DLCSI_from_ULCSI(eNB->dlsch[0][0]->calib_dl_ch_estimates,
/*estimate_DLCSI_from_ULCSI(eNB->dlsch[0][0]->calib_dl_ch_estimates,
&eNB->pusch_vars[0]->drs_ch_estimates[0][0],//position of second DMRS
eNB->common_vars.tdd_calib_coeffs[0],
frame_parms);
frame_parms);*/
estimate_DLCSI_from_ULCSI(eNB->dlsch[0][0]->calib_dl_ch_estimates,
eNB->pusch_vars[0],//position of second DMRS
eNB->common_vars.tdd_calib_coeffs[0],
frame_parms,
0);
compute_BF_weights(eNB->dlsch[0][0]->ue_spec_bf_weights[0],
eNB->dlsch[0][0]->calib_dl_ch_estimates,
......
......@@ -4,8 +4,8 @@ d_N_ant_act = sum(v_active_rf);
%** mapping useful data to favorable carriers **
m_sym_T_ext = zeros(d_N_FFT,d_N_OFDM,d_N_ant_act);
m_sym_T_ext(362:512,:,:) = m_sym_T(1:151,:,:);
m_sym_T_ext(2:151,:,:) = m_sym_T(152:301,:,:);
m_sym_T_ext(363:512,:,:) = m_sym_T(1:150,:,:);
m_sym_T_ext(2:151,:,:) = m_sym_T(151:300,:,:);
%** ifft **
m_sig_T_ = sqrt(d_N_FFT)*ifft(m_sym_T_ext,d_N_FFT,1);
......
......@@ -41,6 +41,6 @@ m_sig_R_noCP = m_sig_R_f(d_N_CP+1:end,:,:);
%** fft **
%m_sym_R_fft = fft(m_sig_R_noCP,d_N_FFT,1);
m_sym_R_fft = 1/sqrt(d_N_FFT)*fft(m_sig_R_noCP,d_N_FFT,1);
m_sym_R = m_sym_R_fft([362:512 2:151],:,:);
m_sym_R = m_sym_R_fft([363:512 2:151],:,:);
end
......@@ -45,8 +45,8 @@ m_sym_T = v_MPSK(ceil(rand(d_N_f, d_N_OFDM, d_N_ant_act)*d_M));
%** mapping useful data to favorable carriers **
m_sym_T_ext = zeros(d_N_FFT,d_N_OFDM,d_N_ant_act);
m_sym_T_ext(362:512,:,:) = m_sym_T(1:151,:,:);
m_sym_T_ext(2:151,:,:) = m_sym_T(152:301,:,:);
m_sym_T_ext(363:512,:,:) = m_sym_T(1:150,:,:);
m_sym_T_ext(2:151,:,:) = m_sym_T(151:300,:,:);
%** ifft **
m_sig_T_ = sqrt(d_N_FFT)*ifft(m_sym_T_ext,d_N_FFT,1);
......
%
% PURPOSE : TLS solution for AX = B based on alternative projection
%
% ARGUMENTS :
%
% A : observation of A
% B : observation of B
%
% OUTPUTS :
%
% X : TLS solution for X
%
%**********************************************************************************************
% EURECOM - All rights reserved
%
% AUTHOR : Xiwen JIANG, Florian Kaltenberger
%
% DEVELOPMENT HISTORY :
%
% Date Name(s) Version Description
% ----------- ------------- ------- ------------------------------------------------------
% Mai-05-2014 X. JIANG 0.1 creation of code
%
% REFERENCES/NOTES/COMMENTS :
%
% - none.
%
%**********************************************************************************************
function [X_est A_est B_est] = f_tls_ap(A,B)
%** initlisation **
e_new = 0;
e_old = 1e14;
e_thr = 1e-5; %error threshold: what if the error cannot fall down under the error threshold
X_est = eye(size(A,2));
A_est = A;
%** alternative projection **
while(abs(e_new-e_old)>e_thr)
e_old = e_new;
% optimise X_est
X_est = (A_est'*A_est)\A_est'*B;
%optimise A_est
A_est = B*X_est'/(X_est*X_est');
e_new = norm(A_est*X_est-B)^2+norm(A_est-A)^2;
end
B_est = A_est*X_est;
end
\ No newline at end of file
......@@ -142,9 +142,9 @@ v_SNR_ideal = nan(d_N_f+1,1);
v_SNR_iden = nan(d_N_f+1,1);
v_SNR_diag = nan(d_N_f+1,1) ;
v_SNR_ideal([1:151 153:302]) = v_SNR_ideal_([1:151 152:301]);
v_SNR_iden([1:151 153:302]) = v_SNR_iden_([1:151 152:301]) ;
v_SNR_diag([1:151 153:302]) = v_SNR_diag_([1:151 152:301]) ;
v_SNR_ideal([1:150 152:301]) = v_SNR_ideal_([1:150 152:301]);
v_SNR_iden([1:150 152:301]) = v_SNR_iden_([1:150 152:301]) ;
v_SNR_diag([1:150 152:301]) = v_SNR_diag_([1:150 152:301]) ;
%save('-v7','result/bf_gain_4x1_t3.mat','v_SNR_ideal','v_SNR_iden','v_SNR_diag','v_SNR_full');
%% -------- plot --------
......
......@@ -38,7 +38,7 @@
d_M = 4; % modulation order, e.g. 4 means QPSK
%** frequency **
d_N_f = 301; % carrier number carrying data
d_N_f = 300; % carrier number carrying data
d_N_FFT = 512; % total carrier number
d_N_CP = 128; % extented cyclic prefix
%** time **
......@@ -93,8 +93,8 @@ end
m_F_norm = zeros(d_N_antM+1, d_N_f);
m_F_norm(1, :) = mean(m_F(1, :),2);
m_F_norm(2, :) = mean(m_F(2, :),2);
m_F_norm(3, :) = 1;
m_F_norm = m_F_norm./max(max(abs(m_F_norm)))*0.99;
m_F_norm(3, :) = 1+0.0001i;
m_F_norm = m_F_norm./abs(m_F_norm)*0.99;
%keyboard
......@@ -109,27 +109,23 @@ dlmwrite('result/calibF.mtx', m_F_Q15,' ');
%% ** plot **
figure(11)
hold on;
for d_f=1:d_N_f
plot(m_F(1,d_f),'bo')
plot(m_F(2,d_f),'ro')
end
hold off;
title('Diagonal F');
axis([-3 3 -3 3])
grid on
figure(12)
hold on;
for d_f=1:d_N_f
plot(m_F_norm(1,d_f),'bo')
plot(m_F_norm(2,d_f),'ro')
plot(m_F_norm(3,d_f)+0.000001*1i,'ko')
plot(m_F_norm(3,d_f),'ko')
end
hold off;
title('Diagonal F');
axis([-2 2 -2 2])
grid on
%figure(12)
%hold on;
%for d_f=1:d_N_f
% plot(m_F_(1,1,d_f),'bo')
% plot(m_F_(2,1,d_f),'ro')
%% plot(m_F_(1,3,d_f),'gx')
%% plot(m_F_(2,3,d_f),'yx')
%% plot(m_F_(1,5,d_f),'c+')
%% plot(m_F_(2,5,d_f),'m+')
%end
%hold off;
%title('Diagonal F');
%axis([-2 2 -2 2])
%grid on
......@@ -20,8 +20,8 @@ freq_tx = fc*active_rf;
freq_rx = (fc+fs/4)*active_rf;
tdd_config = DUPLEXMODE_FDD+TXRXSWITCH_LSB; %we need the LSB switching for the woduplex script, otherwise we don't receive anything
rx_gain = [10 10 10 0];%10*active_rf;
tx_gain = [10 10 10 0];%10*active_rf;
rx_gain = 5*active_rf;
tx_gain = [10 0 5 0];%5*active_rf;
%rx_gain = 20*active_rf;
%tx_gain = 20*active_rf;
syncmode = SYNCMODE_FREE;
......
[*]
[*] GTKWave Analyzer v3.3.58 (w)1999-2014 BSI
[*] Wed Jan 18 09:49:05 2017
[*] Mon Mar 13 16:06:02 2017
[*]
[dumpfile] "/tmp/openair_dump_eNB.vcd"
[dumpfile_mtime] "Wed Jan 18 09:43:36 2017"
[dumpfile_size] 892531
[dumpfile_mtime] "Mon Mar 13 15:17:44 2017"
[dumpfile_size] 718017266
[savefile] "/homes/jiangx/openair5G/openairinterface5g/targets/RT/USER/eNB_exmimo2.gtkw"
[timestart] 21256800000
[size] 1615 1026
[pos] -1 -1
*-22.787832 21257630000 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
[timestart] 0
[size] 1301 744
[pos] -1 -117
*-36.091209 21257630000 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
[sst_width] 374
[signals_width] 262
[sst_expanded] 1
[sst_vpaned_height] 262
@25
@24
variables.frame_number_TX0_eNB[63:0]
variables.frame_number_TX1_eNB[63:0]
variables.subframe_number_TX0_eNB[63:0]
......@@ -42,5 +42,8 @@ functions.udp_enb_task
functions.phy_eNB_slot_fep
functions.phy_eNB_ofdm_mod_l
functions.phy_eNB_beam_precoding
functions.phy_eNB_ulcsi_to_dlsci
@29
functions.phy_eNB_compute_bf_weight
[pattern_trace] 1
[pattern_trace] 0
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