本文整理汇总了C++中Gaussian::getPower方法的典型用法代码示例。如果您正苦于以下问题:C++ Gaussian::getPower方法的具体用法?C++ Gaussian::getPower怎么用?C++ Gaussian::getPower使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gaussian
的用法示例。
在下文中一共展示了Gaussian::getPower方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: average
/**
* Print Statistics for the generated Packets
*
* Description:\n
* Prints Total number of packets sent, the elapsed time,
* the mean power, mean real and imaginary values for the samples
* for both LCP and RCP
*
*/
void
printStatistics()
{
timeval end;
gettimeofday(&end, NULL);
int32_t sec = end.tv_sec - start.tv_sec;
int32_t usec = end.tv_usec - start.tv_usec;
if (usec < 0) {
usec += 1000000;
--sec;
}
cout << packet << " packets sent in "
<< sec << "." << usec << " seconds" << endl;
int32_t maxQueue = sndX->getSendHWM();
cout << "maximum output queue X " << maxQueue << endl;
maxQueue = sndY->getSendHWM();
cout << "maximum output queue Y " << maxQueue << endl;
int64_t samples;
float64_t total;
ComplexFloat64 power;
ComplexFloat64 fSum;
ComplexInt64 iSum;
/**
* X pol Statistics
*/
samples = genX.getSampleCnt();
power = genX.getPower();
total = power.real() + power.imag();
cout << "X pol" << endl;
cout << samples << " samples, average (float) sample power = ";
cout << total / samples << endl;
cout << "power (float): re = " << power.real() << ", im = " << power.imag();
cout << ", total = " << total << endl;
#ifdef notdef
power = genX.getIntegerPower();
total = power.real() + power.imag();
cout << samples << " samples, average (short) sample power = ";
cout << total / samples << endl;
cout << "power (integer): re = " << power.real() << ", im = ";
cout << power.imag() << ", total = " << total << endl;
#endif
fSum = genX.getSum();
cout << "sum of amplitudes (float64) = (" << fSum.real();
cout << ", " << fSum.imag() << ")" << endl;
cout << "avg of amplitudes (float64) = (" << fSum.real() / samples;
cout << ", " << fSum.imag() / samples << ")" << endl;
#ifdef notdef
iSum = genX.getIntegerSum();
cout << "sum of amplitudes (short) = (" << iSum.real();
cout << ", " << iSum.imag() << ")" << endl;
cout << "avg of amplitudes (short) = (";
cout << (float64_t) iSum.real() / samples;
cout << ", " << (float64_t) iSum.imag() / samples << ")" << endl;
#endif
/**
* Y pol Statistics
*/
samples = genY.getSampleCnt();
power = genY.getPower();
total = power.real() + power.imag();
cout << "Y pol" << endl;
cout << samples << " samples, average (float) sample power = ";
cout << total / samples << endl;
cout << "power (float): re = " << power.real() << ", im = " << power.imag();
cout << ", total = " << total << endl;
#ifdef notdef
power = genY.getIntegerPower();
total = power.real() + power.imag();
cout << samples << " samples, average (short) sample power = ";
cout << total / samples << endl;
cout << "power (integer): re = " << power.real() << ", im = ";
cout << power.imag() << ", total = " << total << endl;
#endif
fSum = genY.getSum();
cout << "sum of amplitudes (float64) = (" << fSum.real();
cout << ", " << fSum.imag() << ")" << endl;
cout << "avg of amplitudes (float64) = (" << fSum.real() / samples;
cout << ", " << fSum.imag() / samples << ")" << endl;
#ifdef notdef
iSum = genY.getIntegerSum();
cout << "sum of amplitudes (short) = (" << iSum.real();
cout << ", " << iSum.imag() << ")" << endl;
cout << "avg of amplitudes (short) = (";
cout << (float64_t) iSum.real() / samples;
cout << ", " << (float64_t) iSum.imag() / samples << ")" << endl;
#endif
}