Closed FarshadKoohifar closed 7 years ago
this code doesn't compile under liquid 1.3.0. have you tried upgrading?
Thanks Brian. The truth is, I have tried to upgrade, but could not!
I am running 1.2.0 and the code is basically a direct copy and paste from the tutorial. On README.md, there are two ways to install. The git clone way fails to ./bootstrap.sh with this:
./bootstrap.sh: 30: ./bootstrap.sh: aclocal: not found ./bootstrap.sh: 31: ./bootstrap.sh: autoconf: not found ./bootstrap.sh: 32: ./bootstrap.sh: autoheader: not found
Tarball link is broken, so I cannot try to bypass bootstrap.
Are you on linux? What happens if you run sudo apt-get install automake
?
Farshad, I can try to help you upgrade to 1.3.0. There was a memory leak that was fixed with this version that I can confirm does NOT exist with 1.3.0 using valgrind.
Thanks a lot Joseph and Brian! I have upgraded and confirmed that the issue is resolved.
I am using this code to generate a lot of frames with different modulation and coding schemes. I noticed that the ofdmflexframe api is leaking memory in the process: `
include
include
include
include
include <liquid/liquid.h>
include
// options const unsigned int M = 64; // number of subcarriers const unsigned int cp_len = 16; // cyclic prefix length const unsigned int taper_len = 4; // taper length const unsigned int payload_len = 64; // length of payload (bytes) const unsigned int symbol_len = M + cp_len; // samples per OFDM symbol std::complex buffer[symbol_len]; // time-domain buffer
unsigned char header[8]; // header
unsigned char payload[payload_len]; // payload
const int instantCount=1000;
const int minSnr=-3;
const int maxSnr=30;
const int numModulations=5;
// global book keeping int detectedFrames; int errorBits; int errorBlocks; int errorHeader; int samplesPerFrame;
// Function that return count of // flipped number int FlippedCount(unsigned char a, unsigned char b){ unsigned char n=a^b; int count = 0; while (n){ count += n & 1; n >>= 1; } return count; }
// callback function int mycallback(unsigned char _header,int _header_valid,unsigned char _payload,unsigned int _payload_len,int _payload_valid,framesyncstats_s _stats,void _userdata){ if (!_header_valid){ errorHeader++; } detectedFrames++; for (unsigned int i=0;i<_payload_len;i++){ errorBits+=FlippedCount(_payload[i],payload[i]); } if(!_payload_valid){ errorBlocks++; } return 0; } struct scenario {modulation_scheme ms;fec_scheme fec1;}; int main() { FILE fp; fp = fopen ("simulationResults.txt", "w+"); const modulation_scheme myModulations[numModulations]={ LIQUID_MODEM_BPSK, LIQUID_MODEM_QAM4, LIQUID_MODEM_QAM16, LIQUID_MODEM_QAM64, LIQUID_MODEM_QAM256}; const int numFecs=18; fec_scheme myFecs[numFecs]={LIQUID_FEC_NONE, // no error-correction // codecs not defined internally (see http://www.ka9q.net/code/fec/) LIQUID_FEC_CONV_V27, // r1/2, K=7, dfree=10 LIQUID_FEC_CONV_V29, // r1/2, K=9, dfree=12 LIQUID_FEC_CONV_V39, // r1/3, K=9, dfree=18 LIQUID_FEC_CONV_V615, // r1/6, K=15, dfree<=57 (Heller 1968)
}
`