The QAM modulator in IT++ supports only square constellations, i.e. M = 2^(2k), where k = 1,2,3,...,etc. If you want two-point constellation, please use BPSK or PSK class instead.
BTW, you discovered a minor bug in the set_M() function: the assertion check is wrong there and does not detect that M = 2,8,32,...,etc. values are not supported. I will fix this issue in the SVN sources. The fix will be included in the next stable and development releases of IT++ (3.10.9 and 3.99.1 respectively).
BR,
/ediap
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
I am having trouble instantiating a QAM object. During runtime, I get the following message:
*** Assertion failed in ../../itpp/base/vec.h on line 192:
Negative size in Vec::Vec(int) (size>=0)
Abort trap
Here is my code snippet:
include <itpp/comm/modulator.h>
using namespace itpp;
int main()
{
QAM q(2);
return 0;
}
If I use the PAM constructor instead of QAM, there are no runtime issues.
I am using Mac OS X 10.4
Thanks in advance,
Chinmoy.
Hi Chinmoy,
The QAM modulator in IT++ supports only square constellations, i.e. M = 2^(2k), where k = 1,2,3,...,etc. If you want two-point constellation, please use BPSK or PSK class instead.
BTW, you discovered a minor bug in the set_M() function: the assertion check is wrong there and does not detect that M = 2,8,32,...,etc. values are not supported. I will fix this issue in the SVN sources. The fix will be included in the next stable and development releases of IT++ (3.10.9 and 3.99.1 respectively).
BR,
/ediap