Commit c1824f07 authored by Ben Wojtowicz's avatar Ben Wojtowicz

version 00.05

parent 007779dc
......@@ -7,4 +7,11 @@ v00.03 Octave release with support for PDSCH transmission and
reception for SIB1 encoding/decoding. This includes
turbo encoding/decoding.
v00.04 First release with C++ gnuradio support. Contains PSS
SSS, CRS, and PBCH reception for FDD in C++ for gnuradio.
\ No newline at end of file
SSS, CRS, and PBCH reception for FDD in C++ for gnuradio.
v00.05 C++ changes: Fixed bug in frequency offset removal,
added PDSCH reception for SIB1 decoding (including turbo
decoding).
Octave changes: Fixed bug in 3 antenna spacial multiplexing
(lte_layer_mapper). Fixed bug in 16QAM
(lte_modulation_mapper). Fixed parameter conversions in
SIB1 unpacking.
......@@ -73,9 +73,7 @@ MOSTLYCLEANFILES += $(DEPDIR)/*.S*
## .h file is sometimes built, but not always ... so that one has to
## be added manually by the including Makefile.am .
swig_built_sources += \
src/LTE_fdd_dl_fs.py \
src/LTE_fdd_dl_fs.cc
swig_built_sources += src/LTE_fdd_dl_fs.py src/LTE_fdd_dl_fs.cc
STD_SWIG_PYTHON_ARGS += -outdir src
......@@ -83,36 +81,36 @@ STD_SWIG_PYTHON_ARGS += -outdir src
## Makefile.am by setting the variable value there, then including
## Makefile.swig .
LTE_fdd_dl_fs_swiginclude_HEADERS = \
src/LTE_fdd_dl_fs.i \
LTE_fdd_dl_fs_swiginclude_HEADERS = \
src/LTE_fdd_dl_fs.i \
$(LTE_fdd_dl_fs_swiginclude_headers)
LTE_fdd_dl_fs_pylib_LTLIBRARIES = \
LTE_fdd_dl_fs_pylib_LTLIBRARIES = \
_LTE_fdd_dl_fs.la
_LTE_fdd_dl_fs_la_SOURCES = \
src/LTE_fdd_dl_fs.cc \
_LTE_fdd_dl_fs_la_SOURCES = \
src/LTE_fdd_dl_fs.cc \
$(LTE_fdd_dl_fs_la_swig_sources)
_LTE_fdd_dl_fs_la_LIBADD = \
_LTE_fdd_dl_fs_la_LIBADD = \
$(STD_SWIG_LA_LIB_ADD) \
$(LTE_fdd_dl_fs_la_swig_libadd)
_LTE_fdd_dl_fs_la_LDFLAGS = \
_LTE_fdd_dl_fs_la_LDFLAGS = \
$(STD_SWIG_LA_LD_FLAGS) \
$(LTE_fdd_dl_fs_la_swig_ldflags)
_LTE_fdd_dl_fs_la_CXXFLAGS = \
_LTE_fdd_dl_fs_la_CXXFLAGS = \
$(STD_SWIG_CXX_FLAGS) \
$(LTE_fdd_dl_fs_la_swig_cxxflags)
LTE_fdd_dl_fs_python_PYTHON = \
src/LTE_fdd_dl_fs.py \
LTE_fdd_dl_fs_python_PYTHON = \
src/LTE_fdd_dl_fs.py \
$(LTE_fdd_dl_fs_python)
## Entry rule for running SWIG
src/LTE_fdd_dl_fs.h src/LTE_fdd_dl_fs.py src/LTE_fdd_dl_fs.c: src/LTE_fdd_dl_fs.i
src/LTE_fdd_dl_fs.h src/LTE_fdd_dl_fs.py src/LTE_fdd_dl_fs.cc: src/LTE_fdd_dl_fs.i
## This rule will get called only when MAKE decides that one of the
## targets needs to be created or re-created, because:
##
......
......@@ -25,6 +25,8 @@
Revision History
---------- ------------- --------------------------------------------
03/23/2012 Ben Wojtowicz Created file.
04/21/2012 Ben Wojtowicz Fixed bug in frequency offset removal, added
PDSCH decode, general cleanup
*******************************************************************************/
......@@ -93,24 +95,34 @@ int32 LTE_fdd_dl_fs_samp_buf::work(int32 ninput_items,
gr_vector_const_void_star &input_items,
gr_vector_void_star &output_items)
{
LIBLTE_PHY_SLOT_STRUCT slot;
LIBLTE_RRC_MIB_STRUCT mib;
const int8 *in = (const int8 *)input_items[0];
float freq_offset;
float f_samp_re;
float f_samp_im;
float pss_thresh;
uint32 i;
uint32 sfn;
uint32 symb_starts[7];
uint32 N_id_cell;
uint32 N_id_1;
uint32 N_id_2;
uint32 pss_symb;
uint32 frame_start_idx;
uint32 offset;
uint8 sfn_offset;
uint8 N_ant;
LIBLTE_PHY_SUBFRAME_STRUCT subframe;
LIBLTE_PHY_PCFICH_STRUCT pcfich;
LIBLTE_PHY_PHICH_STRUCT phich;
LIBLTE_PHY_PDCCH_STRUCT pdcch;
LIBLTE_RRC_MIB_STRUCT mib;
LIBLTE_RRC_SYS_INFO_BLOCK_TYPE_1_STRUCT sib1;
const int8 *in = (const int8 *)input_items[0];
float freq_offset;
float f_samp_re;
float f_samp_im;
float pss_thresh;
float tmp_i;
float tmp_q;
float phich_res;
uint32 i;
uint32 j;
uint32 sfn;
uint32 symb_starts[7];
uint32 N_id_cell;
uint32 N_id_1;
uint32 N_id_2;
uint32 pss_symb;
uint32 frame_start_idx;
uint32 N_rb_dl = LIBLTE_PHY_N_RB_DL_1_4MHZ;
uint32 FFT_pad_size = LIBLTE_PHY_FFT_PAD_SIZE_1_4MHZ;
uint32 offset;
uint8 sfn_offset;
uint8 N_ant;
if(samp_buf_idx < (LTE_FDD_DL_FS_SAMP_BUF_SIZE-((ninput_items+1)/2)))
{
......@@ -145,10 +157,12 @@ int32 LTE_fdd_dl_fs_samp_buf::work(int32 ninput_items,
// Correct frequency error
for(i=0; i<LTE_FDD_DL_FS_SAMP_BUF_SIZE; i++)
{
f_samp_re = cosf(i*(-freq_offset)*2*M_PI*(0.0005/15360));
f_samp_im = sinf(i*(-freq_offset)*2*M_PI*(0.0005/15360));
i_buf[i] = i_buf[i]*f_samp_re + q_buf[i]*f_samp_im;
q_buf[i] = q_buf[i]*f_samp_re - i_buf[i]*f_samp_im;
f_samp_re = cosf((i+1)*(-freq_offset)*2*M_PI*(0.0005/15360));
f_samp_im = sinf((i+1)*(-freq_offset)*2*M_PI*(0.0005/15360));
tmp_i = i_buf[i];
tmp_q = q_buf[i];
i_buf[i] = tmp_i*f_samp_re + tmp_q*f_samp_im;
q_buf[i] = tmp_q*f_samp_re - tmp_i*f_samp_im;
}
if(LIBLTE_SUCCESS == liblte_phy_find_pss_and_fine_timing(phy_struct,
i_buf,
......@@ -172,76 +186,378 @@ int32 LTE_fdd_dl_fs_samp_buf::work(int32 ninput_items,
q_buf,
frame_start_idx,
0,
LIBLTE_FFT_PAD_SIZE_1_4MHZ,
LIBLTE_N_RB_DL_1_4MHZ,
FFT_pad_size,
N_rb_dl,
N_id_cell,
4,
&slot) &&
&subframe) &&
LIBLTE_SUCCESS == liblte_phy_bch_channel_decode(phy_struct,
&slot,
&subframe,
N_id_cell,
&N_ant,
rrc_msg.msg,
&rrc_msg.num_bits,
&rrc_msg.N_bits,
&sfn_offset) &&
LIBLTE_SUCCESS == liblte_rrc_unpack_bch_bcch_msg(&rrc_msg,
LIBLTE_SUCCESS == liblte_rrc_unpack_bcch_bch_msg(&rrc_msg,
&mib))
{
switch(mib.dl_bw)
{
case LIBLTE_RRC_DL_BANDWIDTH_6:
N_rb_dl = LIBLTE_PHY_N_RB_DL_1_4MHZ;
FFT_pad_size = LIBLTE_PHY_FFT_PAD_SIZE_1_4MHZ;
break;
case LIBLTE_RRC_DL_BANDWIDTH_15:
N_rb_dl = LIBLTE_PHY_N_RB_DL_3MHZ;
FFT_pad_size = LIBLTE_PHY_FFT_PAD_SIZE_3MHZ;
break;
case LIBLTE_RRC_DL_BANDWIDTH_25:
N_rb_dl = LIBLTE_PHY_N_RB_DL_5MHZ;
FFT_pad_size = LIBLTE_PHY_FFT_PAD_SIZE_5MHZ;
break;
case LIBLTE_RRC_DL_BANDWIDTH_50:
N_rb_dl = LIBLTE_PHY_N_RB_DL_10MHZ;
FFT_pad_size = LIBLTE_PHY_FFT_PAD_SIZE_10MHZ;
break;
case LIBLTE_RRC_DL_BANDWIDTH_75:
N_rb_dl = LIBLTE_PHY_N_RB_DL_15MHZ;
FFT_pad_size = LIBLTE_PHY_FFT_PAD_SIZE_15MHZ;
break;
case LIBLTE_RRC_DL_BANDWIDTH_100:
N_rb_dl = LIBLTE_PHY_N_RB_DL_20MHZ;
FFT_pad_size = LIBLTE_PHY_FFT_PAD_SIZE_20MHZ;
break;
}
sfn = (mib.sfn_div_4 << 2) + sfn_offset;
printf("DL FDD LTE Channel found with Physical Cell ID %u, %u TX antenna(s), ",
N_id_cell,
N_ant);
if((sfn % 2) != 0)
{
frame_start_idx += 307200;
sfn++;
}
switch(mib.phich_config.res)
{
case LIBLTE_RRC_PHICH_RESOURCE_1_6:
phich_res = 1/6;
break;
case LIBLTE_RRC_PHICH_RESOURCE_1_2:
phich_res = 1/2;
break;
case LIBLTE_RRC_PHICH_RESOURCE_1:
phich_res = 1;
break;
case LIBLTE_RRC_PHICH_RESOURCE_2:
phich_res = 2;
break;
}
printf("DL LTE Channel found:\n");
printf("\t%-30s=%12.2f\n", "Frequency Offset", freq_offset);
printf("\t%-30s=%12u\n", "System Frame Number", sfn);
printf("\t%-30s=%12u\n", "Physical Cell ID", N_id_cell);
printf("\t%-30s=%12u\n", "Number of TX Antennas", N_ant);
switch(mib.dl_bw)
{
case LIBLTE_RRC_DL_BANDWIDTH_6:
printf("1.4MHz bandwidth, ");
printf("\t%-30s=%12f\n", "Bandwidth (MHz)", 1.4);
break;
case LIBLTE_RRC_DL_BANDWIDTH_15:
printf("3MHz bandwidth, ");
printf("\t%-30s=%12u\n", "Bandwidth (MHz)", 3);
break;
case LIBLTE_RRC_DL_BANDWIDTH_25:
printf("5MHz bandwidth, ");
printf("\t%-30s=%12u\n", "Bandwidth (MHz)", 5);
break;
case LIBLTE_RRC_DL_BANDWIDTH_50:
printf("10MHz bandwidth, ");
printf("\t%-30s=%12u\n", "Bandwidth (MHz)", 10);
break;
case LIBLTE_RRC_DL_BANDWIDTH_75:
printf("15MHz bandwidth, ");
printf("\t%-30s=%12u\n", "Bandwidth (MHz)", 15);
break;
case LIBLTE_RRC_DL_BANDWIDTH_100:
printf("20MHz bandwidth, ");
printf("\t%-30s=%12u\n", "Bandwidth (MHz)", 20);
break;
}
if(mib.phich_config.dur == LIBLTE_RRC_PHICH_DURATION_NORMAL)
{
printf("normal PHICH duration, ");
printf("\t%-30s=%12s\n", "PHICH Duration", "Normal");
}else{
printf("extended PHICH duration, ");
printf("\t%-30s=%12s\n", "PHICH Duration", "Extended");
}
switch(mib.phich_config.res)
{
case LIBLTE_RRC_PHICH_RESOURCE_1_6:
printf("and 1/6 PHICH resource ");
printf("\t%-30s=%12s\n", "PHICH Resource", "1/6");
break;
case LIBLTE_RRC_PHICH_RESOURCE_1_2:
printf("and 1/2 PHICH resource ");
printf("\t%-30s=%12s\n", "PHICH Resource", "1/2");
break;
case LIBLTE_RRC_PHICH_RESOURCE_1:
printf("and 1 PHICH resource ");
printf("\t%-30s=%12u\n", "PHICH Resource", 1);
break;
case LIBLTE_RRC_PHICH_RESOURCE_2:
printf("and 2 PHICH resources ");
printf("\t%-30s=%12u\n", "PHICH Resource", 2);
break;
}
printf("in SFN %u\n", sfn);
if(LIBLTE_SUCCESS == liblte_phy_get_subframe_and_ce(phy_struct,
i_buf,
q_buf,
frame_start_idx-1,
5,
FFT_pad_size,
N_rb_dl,
N_id_cell,
N_ant,
&subframe) &&
LIBLTE_SUCCESS == liblte_phy_pdcch_channel_decode(phy_struct,
&subframe,
N_id_cell,
N_ant,
LIBLTE_PHY_N_SC_RB_NORMAL_CP,
N_rb_dl,
phich_res,
mib.phich_config.dur,
&pcfich,
&phich,
&pdcch) &&
LIBLTE_SUCCESS == liblte_phy_pdsch_channel_decode(phy_struct,
&subframe,
&pdcch,
N_id_cell,
N_ant,
LIBLTE_PHY_N_SC_RB_NORMAL_CP,
N_rb_dl,
rrc_msg.msg,
&rrc_msg.N_bits) &&
LIBLTE_SUCCESS == liblte_rrc_unpack_bcch_dlsch_msg(&rrc_msg,
&sib1))
{
printf("\t%-30s\n", "PLMN Identity List:");
for(i=0; i<sib1.N_plmn_ids; i++)
{
printf("\t\t%03X-", sib1.plmn_id[i].id.mcc & 0x0FFF);
if((sib1.plmn_id[i].id.mnc & 0xFF00) == 0xFF00)
{
printf("%02X, ", sib1.plmn_id[i].id.mnc & 0x00FF);
}else{
printf("%03X, ", sib1.plmn_id[i].id.mnc & 0x0FFF);
}
if(LIBLTE_RRC_RESV_FOR_OPER == sib1.plmn_id[i].resv_for_oper)
{
printf("reserved for operator use\n");
}else{
printf("not reserved for operator use\n");
}
}
printf("\t%-30s=%12u\n", "Tracking Area Code", sib1.tracking_area_code);
printf("\t%-30s=%12u\n", "Cell Identity", sib1.cell_id);
switch(sib1.cell_barred)
{
case LIBLTE_RRC_CELL_BARRED:
printf("\t%-30s=%12s\n", "Cell Barred", "TRUE");
break;
case LIBLTE_RRC_CELL_NOT_BARRED:
printf("\t%-30s=%12s\n", "Cell Barred", "FALSE");
break;
}
switch(sib1.intra_freq_reselection)
{
case LIBLTE_RRC_INTRA_FREQ_RESELECTION_ALLOWED:
printf("\t%-30s=%12s\n", "Intra Frequency Reselection", "Allowed");
break;
case LIBLTE_RRC_INTRA_FREQ_RESELECTION_NOT_ALLOWED:
printf("\t%-30s=%12s\n", "Intra Frequency Reselection", "Not Allowed");
break;
}
if(true == sib1.csg_indication)
{
printf("\t%-30s=%12s\n", "CSG Indication", "TRUE");
}else{
printf("\t%-30s=%12s\n", "CSG Indication", "FALSE");
}
if(LIBLTE_RRC_CSG_IDENTITY_NOT_PRESENT != sib1.csg_id)
{
printf("\t%-30s=%12u\n", "CSG Identity", sib1.csg_id);
}
printf("\t%-30s=%12d\n", "Q Rx Lev Min", sib1.q_rx_lev_min);
printf("\t%-30s=%12u\n", "Q Rx Lev Min Offset", sib1.q_rx_lev_min_offset);
printf("\t%-30s=%12d\n", "P Max", sib1.p_max);
printf("\t%-30s=%12u\n", "Frequency Band", sib1.freq_band_indicator);
printf("\t%-30s\n", "Scheduling Info List:");
for(i=0; i<sib1.N_sched_info; i++)
{
switch(sib1.sched_info[i].si_periodicity)
{
case LIBLTE_RRC_SI_PERIODICITY_RF8:
printf("\t\t%s = %s\n", "SI Periodcity", "RF8");
break;
case LIBLTE_RRC_SI_PERIODICITY_RF16:
printf("\t\t%s = %s\n", "SI Periodcity", "RF16");
break;
case LIBLTE_RRC_SI_PERIODICITY_RF32:
printf("\t\t%s = %s\n", "SI Periodcity", "RF32");
break;
case LIBLTE_RRC_SI_PERIODICITY_RF64:
printf("\t\t%s = %s\n", "SI Periodcity", "RF64");
break;
case LIBLTE_RRC_SI_PERIODICITY_RF128:
printf("\t\t%s = %s\n", "SI Periodcity", "RF128");
break;
case LIBLTE_RRC_SI_PERIODICITY_RF256:
printf("\t\t%s = %s\n", "SI Periodcity", "RF256");
break;
case LIBLTE_RRC_SI_PERIODICITY_RF512:
printf("\t\t%s = %s\n", "SI Periodcity", "RF512");
break;
}
for(j=0; j<sib1.sched_info[i].N_sib_mapping_info; j++)
{
switch(sib1.sched_info[i].sib_mapping_info[j].sib_type)
{
case LIBLTE_RRC_SIB_TYPE_3:
printf("\t\t\t%s = %s\n", "SIB Type", "3");
break;
case LIBLTE_RRC_SIB_TYPE_4:
printf("\t\t\t%s = %s\n", "SIB Type", "4");
break;
case LIBLTE_RRC_SIB_TYPE_5:
printf("\t\t\t%s = %s\n", "SIB Type", "5");
break;
case LIBLTE_RRC_SIB_TYPE_6:
printf("\t\t\t%s = %s\n", "SIB Type", "6");
break;
case LIBLTE_RRC_SIB_TYPE_7:
printf("\t\t\t%s = %s\n", "SIB Type", "7");
break;
case LIBLTE_RRC_SIB_TYPE_8:
printf("\t\t\t%s = %s\n", "SIB Type", "8");
break;
case LIBLTE_RRC_SIB_TYPE_9:
printf("\t\t\t%s = %s\n", "SIB Type", "9");
break;
case LIBLTE_RRC_SIB_TYPE_10:
printf("\t\t\t%s = %s\n", "SIB Type", "10");
break;
case LIBLTE_RRC_SIB_TYPE_11:
printf("\t\t\t%s = %s\n", "SIB Type", "11");
break;
case LIBLTE_RRC_SIB_TYPE_12_v920:
printf("\t\t\t%s = %s\n", "SIB Type", "12-v920");
break;
case LIBLTE_RRC_SIB_TYPE_13_v920:
printf("\t\t\t%s = %s\n", "SIB Type", "13-v920");
break;
case LIBLTE_RRC_SIB_TYPE_SPARE_5:
printf("\t\t\t%s = %s\n", "SIB Type", "SPARE5");
break;
case LIBLTE_RRC_SIB_TYPE_SPARE_4:
printf("\t\t\t%s = %s\n", "SIB Type", "SPARE4");
break;
case LIBLTE_RRC_SIB_TYPE_SPARE_3:
printf("\t\t\t%s = %s\n", "SIB Type", "SPARE3");
break;
case LIBLTE_RRC_SIB_TYPE_SPARE_2:
printf("\t\t\t%s = %s\n", "SIB Type", "SPARE2");
break;
case LIBLTE_RRC_SIB_TYPE_SPARE_1:
printf("\t\t\t%s = %s\n", "SIB Type", "SPARE1");
break;
}
}
}
if(false == sib1.tdd)
{
printf("\t%-30s=%12s\n", "Duplexing Mode", "FDD");
}else{
printf("\t%-30s=%12s\n", "Duplexing Mode", "TDD");
switch(sib1.sf_assignment)
{
case LIBLTE_RRC_SUBFRAME_ASSIGNMENT_0:
printf("\t%-30s=%12s\n", "Subframe Assignment", "SA0");
break;
case LIBLTE_RRC_SUBFRAME_ASSIGNMENT_1:
printf("\t%-30s=%12s\n", "Subframe Assignment", "SA1");
break;
case LIBLTE_RRC_SUBFRAME_ASSIGNMENT_2:
printf("\t%-30s=%12s\n", "Subframe Assignment", "SA2");
break;
case LIBLTE_RRC_SUBFRAME_ASSIGNMENT_3:
printf("\t%-30s=%12s\n", "Subframe Assignment", "SA3");
break;
case LIBLTE_RRC_SUBFRAME_ASSIGNMENT_4:
printf("\t%-30s=%12s\n", "Subframe Assignment", "SA4");
break;
case LIBLTE_RRC_SUBFRAME_ASSIGNMENT_5:
printf("\t%-30s=%12s\n", "Subframe Assignment", "SA5");
break;
case LIBLTE_RRC_SUBFRAME_ASSIGNMENT_6:
printf("\t%-30s=%12s\n", "Subframe Assignment", "SA6");
break;
}
switch(sib1.special_sf_patterns)
{
case LIBLTE_RRC_SPECIAL_SUBFRAME_PATTERNS_0:
printf("\t%-30s=%12s\n", "Special Subframe Patterns", "SSP0");
break;
case LIBLTE_RRC_SPECIAL_SUBFRAME_PATTERNS_1:
printf("\t%-30s=%12s\n", "Special Subframe Patterns", "SSP1");
break;
case LIBLTE_RRC_SPECIAL_SUBFRAME_PATTERNS_2:
printf("\t%-30s=%12s\n", "Special Subframe Patterns", "SSP2");
break;
case LIBLTE_RRC_SPECIAL_SUBFRAME_PATTERNS_3:
printf("\t%-30s=%12s\n", "Special Subframe Patterns", "SSP3");
break;
case LIBLTE_RRC_SPECIAL_SUBFRAME_PATTERNS_4:
printf("\t%-30s=%12s\n", "Special Subframe Patterns", "SSP4");
break;
case LIBLTE_RRC_SPECIAL_SUBFRAME_PATTERNS_5:
printf("\t%-30s=%12s\n", "Special Subframe Patterns", "SSP5");
break;
case LIBLTE_RRC_SPECIAL_SUBFRAME_PATTERNS_6:
printf("\t%-30s=%12s\n", "Special Subframe Patterns", "SSP6");
break;
case LIBLTE_RRC_SPECIAL_SUBFRAME_PATTERNS_7:
printf("\t%-30s=%12s\n", "Special Subframe Patterns", "SSP7");
break;
case LIBLTE_RRC_SPECIAL_SUBFRAME_PATTERNS_8:
printf("\t%-30s=%12s\n", "Special Subframe Patterns", "SSP8");
break;
}
}
switch(sib1.si_window_length)
{
case LIBLTE_RRC_SI_WINDOW_LENGTH_MS1:
printf("\t%-30s=%12s\n", "SI Window Length", "MS1");
break;
case LIBLTE_RRC_SI_WINDOW_LENGTH_MS2:
printf("\t%-30s=%12s\n", "SI Window Length", "MS2");
break;
case LIBLTE_RRC_SI_WINDOW_LENGTH_MS5:
printf("\t%-30s=%12s\n", "SI Window Length", "MS5");
break;
case LIBLTE_RRC_SI_WINDOW_LENGTH_MS10:
printf("\t%-30s=%12s\n", "SI Window Length", "MS10");
break;
case LIBLTE_RRC_SI_WINDOW_LENGTH_MS15:
printf("\t%-30s=%12s\n", "SI Window Length", "MS15");
break;
case LIBLTE_RRC_SI_WINDOW_LENGTH_MS20:
printf("\t%-30s=%12s\n", "SI Window Length", "MS20");
break;
case LIBLTE_RRC_SI_WINDOW_LENGTH_MS40:
printf("\t%-30s=%12s\n", "SI Window Length", "MS40");
break;
}
printf("\t%-30s=%12u\n", "SI Value Tag", sib1.system_info_value_tag);
}else{
printf("Could not decode SIB1\n");
}
}else{
printf("Could not decode channel\n");
printf("Could not decode MIB\n");
}
}else{
printf("Could not decode channel\n");
printf("Could not find PSS/SSS\n");
}
}else{
printf("Could not decode channel\n");
printf("Could not find coarse timing and frequency offset\n");
}
for(i=0; i<LTE_FDD_DL_FS_SAMP_BUF_SIZE; i++)
......
......@@ -20,7 +20,7 @@ dnl the Free Software Foundation, Inc., 51 Franklin Street,
dnl Boston, MA 02110-1301, USA.
dnl
AC_INIT(openlte,0.0.1)
AC_INIT(openlte,0.5.0)
AC_PREREQ(2.57)
AC_CONFIG_AUX_DIR([.])
......
......@@ -25,6 +25,7 @@
Revision History
---------- ------------- --------------------------------------------
02/26/2012 Ben Wojtowicz Created file.
04/21/2012 Ben Wojtowicz Added Turbo encode/decode and PDSCH decode
*******************************************************************************/
......@@ -36,36 +37,58 @@
*******************************************************************************/
#include "liblte_common.h"
#include "liblte_rrc.h"
#include "fftw3.h"
/*******************************************************************************
DEFINES
*******************************************************************************/
#define LIBLTE_FFT_PAD_SIZE_1_4MHZ 988
#define LIBLTE_FFT_PAD_SIZE_3MHZ 934
#define LIBLTE_FFT_PAD_SIZE_5MHZ 874
#define LIBLTE_FFT_PAD_SIZE_10MHZ 724
#define LIBLTE_FFT_PAD_SIZE_15MHZ 574
#define LIBLTE_FFT_PAD_SIZE_20MHZ 424
#define LIBLTE_N_RB_DL_1_4MHZ 6
#define LIBLTE_N_RB_DL_3MHZ 15
#define LIBLTE_N_RB_DL_5MHZ 25
#define LIBLTE_N_RB_DL_10MHZ 50
#define LIBLTE_N_RB_DL_15MHZ 75
#define LIBLTE_N_RB_DL_20MHZ 100
#define LIBLTE_N_SC_RB_NORMAL_CP 12
#define LIBLTE_PHY_FFT_PAD_SIZE_1_4MHZ 988
#define LIBLTE_PHY_FFT_PAD_SIZE_3MHZ 934
#define LIBLTE_PHY_FFT_PAD_SIZE_5MHZ 874
#define LIBLTE_PHY_FFT_PAD_SIZE_10MHZ 724
#define LIBLTE_PHY_FFT_PAD_SIZE_15MHZ 574
#define LIBLTE_PHY_FFT_PAD_SIZE_20MHZ 424
#define LIBLTE_PHY_N_RB_DL_1_4MHZ 6
#define LIBLTE_PHY_N_RB_DL_3MHZ 15
#define LIBLTE_PHY_N_RB_DL_5MHZ 25
#define LIBLTE_PHY_N_RB_DL_10MHZ 50
#define LIBLTE_PHY_N_RB_DL_15MHZ 75
#define LIBLTE_PHY_N_RB_DL_20MHZ 100
#define LIBLTE_PHY_N_RB_DL_MAX 110
#define LIBLTE_PHY_N_SC_RB_NORMAL_CP 12
#define LIBLTE_PHY_SI_RNTI 0xFFFF
#define LIBLTE_PHY_P_RNTI 0xFFFE
/*******************************************************************************
TYPEDEFS
*******************************************************************************/
typedef enum{
LIBLTE_PHY_PRE_CODER_TYPE_TX_DIVERSITY = 0,
LIBLTE_PHY_PRE_CODER_TYPE_SPATIAL_MULTIPLEXING,
}LIBLTE_PHY_PRE_CODER_TYPE_ENUM;
typedef enum{
LIBLTE_PHY_MODULATION_TYPE_BPSK = 0,
LIBLTE_PHY_MODULATION_TYPE_QPSK,
LIBLTE_PHY_MODULATION_TYPE_16QAM,
LIBLTE_PHY_MODULATION_TYPE_64QAM,
}LIBLTE_PHY_MODULATION_TYPE_ENUM;
typedef enum{
LIBLTE_PHY_CHAN_TYPE_DLSCH = 0,
LIBLTE_PHY_CHAN_TYPE_PCH,
}LIBLTE_PHY_CHAN_TYPE_ENUM;
typedef struct{
float symb_re[16][LIBLTE_N_RB_DL_20MHZ*LIBLTE_N_SC_RB_NORMAL_CP];
float symb_im[16][LIBLTE_N_RB_DL_20MHZ*LIBLTE_N_SC_RB_NORMAL_CP];
float ce_re[4][16][LIBLTE_N_RB_DL_20MHZ*LIBLTE_N_SC_RB_NORMAL_CP];
float ce_im[4][16][LIBLTE_N_RB_DL_20MHZ*LIBLTE_N_SC_RB_NORMAL_CP];
}LIBLTE_PHY_SLOT_STRUCT;
float symb_re[16][LIBLTE_PHY_N_RB_DL_20MHZ*LIBLTE_PHY_N_SC_RB_NORMAL_CP];
float symb_im[16][LIBLTE_PHY_N_RB_DL_20MHZ*LIBLTE_PHY_N_SC_RB_NORMAL_CP];
float ce_re[4][16][LIBLTE_PHY_N_RB_DL_20MHZ*LIBLTE_PHY_N_SC_RB_NORMAL_CP];
float ce_im[4][16][LIBLTE_PHY_N_RB_DL_20MHZ*LIBLTE_PHY_N_SC_RB_NORMAL_CP];
uint32 num;
}LIBLTE_PHY_SUBFRAME_STRUCT;
/*******************************************************************************
DECLARATIONS
......@@ -85,14 +108,14 @@ typedef struct{
float timing_abs_corr[15360];
// PSS
float pss_mod_re[3][LIBLTE_N_RB_DL_20MHZ*LIBLTE_N_SC_RB_NORMAL_CP];
float pss_mod_im[3][LIBLTE_N_RB_DL_20MHZ*LIBLTE_N_SC_RB_NORMAL_CP];
float pss_mod_re[3][LIBLTE_PHY_N_RB_DL_20MHZ*LIBLTE_PHY_N_SC_RB_NORMAL_CP];
float pss_mod_im[3][LIBLTE_PHY_N_RB_DL_20MHZ*LIBLTE_PHY_N_SC_RB_NORMAL_CP];
// SSS
float sss_mod_re_0[168][LIBLTE_N_RB_DL_20MHZ*LIBLTE_N_SC_RB_NORMAL_CP];
float sss_mod_im_0[168][LIBLTE_N_RB_DL_20MHZ*LIBLTE_N_SC_RB_NORMAL_CP];
float sss_mod_re_5[168][LIBLTE_N_RB_DL_20MHZ*LIBLTE_N_SC_RB_NORMAL_CP];
float sss_mod_im_5[168][LIBLTE_N_RB_DL_20MHZ*LIBLTE_N_SC_RB_NORMAL_CP];
float sss_mod_re_0[168][LIBLTE_PHY_N_RB_DL_20MHZ*LIBLTE_PHY_N_SC_RB_NORMAL_CP];
float sss_mod_im_0[168][LIBLTE_PHY_N_RB_DL_20MHZ*LIBLTE_PHY_N_SC_RB_NORMAL_CP];
float sss_mod_re_5[168][LIBLTE_PHY_N_RB_DL_20MHZ*LIBLTE_PHY_N_SC_RB_NORMAL_CP];
float sss_mod_im_5[168][LIBLTE_PHY_N_RB_DL_20MHZ*LIBLTE_PHY_N_SC_RB_NORMAL_CP];
float sss_re_0[63];
float sss_im_0[63];
float sss_re_5[63];
......@@ -111,12 +134,12 @@ typedef struct{
int8 sss_z1_m1[31];
// Channel Estimate
float ce_crs_re[16][LIBLTE_N_RB_DL_20MHZ*LIBLTE_N_SC_RB_NORMAL_CP];
float ce_crs_im[16][LIBLTE_N_RB_DL_20MHZ*LIBLTE_N_SC_RB_NORMAL_CP];
float ce_mag[5][LIBLTE_N_RB_DL_20MHZ*LIBLTE_N_SC_RB_NORMAL_CP];
float ce_ang[5][LIBLTE_N_RB_DL_20MHZ*LIBLTE_N_SC_RB_NORMAL_CP];
float ce_crs_re[16][LIBLTE_PHY_N_RB_DL_20MHZ*LIBLTE_PHY_N_SC_RB_NORMAL_CP];
float ce_crs_im[16][LIBLTE_PHY_N_RB_DL_20MHZ*LIBLTE_PHY_N_SC_RB_NORMAL_CP];
float ce_mag[5][LIBLTE_PHY_N_RB_DL_20MHZ*LIBLTE_PHY_N_SC_RB_NORMAL_CP];
float ce_ang[5][LIBLTE_PHY_N_RB_DL_20MHZ*LIBLTE_PHY_N_SC_RB_NORMAL_CP];
// BCH Decode
// BCH
float bch_y_est_re[240];
float bch_y_est_im[240];
float bch_c_est_re[4][240];
......@@ -126,17 +149,124 @@ typedef struct{
float bch_d_re[480];
float bch_d_im[480];
float bch_descramb_bits[1920];
float bch_d_bits[1920];
float bch_rx_d_bits[1920];
uint32 bch_c[1920];
uint8 bch_tx_d_bits[1920];
uint8 bch_c_bits[40];
int8 bch_soft_bits[480];
// Rate Match
float rm_tmp[1024];
float rm_sb_mat[32][32];