diff --git a/openair1/USERSPACE_TOOLS/MATLAB/Makefile b/openair1/USERSPACE_TOOLS/MATLAB/Makefile index aad8d04b5a..7e1d3bfbcd 100644 --- a/openair1/USERSPACE_TOOLS/MATLAB/Makefile +++ b/openair1/USERSPACE_TOOLS/MATLAB/Makefile @@ -1,13 +1,13 @@ include $(OPENAIR1_DIR)/SIMULATION/LTE_PHY/Makefile CFLAGS += -DMEX -CFLAGS += -I/packages/matlab_r2012a/extern/include/ +CFLAGS += -I/opt/MATLAB/extern/include/ # Set mex extension, can be determined with mexext function in Matlab MEXEXT = mexglx # Just compile all the PHY objects -OBJ = $(PHY_OBJS) $(TOP_DIR)/SIMULATION/TOOLS/taus.o +OBJ = $(PHY_OBJS) $(TOP_DIR)/SIMULATION/TOOLS/taus.o $(LOG_DIR)/log.o $(LOG_DIR)/vcd_signal_dumper.o # List of all mex-files to compile MEX_FILES += ./PHY/LTE_TRANSPORT/mexfiles/get_tbs.$(MEXEXT) @@ -43,7 +43,7 @@ libs : $(OBJ) $(MEX_FILES) : %.$(MEXEXT) : %.c @echo @echo Compiling $< ... - @mex CFLAGS="$(CFLAGS)" -f /homes/wagner/.matlab/R2012a/mexopts.sh -l$(LIBNAME) -L$(LIBDIR) -output $@ $< + @mex CFLAGS="$(CFLAGS)" -l$(LIBNAME) -L$(LIBDIR) -output $@ $< mex : $(MEX_FILES) diff --git a/openair1/USERSPACE_TOOLS/MATLAB/PHY/LTE_TRANSPORT/mexfiles/dlsch_channel_compensation_prec.c b/openair1/USERSPACE_TOOLS/MATLAB/PHY/LTE_TRANSPORT/mexfiles/dlsch_channel_compensation_prec.c index 80fb6cb9d8..ea5e072929 100644 --- a/openair1/USERSPACE_TOOLS/MATLAB/PHY/LTE_TRANSPORT/mexfiles/dlsch_channel_compensation_prec.c +++ b/openair1/USERSPACE_TOOLS/MATLAB/PHY/LTE_TRANSPORT/mexfiles/dlsch_channel_compensation_prec.c @@ -1,5 +1,5 @@ -#include "defs.h" - +#include "../../../defs.h" + /*============================================================================== * dlsch_channel_compensation_prec.c * diff --git a/openair1/USERSPACE_TOOLS/MATLAB/PHY/LTE_TRANSPORT/mexfiles/dlsch_channel_level_prec.c b/openair1/USERSPACE_TOOLS/MATLAB/PHY/LTE_TRANSPORT/mexfiles/dlsch_channel_level_prec.c index 9cafcd107b..15e294d687 100644 --- a/openair1/USERSPACE_TOOLS/MATLAB/PHY/LTE_TRANSPORT/mexfiles/dlsch_channel_level_prec.c +++ b/openair1/USERSPACE_TOOLS/MATLAB/PHY/LTE_TRANSPORT/mexfiles/dlsch_channel_level_prec.c @@ -1,5 +1,5 @@ -#include "defs.h" - +#include "../../../defs.h" + /*============================================================================== * dlsch_channel_level_prec.c * diff --git a/openair1/USERSPACE_TOOLS/MATLAB/PHY/LTE_TRANSPORT/mexfiles/dlsch_decoding.c b/openair1/USERSPACE_TOOLS/MATLAB/PHY/LTE_TRANSPORT/mexfiles/dlsch_decoding.c index b224202352..5096f22bec 100644 --- a/openair1/USERSPACE_TOOLS/MATLAB/PHY/LTE_TRANSPORT/mexfiles/dlsch_decoding.c +++ b/openair1/USERSPACE_TOOLS/MATLAB/PHY/LTE_TRANSPORT/mexfiles/dlsch_decoding.c @@ -1,4 +1,4 @@ -#include "defs.h" +#include "../../../defs.h" /*============================================================================== * dlsch_encoding.c @@ -33,7 +33,7 @@ void mexFunction( int mlhs, mxArray *plhs[], LTE_UE_DLSCH_t* dlsch; LTE_DL_FRAME_PARMS *frame_parms; PHY_VARS_UE *phy_vars_ue; - extern int *pi2tab[188],*pi5tab[188],*pi4tab[188],*pi6tab[188]; + extern int *pi2tab16[188],*pi5tab16[188],*pi4tab16[188],*pi6tab16[188]; unsigned int *ptr_td; int *tmp[1]; @@ -54,7 +54,7 @@ void mexFunction( int mlhs, mxArray *plhs[], #endif /* Create new dlsch */ - dlsch = new_ue_dlsch(Kmimo,Mdlharq,abstraction_flag); + dlsch = new_ue_dlsch(Kmimo,Mdlharq,8,25,abstraction_flag); // Init CRC tables crcTableInit(); @@ -70,16 +70,16 @@ void mexFunction( int mlhs, mxArray *plhs[], #endif memcpy(&tmp[0], &ptr_td[0], sizeof(ptr_td[0])); - memcpy(&pi2tab[0], tmp[0], 188*sizeof(pi2tab[0])); + memcpy(&pi2tab16[0], tmp[0], 188*sizeof(pi2tab16[0])); memcpy(&tmp[0], &ptr_td[1], sizeof(ptr_td[1])); - memcpy(&pi4tab[0], tmp[0], 188*sizeof(pi4tab[0])); + memcpy(&pi4tab16[0], tmp[0], 188*sizeof(pi4tab16[0])); memcpy(&tmp[0], &ptr_td[2], sizeof(ptr_td[2])); - memcpy(&pi5tab[0], tmp[0], 188*sizeof(pi5tab[0])); + memcpy(&pi5tab16[0], tmp[0], 188*sizeof(pi5tab16[0])); memcpy(&tmp[0], &ptr_td[3], sizeof(ptr_td[3])); - memcpy(&pi6tab[0], tmp[0], 188*sizeof(pi6tab[0])); + memcpy(&pi6tab16[0], tmp[0], 188*sizeof(pi6tab16[0])); harq_pid = (unsigned char) mxGetScalar(mxGetField(prhs[2],0,"harq_pid")); dlsch->current_harq_pid = harq_pid; diff --git a/openair1/USERSPACE_TOOLS/MATLAB/PHY/LTE_TRANSPORT/mexfiles/dlsch_decoding_init.c b/openair1/USERSPACE_TOOLS/MATLAB/PHY/LTE_TRANSPORT/mexfiles/dlsch_decoding_init.c index 6c5100b3ee..f1ffcdb70f 100644 --- a/openair1/USERSPACE_TOOLS/MATLAB/PHY/LTE_TRANSPORT/mexfiles/dlsch_decoding_init.c +++ b/openair1/USERSPACE_TOOLS/MATLAB/PHY/LTE_TRANSPORT/mexfiles/dlsch_decoding_init.c @@ -1,11 +1,11 @@ -#include "defs.h" +#include "../../../defs.h" /*============================================================================== * dlsch_encoding_init.c * * Returns the decoded bit sequence. * -* example: dlsch_encoding_init(struct1) +* example: dlsch_decoding_init(struct1) * * Author: Sebastian Wagner * Date: 23-07-2012 @@ -18,7 +18,7 @@ void mexFunction( int mlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] ) { - extern int *pi2tab[188],*pi5tab[188],*pi4tab[188],*pi6tab[188]; + extern int *pi2tab16[188],*pi5tab16[188],*pi4tab16[188],*pi6tab16[188]; int i; unsigned int *ptr; int **tmp[1]; @@ -31,20 +31,20 @@ void mexFunction( int mlhs, mxArray *plhs[], plhs[0] = mxCreateNumericMatrix(4,1, mxUINT32_CLASS, mxREAL); ptr = (unsigned int*) mxGetData(plhs[0]); - tmp[0] = &pi2tab[0]; + tmp[0] = &pi2tab16[0]; memcpy(&ptr[0], tmp, sizeof(tmp[0])); - tmp[0] = &pi4tab[0]; + tmp[0] = &pi4tab16[0]; memcpy(&ptr[1], tmp, sizeof(tmp[0])); - tmp[0] = &pi5tab[0]; + tmp[0] = &pi5tab16[0]; memcpy(&ptr[2], tmp, sizeof(tmp[0])); - tmp[0] = &pi6tab[0]; + tmp[0] = &pi6tab16[0]; memcpy(&ptr[3], tmp, sizeof(tmp[0])); #ifdef DEBUG_DLSCH_DECODING_INIT - mexPrintf("pi2tab %p\n",&pi2tab[0]); - mexPrintf("pi4tab %p\n",&pi4tab[0]); - mexPrintf("pi5tab %p\n",&pi5tab[0]); - mexPrintf("pi6tab %p\n",&pi6tab[0]); + mexPrintf("pi2tab %p\n",&pi2tab16[0]); + mexPrintf("pi4tab %p\n",&pi4tab16[0]); + mexPrintf("pi5tab %p\n",&pi5tab16[0]); + mexPrintf("pi6tab %p\n",&pi6tab16[0]); mexPrintf("ptr0 %p\n",ptr[0]); mexPrintf("ptr1 %p\n",ptr[1]); @@ -55,9 +55,9 @@ void mexFunction( int mlhs, mxArray *plhs[], // The memory here is never explictly freed via mxFree. It is implicitly taken // care of by clear functions at the beginning of the simulation. for (i=0;i<188;i++) { - mexMakeMemoryPersistent((void *) pi2tab[i]); - mexMakeMemoryPersistent((void *) pi5tab[i]); - mexMakeMemoryPersistent((void *) pi4tab[i]); - mexMakeMemoryPersistent((void *) pi6tab[i]); + mexMakeMemoryPersistent((void *) pi2tab16[i]); + mexMakeMemoryPersistent((void *) pi5tab16[i]); + mexMakeMemoryPersistent((void *) pi4tab16[i]); + mexMakeMemoryPersistent((void *) pi6tab16[i]); } } diff --git a/openair1/USERSPACE_TOOLS/MATLAB/PHY/LTE_TRANSPORT/mexfiles/dlsch_detection_mrc.c b/openair1/USERSPACE_TOOLS/MATLAB/PHY/LTE_TRANSPORT/mexfiles/dlsch_detection_mrc.c index ef96b75d3c..2a9d551093 100644 --- a/openair1/USERSPACE_TOOLS/MATLAB/PHY/LTE_TRANSPORT/mexfiles/dlsch_detection_mrc.c +++ b/openair1/USERSPACE_TOOLS/MATLAB/PHY/LTE_TRANSPORT/mexfiles/dlsch_detection_mrc.c @@ -1,4 +1,4 @@ -#include "defs.h" +#include "../../../defs.h" /*============================================================================== * dlsch_detection_mrc.c diff --git a/openair1/USERSPACE_TOOLS/MATLAB/PHY/LTE_TRANSPORT/mexfiles/dlsch_dual_stream_correlation.c b/openair1/USERSPACE_TOOLS/MATLAB/PHY/LTE_TRANSPORT/mexfiles/dlsch_dual_stream_correlation.c index f078a174b3..15b880f61c 100644 --- a/openair1/USERSPACE_TOOLS/MATLAB/PHY/LTE_TRANSPORT/mexfiles/dlsch_dual_stream_correlation.c +++ b/openair1/USERSPACE_TOOLS/MATLAB/PHY/LTE_TRANSPORT/mexfiles/dlsch_dual_stream_correlation.c @@ -1,4 +1,4 @@ -#include "defs.h" +#include "../../../defs.h" /*============================================================================== * dlsch_dual_stream_correlation.c diff --git a/openair1/USERSPACE_TOOLS/MATLAB/PHY/LTE_TRANSPORT/mexfiles/dlsch_encoding.c b/openair1/USERSPACE_TOOLS/MATLAB/PHY/LTE_TRANSPORT/mexfiles/dlsch_encoding.c index dee232f986..86bd0e545a 100644 --- a/openair1/USERSPACE_TOOLS/MATLAB/PHY/LTE_TRANSPORT/mexfiles/dlsch_encoding.c +++ b/openair1/USERSPACE_TOOLS/MATLAB/PHY/LTE_TRANSPORT/mexfiles/dlsch_encoding.c @@ -1,4 +1,4 @@ -#include "defs.h" +#include "../../../defs.h" /*============================================================================== * dlsch_encoding.c @@ -71,7 +71,7 @@ void mexFunction( int nlhs, mxArray *plhs[], abstraction_flag = (unsigned char) mxGetScalar(tmp); } - dlsch = new_eNB_dlsch(Kmimo,Mdlharq,abstraction_flag); + dlsch = new_eNB_dlsch(Kmimo,Mdlharq,25,abstraction_flag); /* Allocate input */ input_buffer = (unsigned char*) mxGetData(prhs[0]); diff --git a/openair1/USERSPACE_TOOLS/MATLAB/PHY/LTE_TRANSPORT/mexfiles/dlsch_mu_mimo_llr.c b/openair1/USERSPACE_TOOLS/MATLAB/PHY/LTE_TRANSPORT/mexfiles/dlsch_mu_mimo_llr.c index 71cae8679f..f382611c44 100644 --- a/openair1/USERSPACE_TOOLS/MATLAB/PHY/LTE_TRANSPORT/mexfiles/dlsch_mu_mimo_llr.c +++ b/openair1/USERSPACE_TOOLS/MATLAB/PHY/LTE_TRANSPORT/mexfiles/dlsch_mu_mimo_llr.c @@ -1,5 +1,5 @@ -#include "defs.h" - +#include "../../../defs.h" + /*============================================================================== * dlsch_mu_mimo_llr.c * diff --git a/openair1/USERSPACE_TOOLS/MATLAB/PHY/LTE_TRANSPORT/mexfiles/get_tbs.c b/openair1/USERSPACE_TOOLS/MATLAB/PHY/LTE_TRANSPORT/mexfiles/get_tbs.c index b155b276e0..125b3d796e 100644 --- a/openair1/USERSPACE_TOOLS/MATLAB/PHY/LTE_TRANSPORT/mexfiles/get_tbs.c +++ b/openair1/USERSPACE_TOOLS/MATLAB/PHY/LTE_TRANSPORT/mexfiles/get_tbs.c @@ -1,4 +1,4 @@ -#include "defs.h" +#include "../../../defs.h" /*============================================================================== * get_tbs.c diff --git a/openair1/USERSPACE_TOOLS/MATLAB/PHY/TOOLS/mexfiles/log2_approx.c b/openair1/USERSPACE_TOOLS/MATLAB/PHY/TOOLS/mexfiles/log2_approx.c index b8a58848bd..72196f6ea7 100644 --- a/openair1/USERSPACE_TOOLS/MATLAB/PHY/TOOLS/mexfiles/log2_approx.c +++ b/openair1/USERSPACE_TOOLS/MATLAB/PHY/TOOLS/mexfiles/log2_approx.c @@ -1,4 +1,4 @@ -#include "defs.h" +#include "../../../defs.h" void mexFunction( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] diff --git a/openair1/USERSPACE_TOOLS/MATLAB/SIMULATION/LTE_PHY/TM4/InitSimparms.m b/openair1/USERSPACE_TOOLS/MATLAB/SIMULATION/LTE_PHY/TM4/InitSimparms.m index 819fb36303..2f395cf378 100644 --- a/openair1/USERSPACE_TOOLS/MATLAB/SIMULATION/LTE_PHY/TM4/InitSimparms.m +++ b/openair1/USERSPACE_TOOLS/MATLAB/SIMULATION/LTE_PHY/TM4/InitSimparms.m @@ -47,8 +47,13 @@ simparms.tseeds = set_taus_seed(1); % taus seeds simparms.ptr_td = dlsch_decoding_init(); % Init codewords +% simparms.codeword(1) = InitCodeword(simparms,mcs(1)); +% simparms.codeword(2) = InitCodeword(simparms,mcs(2)); + simparms.codeword(1) = InitCodeword(simparms,mcs(1)); simparms.codeword(2) = InitCodeword(simparms,mcs(2)); +% simparms.codeword(3) = InitCodeword(simparms,mcs(1)); +% simparms.codeword(4) = InitCodeword(simparms,mcs(1)); end diff --git a/openair1/USERSPACE_TOOLS/MATLAB/SIMULATION/LTE_PHY/TM4/tm4.m b/openair1/USERSPACE_TOOLS/MATLAB/SIMULATION/LTE_PHY/TM4/tm4.m index e904a510ad..fa6dcf5000 100644 --- a/openair1/USERSPACE_TOOLS/MATLAB/SIMULATION/LTE_PHY/TM4/tm4.m +++ b/openair1/USERSPACE_TOOLS/MATLAB/SIMULATION/LTE_PHY/TM4/tm4.m @@ -29,13 +29,12 @@ addpath('../../../PHY/TOOLS/mexfiles'); addpath('../../../SIMULATION/TOOLS/mexfiles'); % profile on; - %% System parameters nt = 2; % number of transmit antennas nr = 2; % number of receive antennas N = 100; % number of frames (or subframes, codewords) nSNR = 1; % number of SNR points -SNRdB = 20; % SNR per receive antenna in dB +SNRdB = 5; % SNR per receive antenna in dB % nSNR = 13; % SNRdB = linspace(8,20,nSNR); MCS = [16 16]; % MCS for the 2 users @@ -84,7 +83,7 @@ noise = zeros(simparms.NB_ANTENNAS_RX,simparms.nb_re); %% XFORMS if (XFORMS) - scrsz = get(0,'ScreenSize'); + scrsz = get(0,'ScreenSize');mu_mimo figure('Position',[1 scrsz(4)/2 scrsz(3)/2 scrsz(4)/2]) subplot(1,2,1); xlim([1 simparms.codeword(1).G]); @@ -199,7 +198,7 @@ for iSNR=1:length(simparms.snr) Hmagb0(idxs:idxe,:)]... = dlsch_channel_compensation_prec(y_fxp_t,H_fxp_t,pmi_ext,simparms,simparms.codeword(1),symbol-1); - % Interfering user + % Interfering stream [ymf1(idxs:idxe,:)... Heff1(idxs:idxe,:)... Hmag1(idxs:idxe,:)... diff --git a/openair1/USERSPACE_TOOLS/MATLAB/SIMULATION/LTE_PHY/TM5/tm5.m b/openair1/USERSPACE_TOOLS/MATLAB/SIMULATION/LTE_PHY/TM5/tm5.m index 81b1d9e940..03278f4f95 100644 --- a/openair1/USERSPACE_TOOLS/MATLAB/SIMULATION/LTE_PHY/TM5/tm5.m +++ b/openair1/USERSPACE_TOOLS/MATLAB/SIMULATION/LTE_PHY/TM5/tm5.m @@ -18,15 +18,16 @@ addpath('../../../PHY/TOOLS/mexfiles'); addpath('../../../SIMULATION/TOOLS/mexfiles'); % profile on; - +tic %% System parameters nt = 2; -nr = 1; +nr = 2; N = 1000; % number of frames (codewords) nSNR = 1; -SNRdB = 30; +%SNRdB = [1:20]; +SNRdB = 10; % nSNR = 13; -% SNRdB = linspace(8,20,nSNR); +%SNRdB = linspace(1,20,nSNR); MCS = [9 9]; % MCS for the 2 users, currently it is assumed that mcs(2)=mcs(1) j = sqrt(-1); amp = 1/32; @@ -237,12 +238,12 @@ for iSNR=1:length(simparms.snr) end %% Post Processing -% total_frame_erros = sum(frame_errors,2); -% fer = total_frame_erros/N; -% figure; semilogy(SNRdB,fer); grid; +% total_frame_erros = sum(simparms.frame_errors,2); +% fer = total_frame_erros/N; +% figure; semilogy(SNRdB,fer); grid; +% +% disp(fer); % -% disp(fer); - % profile viewer - +toc diff --git a/openair1/USERSPACE_TOOLS/MATLAB/SIMULATION/TOOLS/mexfiles/set_taus_seed.c b/openair1/USERSPACE_TOOLS/MATLAB/SIMULATION/TOOLS/mexfiles/set_taus_seed.c index 4f477ca14e..ce59da4504 100644 --- a/openair1/USERSPACE_TOOLS/MATLAB/SIMULATION/TOOLS/mexfiles/set_taus_seed.c +++ b/openair1/USERSPACE_TOOLS/MATLAB/SIMULATION/TOOLS/mexfiles/set_taus_seed.c @@ -1,4 +1,4 @@ -#include "defs.h" +#include "../../../defs.h" /*============================================================================== * set_taus_seed.c diff --git a/openair1/USERSPACE_TOOLS/MATLAB/SIMULATION/TOOLS/mexfiles/taus.c b/openair1/USERSPACE_TOOLS/MATLAB/SIMULATION/TOOLS/mexfiles/taus.c index c18c54b5c0..a3b9f33240 100644 --- a/openair1/USERSPACE_TOOLS/MATLAB/SIMULATION/TOOLS/mexfiles/taus.c +++ b/openair1/USERSPACE_TOOLS/MATLAB/SIMULATION/TOOLS/mexfiles/taus.c @@ -1,4 +1,4 @@ -#include "defs.h" +#include "../../../defs.h" /*============================================================================== * taus.c @@ -62,7 +62,6 @@ void mexFunction( int nlhs, mxArray *plhs[], for(i=0;i