Commit 58ed2375 authored by Ben Wojtowicz's avatar Ben Wojtowicz

Version 0.12.1: Pulled in patches from Astrasel to initialize the frequency...

Version 0.12.1: Pulled in patches from Astrasel to initialize the frequency offset estimate array in liblte_phy_dl_find_coarse_timing_and_freq_offset, from Jevgenij for supporting non-B2X0 USRPs in LTE_fdd_dl_scan, from Max Suraev for more descriptive start failures in LTE_fdd_enodeb, and from Andrew Murphy to add DCI 1C unpacking to the LTE library, also added support for PRB allocation differences in each slot and fixed a bug in lte_fdd_dl_transmit relating to PDCCH REG mapping.
parent 3357cfb7
Ben Wojtowicz, bwojtowi@gmail.com
Andrew Murphy, andrew.murphy@rd.bbc.co.uk (DCI 1C Unpack)
......@@ -23,7 +23,7 @@
########################################################################
cmake_minimum_required(VERSION 2.6)
project(openLTE CXX C)
set(openLTE_version 0.12.0)
set(openLTE_version 0.12.1)
enable_testing()
#select the release build type by default to get optimization flags
......@@ -88,7 +88,7 @@ set(GRC_BLOCKS_DIR ${GR_PKG_DATA_DIR}/grc/blocks)
########################################################################
# Find gnuradio build dependencies
########################################################################
set(GR_REQUIRED_COMPONENTS RUNTIME BLOCKS PMT)
set(GR_REQUIRED_COMPONENTS RUNTIME BLOCKS FILTER PMT)
find_package(Gnuradio "3.7.0")
find_package(GnuradioOsmosdr)
find_package(Uhd)
......@@ -117,6 +117,8 @@ include_directories(
${Boost_INCLUDE_DIRS}
${FFTW3F_INCLUDE_DIRS}
${GNURADIO_RUNTIME_INCLUDE_DIRS}
${GNURADIO_BLOCKS_INCLUDE_DIRS}
${GNURADIO_FILTER_INCLUDE_DIRS}
${GNURADIO_PMT_INCLUDE_DIRS}
${GNURADIO_OSMOSDR_INCLUDE_DIRS}
${GR_UHD_INCLUDE_DIRS}
......@@ -127,6 +129,8 @@ link_directories(
${Boost_LIBRARY_DIRS}
${FFTW3F_LIBRARY_DIRS}
${GNURADIO_RUNTIME_LIBRARY_DIRS}
${GNURADIO_BLOCKS_LIBRARY_DIRS}
${GNURADIO_FILTER_LIBRARY_DIRS}
${GNURADIO_PMT_LIBRARY_DIRS}
${GNURADIO_OSMOSDR_LIBRARY_DIRS}
${UHD_LIBRARY_DIRS}
......
......@@ -92,3 +92,10 @@ v00.11.00 Fixed a bug with transmitting SIB2 for 1.4MHz bandwidth in
v00.12.00 Added DL-SCH/UL-SCH MAC PDU processing, added PUSCH mod/demod
support, added more RRC support, and added PUSCH mod/demod support
in octave.
v00.12.01 Pulled in patches from Astrasel to initialize the frequency offset
estimate array in liblte_phy_dl_find_coarse_timing_and_freq_offset,
from Jevgenij for supporting non-B2X0 USRPs in LTE_fdd_dl_scan, from
Max Suraev for more descriptive start failures in LTE_fdd_enodeb, and
from Andrew Murphy to add DCI 1C unpacking to the LTE library, also
added support for PRB allocation differences in each slot and fixed
a bug in lte_fdd_dl_transmit relating to PDCCH REG mapping.
......@@ -45,6 +45,7 @@
01/18/2014 Ben Wojtowicz Fixed a bug with transmitting SIB2 for 1.4MHz
bandwidth.
03/26/2014 Ben Wojtowicz Using the latest LTE library.
04/12/2014 Ben Wojtowicz Using the latest LTE library.
*******************************************************************************/
......@@ -526,7 +527,8 @@ int32 LTE_fdd_dl_fg_samp_buf::work(int32 noutput_items,
{
for(j=0; j<pdcch.alloc[i].N_prb; j++)
{
pdcch.alloc[i].prb[j] = last_prb++;
pdcch.alloc[i].prb[0][j] = last_prb;
pdcch.alloc[i].prb[1][j] = last_prb++;
}
}
if(0 != pdcch.N_alloc)
......
......@@ -10,6 +10,6 @@ add_executable(LTE_fdd_dl_scan
src/LTE_fdd_dl_scan_flowgraph.cc
src/LTE_fdd_dl_scan_state_machine.cc
)
target_link_libraries(LTE_fdd_dl_scan lte fftw3f uhd tools pthread ${Boost_LIBRARIES} ${GNURADIO_RUNTIME_LIBRARIES} ${GNURADIO_PMT_LIBRARIES} ${GNURADIO_OSMOSDR_LIBRARIES})
target_link_libraries(LTE_fdd_dl_scan lte fftw3f uhd tools pthread ${Boost_LIBRARIES} ${GNURADIO_RUNTIME_LIBRARIES} ${GNURADIO_BLOCKS_LIBRARIES} ${GNURADIO_FILTER_LIBRARIES} ${GNURADIO_PMT_LIBRARIES} ${GNURADIO_OSMOSDR_LIBRARIES})
set_target_properties(LTE_fdd_dl_scan PROPERTIES DEFINE_SYMBOL "LTE_fdd_dl_scan_state_machine_EXPORTS")
install(TARGETS LTE_fdd_dl_scan DESTINATION bin)
/*******************************************************************************
Copyright 2013 Ben Wojtowicz
Copyright 2013-2014 Ben Wojtowicz
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
......@@ -29,6 +29,8 @@
08/26/2013 Ben Wojtowicz Updates to support GnuRadio 3.7.
11/13/2013 Ben Wojtowicz Added support for USRP B2X0.
11/30/2013 Ben Wojtowicz Added support for bladeRF.
04/12/2014 Ben Wojtowicz Pulled in a patch from Jevgenij for
supporting non-B2X0 USRPs.
*******************************************************************************/
......@@ -43,6 +45,8 @@
#include "LTE_fdd_dl_scan_state_machine.h"
#include <boost/thread/mutex.hpp>
#include <gnuradio/top_block.h>
#include <gnuradio/filter/rational_resampler_base_ccf.h>
#include <gnuradio/filter/firdes.h>
#include <osmosdr/source.h>
/*******************************************************************************
......@@ -62,7 +66,8 @@
typedef enum{
LTE_FDD_DL_SCAN_HW_TYPE_RTL_SDR = 0,
LTE_FDD_DL_SCAN_HW_TYPE_HACKRF,
LTE_FDD_DL_SCAN_HW_TYPE_USRP,
LTE_FDD_DL_SCAN_HW_TYPE_USRP_B,
LTE_FDD_DL_SCAN_HW_TYPE_USRP_N,
LTE_FDD_DL_SCAN_HW_TYPE_BLADERF,
LTE_FDD_DL_SCAN_HW_TYPE_UNKNOWN,
}LTE_FDD_DL_SCAN_HW_TYPE_ENUM;
......@@ -94,9 +99,11 @@ private:
static void* run_thread(void *inputs);
// Variables
gr::top_block_sptr top_block;
osmosdr::source::sptr samp_src;
LTE_fdd_dl_scan_state_machine_sptr state_machine;
std::vector<float> resample_taps;
gr::top_block_sptr top_block;
gr::filter::rational_resampler_base_ccf::sptr resampler_filter;
osmosdr::source::sptr samp_src;
LTE_fdd_dl_scan_state_machine_sptr state_machine;
pthread_t start_thread;
boost::mutex start_mutex;
......
/*******************************************************************************
Copyright 2013 Ben Wojtowicz
Copyright 2013-2014 Ben Wojtowicz
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
......@@ -30,6 +30,8 @@
new hardware discovery mechanism.
11/13/2013 Ben Wojtowicz Added support for USRP B2X0.
11/30/2013 Ben Wojtowicz Added support for bladeRF.
04/12/2014 Ben Wojtowicz Pulled in a patch from Jevgenij for
supporting non-B2X0 USRPs.
*******************************************************************************/
......@@ -133,28 +135,40 @@ LTE_FDD_DL_SCAN_STATUS_ENUM LTE_fdd_dl_scan_flowgraph::start(uint16 dl_earfcn)
if(0 != tmp_src0->get_sample_rates().size() &&
1 >= fabs(mcr - 30720000))
{
hardware_type = LTE_FDD_DL_SCAN_HW_TYPE_USRP;
hardware_type = LTE_FDD_DL_SCAN_HW_TYPE_USRP_B;
samp_src = tmp_src0;
}else{
osmosdr::source::sptr tmp_src1 = osmosdr::source::make("hackrf");
if(0 != tmp_src1->get_sample_rates().size())
BOOST_FOREACH(const uhd::device_addr_t &dev, uhd::device::find(hint))
{
hardware_type = LTE_FDD_DL_SCAN_HW_TYPE_HACKRF;
samp_src = tmp_src1;
uhd::usrp::multi_usrp::make(dev)->set_master_clock_rate(100000000);
mcr = uhd::usrp::multi_usrp::make(dev)->get_master_clock_rate();
}
if(0 != tmp_src0->get_sample_rates().size() &&
1 >= fabs(mcr - 100000000))
{
hardware_type = LTE_FDD_DL_SCAN_HW_TYPE_USRP_N;
samp_src = tmp_src0;
}else{
osmosdr::source::sptr tmp_src2 = osmosdr::source::make("bladerf");
if(0 != tmp_src2->get_sample_rates().size())
osmosdr::source::sptr tmp_src1 = osmosdr::source::make("hackrf");
if(0 != tmp_src1->get_sample_rates().size())
{
hardware_type = LTE_FDD_DL_SCAN_HW_TYPE_BLADERF;
samp_src = tmp_src2;
hardware_type = LTE_FDD_DL_SCAN_HW_TYPE_HACKRF;
samp_src = tmp_src1;
}else{
osmosdr::source::sptr tmp_src3 = osmosdr::source::make("rtl=0");
if(0 != tmp_src3->get_sample_rates().size())
osmosdr::source::sptr tmp_src2 = osmosdr::source::make("bladerf");
if(0 != tmp_src2->get_sample_rates().size())
{
hardware_type = LTE_FDD_DL_SCAN_HW_TYPE_RTL_SDR;
samp_src = tmp_src3;
hardware_type = LTE_FDD_DL_SCAN_HW_TYPE_BLADERF;
samp_src = tmp_src2;
}else{
samp_src = osmosdr::source::make();
osmosdr::source::sptr tmp_src3 = osmosdr::source::make("rtl=0");
if(0 != tmp_src3->get_sample_rates().size())
{
hardware_type = LTE_FDD_DL_SCAN_HW_TYPE_RTL_SDR;
samp_src = tmp_src3;
}else{
samp_src = osmosdr::source::make();
}
}
}
}
......@@ -164,7 +178,10 @@ LTE_FDD_DL_SCAN_STATUS_ENUM LTE_fdd_dl_scan_flowgraph::start(uint16 dl_earfcn)
{
switch(hardware_type)
{
case LTE_FDD_DL_SCAN_HW_TYPE_USRP:
case LTE_FDD_DL_SCAN_HW_TYPE_USRP_B:
state_machine = LTE_fdd_dl_scan_make_state_machine(15360000);
break;
case LTE_FDD_DL_SCAN_HW_TYPE_USRP_N:
state_machine = LTE_fdd_dl_scan_make_state_machine(15360000);
break;
case LTE_FDD_DL_SCAN_HW_TYPE_HACKRF:
......@@ -190,12 +207,18 @@ LTE_FDD_DL_SCAN_STATUS_ENUM LTE_fdd_dl_scan_flowgraph::start(uint16 dl_earfcn)
{
switch(hardware_type)
{
case LTE_FDD_DL_SCAN_HW_TYPE_USRP:
case LTE_FDD_DL_SCAN_HW_TYPE_USRP_B:
samp_src->set_sample_rate(15360000);
samp_src->set_gain_mode(false);
samp_src->set_gain(35);
samp_src->set_bandwidth(10000000);
break;
case LTE_FDD_DL_SCAN_HW_TYPE_USRP_N:
samp_src->set_sample_rate(25000000);
samp_src->set_gain_mode(false);
samp_src->set_gain(35);
samp_src->set_bandwidth(10000000);
break;
case LTE_FDD_DL_SCAN_HW_TYPE_HACKRF:
samp_src->set_sample_rate(15360000);
samp_src->set_gain_mode(false);
......@@ -219,7 +242,17 @@ LTE_FDD_DL_SCAN_STATUS_ENUM LTE_fdd_dl_scan_flowgraph::start(uint16 dl_earfcn)
break;
}
samp_src->set_center_freq(liblte_interface_dl_earfcn_to_frequency(dl_earfcn));
top_block->connect(samp_src, 0, state_machine, 0);
if(LTE_FDD_DL_SCAN_HW_TYPE_USRP_N == hardware_type)
{
resample_taps = gr::filter::firdes::low_pass(384, 1, 0.00065, 0.0013, gr::filter::firdes::WIN_KAISER, 5);
resampler_filter = gr::filter::rational_resampler_base_ccf::make(384, 625, resample_taps);
top_block->connect(samp_src, 0, resampler_filter, 0);
top_block->connect(resampler_filter, 0, state_machine, 0);
}else{
top_block->connect(samp_src, 0, state_machine, 0);
}
if(0 == pthread_create(&start_thread, NULL, &run_thread, this))
{
err = LTE_FDD_DL_SCAN_STATUS_OK;
......
......@@ -27,6 +27,8 @@
01/18/2014 Ben Wojtowicz Added dynamic variables and added level to
debug prints.
03/26/2014 Ben Wojtowicz Using the latest LTE library.
04/12/2014 Ben Wojtowicz Pulled in a patch from Max Suraev for more
descriptive start failures.
*******************************************************************************/
......@@ -74,6 +76,7 @@ typedef enum{
LTE_FDD_ENB_ERROR_C_RNTI_NOT_FOUND,
LTE_FDD_ENB_ERROR_CANT_SCHEDULE,
LTE_FDD_ENB_ERROR_VARIABLE_NOT_DYNAMIC,
LTE_FDD_ENB_ERROR_MASTER_CLOCK_FAIL,
LTE_FDD_ENB_ERROR_N_ITEMS,
}LTE_FDD_ENB_ERROR_ENUM;
static const char LTE_fdd_enb_error_text[LTE_FDD_ENB_ERROR_N_ITEMS][100] = {"none",
......@@ -90,7 +93,8 @@ static const char LTE_fdd_enb_error_text[LTE_FDD_ENB_ERROR_N_ITEMS][100] = {"non
"no free C-RNTI",
"C-RNTI not found",
"cant schedule",
"variable not dynamic"};
"variable not dynamic",
"unable to set master clock rate"};
typedef enum{
LTE_FDD_ENB_DEBUG_TYPE_ERROR = 0,
......
......@@ -30,6 +30,7 @@
added level to debug prints, and fixed
subframe scheduling.
03/26/2014 Ben Wojtowicz Fixed the uplink decode subframe scheduling.
04/12/2014 Ben Wojtowicz Using the latest LTE library.
*******************************************************************************/
......@@ -524,7 +525,8 @@ void LTE_fdd_enb_mac::scheduler(void)
// Fill in the PRBs for the UL allocation
for(i=0; i<rar_sched->ul_alloc.N_prb; i++)
{
rar_sched->ul_alloc.prb[i] = rb_start+i;
rar_sched->ul_alloc.prb[0][i] = rb_start+i;
rar_sched->ul_alloc.prb[1][i] = rb_start+i;
}
// Determine the RIV for the UL and re-pack the RAR
......
......@@ -32,6 +32,7 @@
added PRACH detection.
03/26/2014 Ben Wojtowicz Using the latest LTE library and added PUSCH
decode support.
04/12/2014 Ben Wojtowicz Using the latest LTE library.
*******************************************************************************/
......@@ -576,7 +577,8 @@ void LTE_fdd_enb_phy::process_dl(LTE_FDD_ENB_RADIO_TX_BUF_STRUCT *tx_buf)
{
for(j=0; j<pdcch.alloc[i].N_prb; j++)
{
pdcch.alloc[i].prb[j] = last_prb++;
pdcch.alloc[i].prb[0][j] = last_prb;
pdcch.alloc[i].prb[1][j] = last_prb++;
}
}
if(last_prb > phy_struct->N_rb_dl)
......
......@@ -31,6 +31,8 @@
01/18/2014 Ben Wojtowicz Handling multiple antennas, added ability to
update EARFCNs, and fixed sleep time for
no_rf case.
04/12/2014 Ben Wojtowicz Pulled in a patch from Max Suraev for more
descriptive start failures.
*******************************************************************************/
......@@ -185,6 +187,7 @@ LTE_FDD_ENB_ERROR_ENUM LTE_fdd_enb_radio::start(void)
}
}else{
started = false;
err = LTE_FDD_ENB_ERROR_MASTER_CLOCK_FAIL;
}
}catch(...){
started = false;
......
......@@ -56,6 +56,8 @@
version.
11/13/2013 Ben Wojtowicz Started adding PUSCH functionality.
03/26/2014 Ben Wojtowicz Added PUSCH functionality.
04/12/2014 Ben Wojtowicz Added support for PRB allocation differences
in each slot.
*******************************************************************************/
......@@ -601,7 +603,7 @@ typedef struct{
uint32 tbs;
uint32 rv_idx;
uint32 N_prb;
uint32 prb[LIBLTE_PHY_N_RB_DL_MAX];
uint32 prb[LIBLTE_PHY_N_SLOTS_PER_SUBFR][LIBLTE_PHY_N_RB_DL_MAX];
uint32 N_codewords;
uint32 N_layers;
uint32 tx_mode;
......
......@@ -25,7 +25,7 @@
Revision History
---------- ------------- --------------------------------------------
07/21/2013 Ben Wojtowicz Created file.
03/26/3014 Ben Wojtowicz Added DL-SCH/UL-SCH PDU handling.
03/26/2014 Ben Wojtowicz Added DL-SCH/UL-SCH PDU handling.
*******************************************************************************/
......
This diff is collapsed.
......@@ -36,6 +36,7 @@
% Ben Wojtowicz 12/14/2013 Fixed a bug in PDSCH mapping
% Ben Wojtowicz 03/26/2014 Using the renamed lte_layer_mapper_dl
% and lte_pre_coder_dl functions.
% Ben Wojtowicz 04/12/2014 Fixed a bug in PDCCH REG mapping.
%
function [output_samps] = lte_fdd_dl_transmit(bandwidth, N_frames, N_id_2, N_id_1, N_ant, mcc, mnc, tac, cell_id, band)
% DEFINES
......@@ -477,7 +478,6 @@ function [mod_vec_out, N_pdcch_symbs] = map_pdcch(mod_vec_in, cfi, cfi_c, N_sf,
N_pdcch_reg = N_pdcch_reg - N_rb_dl; % Remove CRS
endif
N_pdcch_cce = floor(N_pdcch_reg/9);
N_pdcch_reg = N_pdcch_cce*9;
% Pack the DCI
pdcch_dci = lte_dci_1a_pack(alloc_s, 0, N_rb_dl);
if(length(pdcch_dci) == 12 ||
......@@ -514,6 +514,7 @@ function [mod_vec_out, N_pdcch_symbs] = map_pdcch(mod_vec_in, cfi, cfi_c, N_sf,
endfor
endif
% Construct REGs
pdcch_reg = zeros(N_ant, N_pdcch_reg, 4);
for(p=0:N_ant-1)
for(n=0:N_pdcch_cce-1)
for(m=0:N_pdcch_reg_cce-1)
......
......@@ -143,6 +143,7 @@ function [pusch_bb] = lte_pusch_mod(bits, prb_offset, N_prb, N_id_cell, rnti, N_
pusch_x = lte_layer_mapper_ul(pusch_d, 1);
% Transform precoding
% FIXME: Normalization
for(L=0:(length(pusch_x)/M_pusch_sc)-1)
pusch_y(L*M_pusch_sc+1:(L+1)*M_pusch_sc) = fft(pusch_x(L*M_pusch_sc+1:(L+1)*M_pusch_sc));
endfor
......
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