Commit 23c63fda authored by Florian Kaltenberger's avatar Florian Kaltenberger

moving old simulators

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@7230 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent afa3a973
This diff is collapsed.
This diff is collapsed.
include $(OPENAIR_HOME)/common/utils/Makefile.inc
TOP_DIR = $(OPENAIR1_DIR)
OPENAIR1_TOP = $(OPENAIR1_DIR)
OPENAIR2_TOP = $(OPENAIR2_DIR)
OPENAIR3 = $(OPENAIR3_DIR)
CFLAGS += -m32 -DPHYSIM -DNODE_RG -DUSER_MODE -DPC_TARGET -DPC_DSP -DNB_ANTENNAS_RX=2 -DNB_ANTENNAS_TXRX=2 -DNB_ANTENNAS_TX=2 -DPHY_CONTEXT=1 -DMALLOC_CHECK_=1 # -Wno-packed-bitfield-compat -O2
CFLAGS += -DNEW_FFT
LFLAGS = -lm -lblas -lxml2 -lrt
ifdef GPIB
LFLAGS += -lgpib
endif
CFLAGS += -DOPENAIR_LTE #-DOFDMA_ULSCH #-DIFFT_FPGA -DIFFT_FPGA_UE
#CFLAGS += -DTBS_FIX
CFLAGS += -DCELLULAR
ASN1_MSG_INC = $(OPENAIR2_DIR)/RRC/LITE/MESSAGES
ifdef EMOS
CFLAGS += -DEMOS
endif
ifdef DEBUG_PHY
CFLAGS += -DDEBUG_PHY
endif
ifdef MeNBMUE
CFLAGS += -DMeNBMUE
endif
ifdef MU_RECEIVER
CFLAGS += -DMU_RECEIVER
endif
ifdef ZBF_ENABLED
CFLAGS += -DNULL_SHAPE_BF_ENABLED
endif
ifdef RANDOM_BF
CFLAGS += -DRANDOM_BF
endif
ifdef PBS_SIM
CFLAGS += -DPBS_SIM
endif
ifdef XFORMS
CFLAGS += -DXFORMS
LFLAGS += -lforms
endif
ifdef PERFECT_CE
CFLAGS += -DPERFECT_CE
endif
ifdef BIT8_TX
CFLAGS += -DBIT8_TX
endif
CFLAGS += -DNO_RRM -DOPENAIR1 #-DOPENAIR2 #-DPHY_ABSTRACTION
CFLAGS += -I/usr/include/X11 -I/usr/X11R6/include
ifdef ENABLE_FXP
CFLAGS += -DENABLE_FXP # Fxp only
else
ifdef ENABLE_FLP
CFLAGS += -DENABLE_FLP # dual_stream_correlation(), channel_compensation_prec() and qam16_qam16_mu_mimo() are flp (independently)
else
ifdef ENABLE_FULL_FLP
CFLAGS += -DENABLE_FULL_FLP # Flp inside of rx_pdsch() (dlsch_detection_mrc(), dual_stream_correlation(), channel_compensation_prec(), qam16_qam16_mu_mimo() and dlsch_16qam_16qam_llr)
else
CFLAGS += -DENABLE_FXP # Fxp only by default
endif
endif
endif
ifdef COMPARE_FLP_AND_FXP
CFLAGS += -DCOMPARE_FLP_AND_FXP
endif
ifdef RTAI
CFLAGS += -DRTAI_ENABLED -D__IN_RTAI__ $(shell rtai-config --lxrt-cflags)
LFLAGS += $(shell rtai-config --lxrt-ldflags) -llxrt
endif
include $(TOP_DIR)/PHY/Makefile.inc
SCHED_OBJS = $(TOP_DIR)/SCHED/phy_procedures_lte_common.o #$(TOP_DIR)/SCHED/phy_procedures_lte_eNb.o $(TOP_DIR)/SCHED/phy_procedures_lte_ue.o
#include $(TOP_DIR)/SCHED/Makefile.inc
include $(TOP_DIR)/SIMULATION/Makefile.inc
include $(OPENAIR2_DIR)/LAYER2/Makefile.inc
include $(OPENAIR2_DIR)/UTIL/Makefile.inc
include $(OPENAIR2_DIR)/RRC/LITE/MESSAGES/Makefile.inc
CFLAGS += $(L2_incl) -I$(ASN1_MSG_INC) -I$(TOP_DIR) -I$(OPENAIR3) $(UTIL_incl)
# EXTRA_CFLAGS =
#STATS_OBJS += $(TOP_DIR)/ARCH/CBMIMO1/DEVICE_DRIVER/cbmimo1_proc.o
OBJ = $(PHY_OBJS) $(SIMULATION_OBJS) $(TOOLS_OBJS) $(SCHED_OBJS) $(LAYER2_OBJ) $(LOG_OBJS)
ifdef GPIB
OBJ += LTE_Configuration.o
endif
#OBJ2 = $(PHY_OBJS) $(SIMULATION_OBJS) $(TOOLS_OBJS)
ifdef XFORMS
OBJ += ../../USERSPACE_TOOLS/SCOPE/lte_scope.o
endif
OBJ += $(LOG_DIR)/vcd_signal_dumper.o
all: femtosim
#$(OBJ)
femtosim : femtoUtils.o femtosim.c
@echo "Compiling femtosim.c"
@$(CC) -o femtosim femtosim.c femtoUtils.o $(CFLAGS) $(OBJ) $(LFLAGS) #-static -L/usr/lib/libblas #-lm -lblas
femtoUtils.o: $(OBJ) femtoUtils.h femtoUtils.c
@echo "Compiling femtoUtils.c"
@$(CC) -c femtoUtils.c $(CFLAGS) $(OBJ) $(LFLAGS) -L/usr/lib/libblas #-lm -lblas -DPERFECT_CE
Tester: Tester.c
@$(CC) Tester.c -o Tester $(CFLAGS)
ComparaFile: ComparaFile.c
@$(CC) ComparaFile.c -o ComparaFile
clean :
rm -f $(OBJ)
rm -f *.o
cleanall : clean
rm -f femtosim
rm -f *.exe*
#showflags :
#@echo $(CFLAGS)
#@echo $(LFLAGS)
/*******************************************************************************
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenAirInterface is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
#include <stdlib.h>
#include <time.h>
#include <stdio.h>
void main( int argc, char **argv)
{
clock_t t_ini, t_fin;
time_t tiempo = time(0);
struct tm *tlocal ;
char output[128];
int i,j,h,x,z;
int interferencias[11];
interferencias[0]=-15;
interferencias[1]=-5;
interferencias[2]=-3;
interferencias[3]=-2;
interferencias[4]=-1;
interferencias[5]=0;
interferencias[6]=1;
interferencias[7]=2;
interferencias[8]=3;
interferencias[9]=5;
interferencias[10]=15;
FILE *output_fd ;
output_fd= fopen("TesterControl.txt","w");
double secs;
char **pruebas;
int n=(4*8*4*11)+1;
pruebas= (char **) malloc(n*sizeof(char *));
for(i=0; i<n; i++) {
pruebas[i]=(char*)malloc(200*sizeof(char));
}
pruebas[0]= "./femtosim -n1000 -s0 -S25 -b0";
i=1;
x=1;
for(j=0; j<8; j++) {
for(h=0; h<4; h++) {
for( z=0; z<11; z++) {
//printf(" %d %d %d %d %d %d\n",interferencias[z],x,j,h,i,n);
sprintf(pruebas[i],"./femtosim -n1000 -s0 -S25 -a -I1 -w%d -b100%d -p%d,%d",interferencias[z],x,j,h);
i++;
sprintf(pruebas[i],"./femtosim -n1000 -s0 -S25 -a -I1 -w%d -b200%d -p%d,%d -A1 -D",interferencias[z],x,j,h);
i++;
sprintf(pruebas[i],"./femtosim -n1000 -s0 -S25 -I1 -w%d -b300%d -p%d,%d",interferencias[z],x,j,h);
i++;
sprintf(pruebas[i],"./femtosim -n1000 -s0 -S25 -I1 -w%d -b400%d -p%d,%d -A1 -D",interferencias[z],x,j,h);
i++;
x++;
}
}
}
for(i=0; i<n; i++) {
printf("\n%s",pruebas[i]);
t_ini = clock();
fprintf(output_fd,"\n%s",pruebas[i]);
tiempo = time(0);
tlocal = localtime(&tiempo);
strftime(output,128,"%d/%m/%y %H:%M:%S",tlocal);
fprintf(output_fd,"\n\tInicio: \t%s",output);
system(pruebas[i]);
tiempo = time(0);
tlocal = localtime(&tiempo);
strftime(output,128,"%d/%m/%y %H:%M:%S",tlocal);
fprintf(output_fd,"\n\tFin: \t%s",output);
}
fclose(output_fd);
}
This diff is collapsed.
/*******************************************************************************
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenAirInterface is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
#include "PHY/types.h"
#include "SIMULATION/TOOLS/defs.h"
#include <stdio.h>
#ifndef _FEMTO_UTILS
#define _FEMTO_UTILS
/*! \file SIMULATION/LTE_FEMTO/femtoUtils.h
* \brief Defines structure and function headers
* \author L. Garcia
* \date 2012
* \version 0.1
* \company Eurecom
* \note
* \warning
*/
///Top-level data Structure for general options of simulation and other global variables
typedef struct {
double snr_init;
double snr_max;
double snr_step;
int nframes;
int interf_count[8];
int fixed_channel_flag;
int fixed_data_set;
int extended_prefix_flag;
///Frame type (0 FDD, 1 TDD).
uint8_t frame_type;
///Transmission mode (1 for the moment)
uint8_t transmission_mode;
///Number of Transmit antennas in node.
uint8_t n_tx;
///Number of Receive antennas in node.
uint8_t n_rx;
///Number of interference to simulate
int nInterf;
///Array with interference level in dB
double *dbInterf;
double *probabilityInterf;
char interfLevels[150];
char interfProbability[150];
uint16_t Nid_cell;
uint16_t tdd_config;
uint8_t oversampling;
SCM_t channel_model;
SCM_t channel_modeli;
int awgn_flag;
int awgn_flagi;
int nsymb;
int num_layers;
uint16_t n_rnti;
///Modulation and code scheme
uint8_t mcs,mcs2;
uint8_t pilot1,pilot2,pilot3;
///Pointer to the output file SNRvsBLER
FILE *outputFile;
///Pointer to the output file errors and trials for each SNR
FILE *outputBler;
FILE *outputBer;
FILE *outputTrougput;
uint8_t num_rounds;
uint8_t fix_rounds;
uint8_t subframe;
// int eNB_id;
/// Amplitude of QPSK symbols
int16_t amp;
///1- Analysis of errors on DCI, 0- No analysis of errors in DCI
uint8_t dci_flag;
int testNumber;
char folderName[50];
char parameters[300];
int SIZE_TXDATAF;
int SIZE_TXDATA;
int SIZE_RXDATA;
int SIZE_RXDATAF;
uint16_t interCellId;
int n_adj_cells;
uint8_t dual_stream_UE;
int perfect_ce;
int common_flag;
int TPC;
uint8_t N_RB_DL;
int rballocset;
uint32_t DLSCH_RB_ALLOC;
PA_t p_a;
uint8_t p_b;
int8_t d_offset;
int ratio;
uint32_t nprb1, nprb2;
int prob_flag;
int search_prb2;
char power[50];
} options_t;
/// Store signal data
typedef struct {
double **s_re;
double **s_im;
double **r_re;
double **r_im;
double ***is_re;
double ***is_im;
double ***ir_re;
double ***ir_im;
} data_t;
/// Parses the command line options and assigns values ​​to pilots, num_symbols, etc. modified by the options selected
void _parseOptions(options_t *opts, int argc, char ** argv);
void _printOptions(options_t *opts);
/// Interference Levels are recivend in form num,num,num this function parse the string and fill dbInterf array
void _parseInterferenceLevels(options_t *opts, char *interfLevels,int nInterf);
void _parseInterferenceProbability(options_t *opts, char *interfLevels,int nInterf);
void _parsePower(options_t *opts);
/// Allocate memory for signal data arrays
void _allocData(options_t opts,data_t *data, uint8_t n_tx,uint8_t n_rx,int Frame_length_complex_samples);
void copyDataFixed(data_t *origin,data_t *destination,options_t *opts, int Frame_length_complex_samples);
/// Generate output dir with the prefix specified in testNumber
void _makeOutputDir(options_t *opts);
/// Initializes lte_frame_parms structure and make the structures of the eNB and EU involved in the simulation, including interference, if any.
LTE_DL_FRAME_PARMS* _lte_param_init(options_t opts);
/// Set defaults values for the simulations
void _initDefaults(options_t *opts);
/// Allocate and fill UL, CCCH and DLSCH structures
void _fill_Ul_CCCH_DLSCH_Alloc(options_t opts);
/// Allocate the eNB2UE structure for transmision and interference
void _generatesRandomChannel(options_t opts);
/** @brief This function allocates structures for a particular DLSCH at eNB.
*
* modifications will be required with more than 2 users
* It's used to generate the dci. they contain informations such as the modulation and coding scheme
* either if the transmit power control is required or not and so on...
* dlsch_eNB can suport 8 users.
* Create transport channel structures for 2 transport blocks (MIMO)
*/
void _allocDLSChannel(options_t opts);
void _generateDCI(options_t opts,DCI_ALLOC_t *dci_alloc,DCI_ALLOC_t *dci_alloc_rx);//,uint8_t **input_buffer);
uint32_t _allocRBs(options_t *opts, int ind);
void _freeMemory(data_t data,options_t opts);
void _makeSimulation(data_t data,options_t opts,DCI_ALLOC_t *dci_alloc,DCI_ALLOC_t *dci_alloc_rx,uint32_t *NB_RB2,LTE_DL_FRAME_PARMS *frame_parms,uint8_t num_pdcch_symbols);
void _printResults(uint32_t *errs,uint32_t *round_trials,uint32_t dci_errors,double rate);
void _printFileResults(double SNR, double rate1,double rate2 , double rate,uint32_t *errs,uint32_t *round_trials,uint32_t dci_errors,options_t opts,double BER);
void _initErrsRoundsTrials(uint32_t **errs,uint32_t **trials,int allocFlag,options_t opts);
void _fillData(options_t opts,data_t data,int numSubFrames);
void _applyNoise(options_t *opts,data_t data,double sigma2,double iqim,int numSubFrames);
uint8_t _generate_dci_top(int num_ue_spec_dci,int num_common_dci,DCI_ALLOC_t *dci_alloc,options_t opts,uint8_t num_pdcch_symbols);
void do_OFDM_mod(mod_sym_t **txdataF, int32_t **txdata, uint16_t next_slot, LTE_DL_FRAME_PARMS *frame_parms);
//void _apply_Multipath_Noise_Interference(options_t opts,data_t data,data_t data_fixed,double sigma2_dB,double sigma2,int numSubFrames);
void _apply_Multipath_Noise_Interference(options_t *opts,data_t data,double sigma2_dB,double sigma2,int numSubFrames,int round);
void _writeOuputOneFrame(options_t opts,uint32_t coded_bits_per_codeword,short *uncoded_ber_bit,uint32_t tbs);
void _dumpTransportBlockSegments(uint32_t C,uint32_t Cminus,uint32_t Kminus,uint32_t Kplus, uint8_t ** c_UE,uint8_t ** c_eNB);
void _applyInterference(options_t *opts,data_t data,double sigma2,double iqim,int numSubFrames,int round);
double compute_ber_soft(uint8_t* ref, int16_t* rec, int n);
void _fillPerfectChannelDescription(options_t opts,uint8_t l);
void _writeTxData(char *num,char *desc, int init, int numframes,options_t opts, int output,int senial);
#endif
This diff is collapsed.
\documentclass[a4paper]{book}
\usepackage{a4wide}
\usepackage{makeidx}
\usepackage{fancyhdr}
\usepackage{graphicx}
\usepackage{multicol}
\usepackage{float}
\usepackage{textcomp}
\usepackage{alltt}
\usepackage{amsmath}
\usepackage{amssymb}
\ifx\pdfoutput\undefined
\usepackage[ps2pdf,
pagebackref=true,
colorlinks=true,
linkcolor=blue
]{hyperref}
\usepackage{pspicture}
\else
\usepackage[pdftex,
pagebackref=true,
colorlinks=true,
linkcolor=blue
]{hyperref}
\fi
\usepackage{doxygen}
\usepackage{times}
\makeindex
\setcounter{tocdepth}{1}
\renewcommand{\footrulewidth}{0.4pt}
\begin{document}
\begin{titlepage}
\vspace*{7cm}
\begin{center}
{\Large openair Specifications }\\
Phyiscal, Medium-Access, Radio-link Control, Packet Data Convergence Protocol and Radio Resource Control Layers\\
\vspace*{1cm}
{\large Generated by Doxygen 1.3.8}\\
\vspace*{0.5cm}
{\small Sun Oct 31 19:27:37 2004}\\
\end{center}
\end{titlepage}
\clearemptydoublepage
\pagenumbering{roman}
\tableofcontents
\clearemptydoublepage
\pagenumbering{arabic}
Bler_1
Bler_2
semilogy(s1(:,1),s1(:,2),'b',s2(:,1),s2(:,2),'r');
close all
fch0e
fch1e
figure;
plot(abs(ch0e),'b'); title 'Estimated 0'
hold on
plot(abs(ch1e),'r');
hold off
dlsch0_ch_ext00
dlsch1_ch_ext00
figure;
plot(abs(dl0_ch_ext00)); title 'Ext 0';
hold on
plot(abs(dl1_ch_ext00),'r');
hold off
dlsch0_rxF_comp0
dlsch1_rxF_comp0
figure;
plot(dl0_rxF_comp0,'x') ;title 'Comp 0';
figure;
plot(dl1_rxF_comp0,'x');title 'Comp 1 interferer';
dlsch0_rxF_llr
rho
figure;
plot(real(rho_0),'x'); title 'Rho';
figure;
plot(dl0_llr,'x'); title 'Llr';
#close all
dlsch0_rxF_comp0
dlsch1_rxF_comp0
figure;
plot(dl0_rxF_comp0,'x') ;title 'Comp 0';
figure;
plot(dl1_rxF_comp0,'x');title 'Comp 1 interferer';
#plot(s0(:,1),20*log(s0(:,2)));
#fch0e;
#fch0p;
#fch1e;
#fch1p;
#plot(abs(ch0e),'r');
#hold on;
#figure;plot(abs(ch0p),'b');
#hold off;
#figure;
#plot(abs(ch1e),'m');
#hold on;
#figure;plot(abs(ch1p),'g');
#hold off;
fch0e
fch1e
figure;
plot(abs(ch0e)); title 'Estimated 0'
hold on
plot(abs(ch1e),'r');
dlsch0_ch_ext00
dlsch1_ch_ext00
figure;
plot(abs(dl0_ch_ext00)); title 'Ext 0';
figure;
plot(abs(dl1_ch_ext00)); title 'Ext 1 interferer';
dlsch0_rxF_ext0
dlsch1_rxF_ext0
figure;
plot(abs(dl0_rxF_ext0)); title 'Ext 0';
figure;
plot(abs(dl1_rxF_ext0)); title 'Ext 1 interferer';
dlsch0_rxF_llr
rho
figure;
plot(real(rho_0));
figure;
plot(dl0_llr,'x');
This diff is collapsed.
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