diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index b4e2090dcd755bdaad1e4bb9a9fec10baef1d757..f7b50a33287e09cdca8113b4f4e892e406f51633 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -2297,6 +2297,9 @@ target_link_libraries (dlsim_tm4 pthread m rt ${CONFIG_LIBRARIES} ${ATLAS_LIBRARIES} ${XFORMS_LIBRARIES} ${T_LIB} ) +add_executable(polartest ${OPENAIR1_DIR}/PHY/CODING/TESTBENCH/polartest.c) +target_link_libraries(polartest m SIMU PHY PHY_NR -lm ${ATLAS_LIBRARIES}) + foreach(myExe dlsim dlsim_tm7 ulsim pbchsim scansim mbmssim pdcchsim pucchsim prachsim syncsim) add_executable(${myExe} diff --git a/openair1/PHY/CODING/TESTBENCH/polartest.c b/openair1/PHY/CODING/TESTBENCH/polartest.c index cdf99a06eb6c934a10212d85a78169870bdef781..736eeec6591b58ee438fa589f292caaa0dca6117 100644 --- a/openair1/PHY/CODING/TESTBENCH/polartest.c +++ b/openair1/PHY/CODING/TESTBENCH/polartest.c @@ -8,7 +8,7 @@ #include "PHY/CODING/nrPolar_tools/nr_polar_defs.h" #include "PHY/CODING/nrPolar_tools/nr_polar_pbch_defs.h" -#include "SIMULATION/TOOLS/defs.h" +#include "SIMULATION/TOOLS/sim.h" int main(int argc, char *argv[]) { @@ -22,7 +22,7 @@ int main(int argc, char *argv[]) { randominit(0); //Default simulation values (Aim for iterations = 1000000.) int itr, iterations = 1000, arguments, polarMessageType = 1; //0=DCI, 1=PBCH, 2=UCI - double SNRstart = -20.0, SNRstop = 20.0, SNRinc= 0.5; //dB + double SNRstart = -20.0, SNRstop = 0.0, SNRinc= 0.5; //dB double SNR, SNR_lin; int16_t nBitError = 0; // -1 = Decoding failed (All list entries have failed the CRC checks). @@ -83,17 +83,19 @@ int main(int argc, char *argv[]) { //Logging time_t currentTime; time (¤tTime); - char fileName[512], currentTimeInfo[25]; + char *folderName, fileName[512], currentTimeInfo[25]; - sprintf(fileName,"./polartestResults/_ListSize_%d_pmAppr_%d_Payload_%d_Itr_%d",decoderListSize,pathMetricAppr,testLength,iterations); + folderName=getenv("HOME"); + strcat(folderName,"/Desktop/polartestResults"); + sprintf(fileName,"%s/_ListSize_%d_pmAppr_%d_Payload_%d_Itr_%d",folderName,decoderListSize,pathMetricAppr,testLength,iterations); strftime(currentTimeInfo, 25, "_%Y-%m-%d-%H-%M-%S.csv", localtime(¤tTime)); strcat(fileName,currentTimeInfo); - //Create "./polartestResults" folder if it doesn't already exist. + //Create "~/Desktop/polartestResults" folder if it doesn't already exist. struct stat folder = {0}; - if (stat("./polartestResults", &folder) == -1) mkdir("./polartestResults", S_IRWXU | S_IRWXO); + if (stat(folderName, &folder) == -1) mkdir(folderName, S_IRWXU | S_IRWXG | S_IRWXO); - FILE* logFile; + FILE* logFile; logFile = fopen(fileName, "w"); if (logFile==NULL) { fprintf(stderr,"[polartest.c] Problem creating file %s with fopen\n",fileName); diff --git a/openair1/PHY/CODING/nrPolar_tools/nr_polar_plot.m b/openair1/PHY/CODING/nrPolar_tools/nr_polar_plot.m deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000