Commit 7aa26924 authored by Ben Wojtowicz's avatar Ben Wojtowicz

Version 0.8.1: Converted fftw from double to single precision. Added paging...

Version 0.8.1: Converted fftw from double to single precision.  Added paging message printing.  Fixed bugs in lte_fdd_dl_receive.m
parent 3a2fc9c4
......@@ -23,7 +23,7 @@
########################################################################
cmake_minimum_required(VERSION 2.6)
project(openLTE CXX C)
set(openLTE_version 0.8.0)
set(openLTE_version 0.8.1)
enable_testing()
#select the release build type by default to get optimization flags
......
......@@ -53,3 +53,5 @@ v00.08.00 Added a scanner application with support for rtl-sdr hardware.
library with support for socket wrapping. Added test loading
to the file scan and generator apps. Fixed bugs in the file scan
application.
v00.08.01 Converted fftw from double to single precision. Added paging
message printing. Fixed bugs in lte_fdd_dl_receive.m.
......@@ -2,7 +2,7 @@
include(GrPlatform)
add_library(LTE_fdd_dl_fg SHARED src/LTE_fdd_dl_fg_samp_buf.cc)
include_directories(hdr ${CMAKE_SOURCE_DIR}/liblte/hdr ${CMAKE_SOURCE_DIR}/cmn_hdr)
target_link_libraries(LTE_fdd_dl_fg lte fftw3 ${Boost_LIBRARIES} ${GRUEL_LIBRARIES} ${GNURADIO_CORE_LIBRARIES})
target_link_libraries(LTE_fdd_dl_fg lte fftw3f ${Boost_LIBRARIES} ${GRUEL_LIBRARIES} ${GNURADIO_CORE_LIBRARIES})
set_target_properties(LTE_fdd_dl_fg PROPERTIES DEFINE_SYMBOL "LTE_fdd_dl_fg_EXPORTS")
install(TARGETS LTE_fdd_dl_fg LIBRARY DESTINATION lib${LIB_SUFFIX} ARCHIVE DESTINATION lib${LIB_SUFFIX} RUNTIME DESTINATION bin)
......
......@@ -2,7 +2,7 @@
include(GrPlatform)
add_library(LTE_fdd_dl_fs SHARED src/LTE_fdd_dl_fs_samp_buf.cc)
include_directories(hdr ${CMAKE_SOURCE_DIR}/liblte/hdr ${CMAKE_SOURCE_DIR}/cmn_hdr)
target_link_libraries(LTE_fdd_dl_fs lte fftw3 ${Boost_LIBRARIES} ${GRUEL_LIBRARIES} ${GNURADIO_CORE_LIBRARIES})
target_link_libraries(LTE_fdd_dl_fs lte fftw3f ${Boost_LIBRARIES} ${GRUEL_LIBRARIES} ${GNURADIO_CORE_LIBRARIES})
set_target_properties(LTE_fdd_dl_fs PROPERTIES DEFINE_SYMBOL "LTE_fdd_dl_fs_EXPORTS")
install(TARGETS LTE_fdd_dl_fs LIBRARY DESTINATION lib${LIB_SUFFIX} ARCHIVE DESTINATION lib${LIB_SUFFIX} RUNTIME DESTINATION bin)
......
......@@ -34,6 +34,7 @@
and SIB7 decoding, using the latest
libraries, and fixed a bug that allowed
multiple decodes of the same channel.
03/17/2013 Ben Wojtowicz Added paging message printing.
*******************************************************************************/
......@@ -155,6 +156,7 @@ private:
void print_sib6(LIBLTE_RRC_SYS_INFO_BLOCK_TYPE_6_STRUCT *sib6);
void print_sib7(LIBLTE_RRC_SYS_INFO_BLOCK_TYPE_7_STRUCT *sib7);
void print_sib8(LIBLTE_RRC_SYS_INFO_BLOCK_TYPE_8_STRUCT *sib8);
void print_page(LIBLTE_RRC_PAGING_STRUCT *page);
};
#endif /* __LTE_FDD_DL_FS_SAMP_BUF_H__ */
......@@ -41,6 +41,7 @@
fixed a bug that allowed multiple decodes
of the same channel, and fixed a frequency
offset correction bug.
03/17/2013 Ben Wojtowicz Added paging message printing.
*******************************************************************************/
......@@ -495,13 +496,9 @@ int32 LTE_fdd_dl_fs_samp_buf::work(int32 ninput_items,
if(i == 16)
{
printf("TEST FILL RECEIVED\n");
}else{
printf("PAGING MESSAGE RECEIVED: ");
for(i=0; i<rrc_msg.N_bits; i++)
{
printf("%u", rrc_msg.msg[i]);
}
printf("\n");
}else if(LIBLTE_SUCCESS == liblte_rrc_unpack_pcch_msg(&rrc_msg,
&pcch_msg)){
print_page(&pcch_msg);
}
}else{
printf("MESSAGE RECEIVED FOR RNTI=%04X: ", pdcch.alloc[0].rnti);
......@@ -1621,3 +1618,40 @@ void LTE_fdd_dl_fs_samp_buf::print_sib8(LIBLTE_RRC_SYS_INFO_BLOCK_TYPE_8_STRUCT
sib8_printed = true;
}
}
void LTE_fdd_dl_fs_samp_buf::print_page(LIBLTE_RRC_PAGING_STRUCT *page)
{
uint32 i;
uint32 j;
printf("\tPAGE Decoded:\n");
if(0 != page->paging_record_list_size)
{
printf("\t\tNumber of paging records: %u\n", page->paging_record_list_size);
for(i=0; i<page->paging_record_list_size; i++)
{
if(LIBLTE_RRC_PAGING_UE_IDENTITY_TYPE_S_TMSI == page->paging_record_list[i].ue_identity.ue_identity_type)
{
printf("\t\t\t%s\n", "S-TMSI");
printf("\t\t\t\t%-40s= %08X\n", "M-TMSI", page->paging_record_list[i].ue_identity.s_tmsi.m_tmsi);
printf("\t\t\t\t%-40s= %u\n", "MMEC", page->paging_record_list[i].ue_identity.s_tmsi.mmec);
}else{
printf("\t\t\t%-40s=", "IMSI");
for(j=0; j<page->paging_record_list[i].ue_identity.imsi_size; j++)
{
printf("%u", page->paging_record_list[i].ue_identity.imsi[j]);
}
printf("\n");
}
printf("\t\t\t%-40s=%20s\n", "CN Domain", liblte_rrc_cn_domain_text[page->paging_record_list[i].cn_domain]);
}
}
if(true == page->system_info_modification_present)
{
printf("\t\t%-40s=%20s\n", "System Info Modification", liblte_rrc_system_info_modification_text[page->system_info_modification]);
}
if(true == page->etws_indication_present)
{
printf("\t\t%-40s=%20s\n", "ETWS Indication", liblte_rrc_etws_indication_text[page->etws_indication]);
}
}
......@@ -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 fftw3 tools pthread ${Boost_LIBRARIES} ${GRUEL_LIBRARIES} ${GNURADIO_CORE_LIBRARIES} ${GNURADIO_OSMOSDR_LIBRARIES})
target_link_libraries(LTE_fdd_dl_scan lte fftw3f tools pthread ${Boost_LIBRARIES} ${GRUEL_LIBRARIES} ${GNURADIO_CORE_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)
......@@ -44,6 +44,7 @@
03/03/2013 Ben Wojtowicz Added support for multiple sampling rates,
pre-permutation of PDCCH encoding, and
integer frequency offset detection.
03/17/2013 Ben Wojtowicz Moved to single float version of fftw.
*******************************************************************************/
......@@ -322,10 +323,10 @@ typedef struct{
uint32 N_id_cell_crs;
// Samples to Symbols & Symbols to Samples
fftw_complex *s2s_in;
fftw_complex *s2s_out;
fftw_plan symbs_to_samps_plan;
fftw_plan samps_to_symbs_plan;
fftwf_complex *s2s_in;
fftwf_complex *s2s_out;
fftwf_plan symbs_to_samps_plan;
fftwf_plan samps_to_symbs_plan;
// Viterbi decode
float vd_path_metric[128][2048];
......
......@@ -64,6 +64,7 @@
find_coarse_timing_and_freq_offset routine,
and fixed a phase wrapping bug in
get_subframe_and_ce.
03/17/2013 Ben Wojtowicz Moved to single float version of fftw.
*******************************************************************************/
......@@ -1469,18 +1470,18 @@ LIBLTE_ERROR_ENUM liblte_phy_init(LIBLTE_PHY_STRUCT **phy_struct,
}
// Samples to symbols
(*phy_struct)->s2s_in = (fftw_complex *)fftw_malloc(sizeof(fftw_complex)*(*phy_struct)->N_samps_per_symb*20);
(*phy_struct)->s2s_out = (fftw_complex *)fftw_malloc(sizeof(fftw_complex)*(*phy_struct)->N_samps_per_symb*20);
(*phy_struct)->symbs_to_samps_plan = fftw_plan_dft_1d((*phy_struct)->N_samps_per_symb,
(*phy_struct)->s2s_in,
(*phy_struct)->s2s_out,
FFTW_BACKWARD,
FFTW_MEASURE);
(*phy_struct)->samps_to_symbs_plan = fftw_plan_dft_1d((*phy_struct)->N_samps_per_symb,
(*phy_struct)->s2s_in,
(*phy_struct)->s2s_out,
FFTW_FORWARD,
FFTW_MEASURE);
(*phy_struct)->s2s_in = (fftwf_complex *)fftwf_malloc(sizeof(fftwf_complex)*(*phy_struct)->N_samps_per_symb*20);
(*phy_struct)->s2s_out = (fftwf_complex *)fftwf_malloc(sizeof(fftwf_complex)*(*phy_struct)->N_samps_per_symb*20);
(*phy_struct)->symbs_to_samps_plan = fftwf_plan_dft_1d((*phy_struct)->N_samps_per_symb,
(*phy_struct)->s2s_in,
(*phy_struct)->s2s_out,
FFTW_BACKWARD,
FFTW_MEASURE);
(*phy_struct)->samps_to_symbs_plan = fftwf_plan_dft_1d((*phy_struct)->N_samps_per_symb,
(*phy_struct)->s2s_in,
(*phy_struct)->s2s_out,
FFTW_FORWARD,
FFTW_MEASURE);
err = LIBLTE_SUCCESS;
}
......@@ -1502,10 +1503,10 @@ LIBLTE_ERROR_ENUM liblte_phy_cleanup(LIBLTE_PHY_STRUCT *phy_struct)
if(phy_struct != NULL)
{
// Samples to symbols
fftw_destroy_plan(phy_struct->samps_to_symbs_plan);
fftw_destroy_plan(phy_struct->symbs_to_samps_plan);
fftw_free(phy_struct->s2s_in);
fftw_free(phy_struct->s2s_out);
fftwf_destroy_plan(phy_struct->samps_to_symbs_plan);
fftwf_destroy_plan(phy_struct->symbs_to_samps_plan);
fftwf_free(phy_struct->s2s_in);
fftwf_free(phy_struct->s2s_out);
free(phy_struct);
err = LIBLTE_SUCCESS;
......@@ -5298,7 +5299,7 @@ void symbols_to_samples(LIBLTE_PHY_STRUCT *phy_struct,
phy_struct->s2s_in[phy_struct->N_samps_per_symb-i-1][0] = symb_re[((phy_struct->FFT_size/2)-phy_struct->FFT_pad_size)-i-1];
phy_struct->s2s_in[phy_struct->N_samps_per_symb-i-1][1] = symb_im[((phy_struct->FFT_size/2)-phy_struct->FFT_pad_size)-i-1];
}
fftw_execute(phy_struct->symbs_to_samps_plan);
fftwf_execute(phy_struct->symbs_to_samps_plan);
for(i=0; i<phy_struct->N_samps_per_symb; i++)
{
samps_re[CP_len+i] = phy_struct->s2s_out[i][0];
......@@ -5351,7 +5352,7 @@ void samples_to_symbols(LIBLTE_PHY_STRUCT *phy_struct,
phy_struct->s2s_in[i][0] = samps_re[index+CP_len-1+i];
phy_struct->s2s_in[i][1] = samps_im[index+CP_len-1+i];
}
fftw_execute(phy_struct->samps_to_symbs_plan);
fftwf_execute(phy_struct->samps_to_symbs_plan);
for(i=0; i<(phy_struct->FFT_size/2)-phy_struct->FFT_pad_size; i++)
{
// Postive spectrum
......
%
% Copyright 2011-2012 Ben Wojtowicz
% Copyright 2011-2013 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
......@@ -27,6 +27,9 @@
% with find_pss_and_fine_timing
% Ben Wojtowicz 02/16/2012 Added SIB1 decoding, fixed bugs
% in channel estimator
% Ben Wojtowicz 03/17/2013 Fixed a bug calculating the number
% of CCE resources and skipped PBCH,
% PSS and SSS while decoding PDSCH
%
function [] = lte_fdd_dl_receive(input_samps)
% DEFINES
......@@ -751,7 +754,6 @@ function [pcfich_s, phich_s, pdcch_s] = decode_pdcch(ce_sf, symb, N_sf, mib_s, N
pdcch_s.N_reg = pdcch_s.N_reg - N_rb_dl; % Remove CRS
endif
pdcch_s.N_cce = floor(pdcch_s.N_reg/9);
pdcch_s.N_reg = pdcch_s.N_cce*9;
% Extract resource elements and channel estimate 36.211 section 6.8.5 v10.1.0
% Step 1 and 2
m_prime = 0;
......@@ -1019,6 +1021,27 @@ function [pcfich_s, phich_s, pdcch_s] = decode_pdcch(ce_sf, symb, N_sf, mib_s, N
endfunction
function [pdsch_s] = decode_pdsch(ce_sf, symb, N_sf, pcfich_s, phich_s, pdcch_s, mib_s, N_id_cell, N_sc_rb, N_rb_dl)
% Determine first and last PBCH, PSS, and SSS subcarriers
if(N_rb_dl == 6)
first_sc = 0;
last_sc = (6*N_sc_rb)-1;
elseif(N_rb_dl == 15)
first_sc = (4*N_sc_rb)+6;
last_sc = (11*N_sc_rb)-7;
elseif(N_rb_dl == 25)
first_sc = (9*N_sc_rb)+6;
last_sc = (16*N_sc_rb)-7;
elseif(N_rb_dl == 50)
first_sc = 22*N_sc_rb;
last_sc = (28*N_sc_rb)-1;
elseif(N_rb_dl == 75)
first_sc = (34*N_sc_rb)+6;
last_sc = (41*N_sc_rb)-7;
else % N_rb_dl == 100
first_sc = 47*N_sc_rb;
last_sc = (53*N_sc_rb)-1;
endif
% Extract resource elements and channel estimate 36.211 section 6.3.5 v10.1.0
% FIXME: Handle PBCH/PSS/SSS
for(alloc_idx=0:pdcch_s.N_alloc-1)
......@@ -1046,6 +1069,22 @@ function [pdsch_s] = decode_pdsch(ce_sf, symb, N_sf, pcfich_s, phich_s, pdcch_s,
mod(L, 7) == 1 &&
mod(N_id_cell, 3) == mod(m, 3))
% CRS
elseif(N_sf == 0 &&
(n*N_sc_rb+m) >= first_sc &&
(n*N_sc_rb+m) <= last_sc &&
L >= 7 &&
L <= 10)
% PBCH
elseif((N_sf == 0 || N_sf == 5) &&
(n*N_sc_rb+m) >= first_sc &&
(n*N_sc_rb+m) <= last_sc &&
L == 6)
% PSS
elseif((N_sf == 0 || N_sf == 5) &&
(n*N_sc_rb+m) >= first_sc &&
(n*N_sc_rb+m) <= last_sc &&
L == 5)
% SSS
else
y_est(idx+1) = symb(L+1,n*N_sc_rb+m+1);
for(p=0:mib_s.N_ant-1)
......
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