本文整理汇总了C++中signalVector类的典型用法代码示例。如果您正苦于以下问题:C++ signalVector类的具体用法?C++ signalVector怎么用?C++ signalVector使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了signalVector类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: interpolatePoint
complex interpolatePoint(const signalVector &inSig,
float ix)
{
float fracOffset = ix - floor(ix);
signalVector *sincVector = fetchSincVector(fracOffset);
signalVector::iterator sincPtr = sincVector->begin();
int start = (int) (floor(ix) - SINCWAVEFORMSIZE/2);
if (start < 0) {
sincPtr += (-start);
start = 0;
}
int end = (int) (floor(ix) + (SINCWAVEFORMSIZE/2)+1);
if ((unsigned) end > inSig.size()-1) end = inSig.size()-1;
complex pVal = 0.0;
if (!inSig.isRealOnly()) {
for (int i = start; i <= end; i++) {
pVal += inSig[i] * sincPtr->real();
sincPtr++;
}
}
else {
for (int i = start; i <= end; i++) {
pVal += inSig[i].real() * sincPtr->real();
sincPtr++;
}
}
return pVal;
}
开发者ID:5728136cs,项目名称:openbts-multi-arfcn,代码行数:33,代码来源:sigProcLib.cpp
示例2: vectorNorm2
float vectorNorm2(const signalVector &x)
{
signalVector::const_iterator xPtr = x.begin();
float Energy = 0.0;
for (;xPtr != x.end();xPtr++) {
Energy += xPtr->norm2();
}
return Energy;
}
开发者ID:kluchnikov,项目名称:openbts-2.6-gprs,代码行数:9,代码来源:sigProcLib.cpp
示例3: conjugateVector
/** in-place conjugation */
void conjugateVector(signalVector &x)
{
if (x.isRealOnly()) return;
signalVector::iterator xP = x.begin();
signalVector::iterator xPEnd = x.end();
while (xP < xPEnd) {
*xP = xP->conj();
xP++;
}
}
开发者ID:kluchnikov,项目名称:openbts-2.6-gprs,代码行数:11,代码来源:sigProcLib.cpp
示例4: radioifyVector
int RadioInterface::radioifyVector(signalVector &wVector,
size_t chan, bool zero)
{
if (zero)
sendBuffer[chan]->zero(wVector.size());
else
sendBuffer[chan]->write((float *) wVector.begin(), wVector.size());
return wVector.size();
}
开发者ID:Agmagor,项目名称:osmo-trx,代码行数:10,代码来源:radioInterface.cpp
示例5: unRadioifyVector
void RadioInterface::unRadioifyVector(short *shortVector, signalVector& newVector)
{
signalVector::iterator itr = newVector.begin();
short *shortItr = shortVector;
while (itr < newVector.end()) {
*itr++ = Complex<float>(*(shortItr),*(shortItr+1));
//LOG(DEEPDEBUG) << (*(itr-1));
shortItr += 2;
}
}
开发者ID:LucaBongiorni,项目名称:FuzzingProject,代码行数:12,代码来源:radioInterface.cpp
示例6: addVector
// in-place addition!!
bool addVector(signalVector &x,
signalVector &y)
{
signalVector::iterator xP = x.begin();
signalVector::iterator yP = y.begin();
signalVector::iterator xPEnd = x.end();
signalVector::iterator yPEnd = y.end();
while ((xP < xPEnd) && (yP < yPEnd)) {
*xP = *xP + *yP;
xP++; yP++;
}
return true;
}
开发者ID:kluchnikov,项目名称:openbts-2.6-gprs,代码行数:14,代码来源:sigProcLib.cpp
示例7: radioifyVector
int RadioInterface::radioifyVector(signalVector &wVector,
float *retVector,
bool zero)
{
if (zero) {
memset(retVector, 0, wVector.size() * 2 * sizeof(float));
return wVector.size();
}
memcpy(retVector, wVector.begin(), wVector.size() * 2 * sizeof(float));
return wVector.size();
}
开发者ID:WindyCitySDR,项目名称:osmo-trx,代码行数:13,代码来源:radioInterface.cpp
示例8: unRadioifyVector
int RadioInterface::unRadioifyVector(float *floatVector,
signalVector& newVector)
{
int i;
signalVector::iterator itr = newVector.begin();
for (i = 0; i < newVector.size(); i++) {
*itr++ = Complex<float>(floatVector[2 * i + 0],
floatVector[2 * i + 1]);
}
return newVector.size();
}
开发者ID:0x7678,项目名称:OpenBTS,代码行数:13,代码来源:radioInterface.cpp
示例9: peakDetect
complex peakDetect(const signalVector &rxBurst,
float *peakIndex,
float *avgPwr)
{
complex maxVal = 0.0;
float maxIndex = -1;
float sumPower = 0.0;
for (unsigned int i = 0; i < rxBurst.size(); i++) {
float samplePower = rxBurst[i].norm2();
if (samplePower > maxVal.real()) {
maxVal = samplePower;
maxIndex = i;
}
sumPower += samplePower;
}
// interpolate around the peak
// to save computation, we'll use early-late balancing
float earlyIndex = maxIndex-1;
float lateIndex = maxIndex+1;
float incr = 0.5;
while (incr > 1.0/1024.0) {
complex earlyP = interpolatePoint(rxBurst,earlyIndex);
complex lateP = interpolatePoint(rxBurst,lateIndex);
if (earlyP < lateP)
earlyIndex += incr;
else if (earlyP > lateP)
earlyIndex -= incr;
else break;
incr /= 2.0;
lateIndex = earlyIndex + 2.0;
}
maxIndex = earlyIndex + 1.0;
maxVal = interpolatePoint(rxBurst,maxIndex);
if (peakIndex!=NULL)
*peakIndex = maxIndex;
if (avgPwr!=NULL)
*avgPwr = (sumPower-maxVal.norm2()) / (rxBurst.size()-1);
return maxVal;
}
开发者ID:kluchnikov,项目名称:openbts-2.6-gprs,代码行数:49,代码来源:sigProcLib.cpp
示例10: GMSKReverseRotate
void GMSKReverseRotate(signalVector &x) {
signalVector::iterator xPtr= x.begin();
signalVector::iterator rotPtr = GMSKReverseRotation->begin();
if (x.isRealOnly()) {
while (xPtr < x.end()) {
*xPtr = *rotPtr++ * (xPtr->real());
xPtr++;
}
}
else {
while (xPtr < x.end()) {
*xPtr = *rotPtr++ * (*xPtr);
xPtr++;
}
}
}
开发者ID:kluchnikov,项目名称:openbts-2.6-gprs,代码行数:16,代码来源:sigProcLib.cpp
示例11: unRadioifyVector
int RadioInterface::unRadioifyVector(float *floatVector,
signalVector& newVector)
{
signalVector::iterator itr = newVector.begin();
if (newVector.size() > recvCursor) {
LOG(ALERT) << "Insufficient number of samples in receive buffer";
return -1;
}
for (size_t i = 0; i < newVector.size(); i++) {
*itr++ = Complex<float>(floatVector[2 * i + 0],
floatVector[2 * i + 1]);
}
return newVector.size();
}
开发者ID:WindyCitySDR,项目名称:osmo-trx,代码行数:17,代码来源:radioInterface.cpp
示例12: energyDetect
bool energyDetect(signalVector &rxBurst,
unsigned windowLength,
float detectThreshold,
float *avgPwr)
{
signalVector::const_iterator windowItr = rxBurst.begin(); //+rxBurst.size()/2 - 5*windowLength/2;
float energy = 0.0;
if (windowLength < 0) windowLength = 20;
if (windowLength > rxBurst.size()) windowLength = rxBurst.size();
for (unsigned i = 0; i < windowLength; i++) {
energy += windowItr->norm2();
windowItr+=4;
}
if (avgPwr) *avgPwr = energy/windowLength;
LOG(DEEPDEBUG) << "detected energy: " << energy/windowLength;
return (energy/windowLength > detectThreshold*detectThreshold);
}
开发者ID:kluchnikov,项目名称:openbts-2.6-gprs,代码行数:18,代码来源:sigProcLib.cpp
示例13: offsetVector
void offsetVector(signalVector &x,
complex offset)
{
signalVector::iterator xP = x.begin();
signalVector::iterator xPEnd = x.end();
if (!x.isRealOnly()) {
while (xP < xPEnd) {
*xP += offset;
xP++;
}
}
else {
while (xP < xPEnd) {
*xP = xP->real() + offset;
xP++;
}
}
}
开发者ID:kluchnikov,项目名称:openbts-2.6-gprs,代码行数:18,代码来源:sigProcLib.cpp
示例14: scaleVector
void scaleVector(signalVector &x,
complex scale)
{
signalVector::iterator xP = x.begin();
signalVector::iterator xPEnd = x.end();
if (!x.isRealOnly()) {
while (xP < xPEnd) {
*xP = *xP * scale;
xP++;
}
}
else {
while (xP < xPEnd) {
*xP = xP->real() * scale;
xP++;
}
}
}
开发者ID:kluchnikov,项目名称:openbts-2.6-gprs,代码行数:18,代码来源:sigProcLib.cpp
示例15: driveTransmitRadio
void RadioInterface::driveTransmitRadio(signalVector &radioBurst) {
if (!mOn) return;
USRPifyVector(radioBurst, sendBuffer+sendCursor, powerScaling);
sendCursor += (radioBurst.size()*2);
pushBuffer();
}
开发者ID:chiuyinglay,项目名称:OpenBTS,代码行数:10,代码来源:radioInterface.cpp
示例16: driveTransmitRadio
void RadioInterface::driveTransmitRadio(signalVector &radioBurst, bool zeroBurst) {
if (!mOn) return;
radioifyVector(radioBurst, sendBuffer + 2 * sendCursor, powerScaling, zeroBurst);
sendCursor += radioBurst.size();
pushBuffer();
}
开发者ID:0x7678,项目名称:OpenBTS,代码行数:10,代码来源:radioInterface.cpp
示例17: delayVector
void delayVector(signalVector &wBurst,
float delay)
{
int intOffset = (int) floor(delay);
float fracOffset = delay - intOffset;
// do fractional shift first, only do it for reasonable offsets
if (fabs(fracOffset) > 1e-2) {
// create sinc function
static complex staticData[21];
signalVector sincVector(staticData,0,21);
sincVector.isRealOnly(true);
signalVector::iterator sincBurstItr = sincVector.begin();
for (int i = 0; i < 21; i++)
*sincBurstItr++ = (complex) sinc(M_PI_F*(i-10-fracOffset));
static complex shiftedData[300];
signalVector shiftedBurst(shiftedData,0,wBurst.size());
convolve(&wBurst,&sincVector,&shiftedBurst,NO_DELAY);
wBurst.clone(shiftedBurst);
}
if (intOffset < 0) {
intOffset = -intOffset;
signalVector::iterator wBurstItr = wBurst.begin();
signalVector::iterator shiftedItr = wBurst.begin()+intOffset;
while (shiftedItr < wBurst.end())
*wBurstItr++ = *shiftedItr++;
while (wBurstItr < wBurst.end())
*wBurstItr++ = 0.0;
}
else {
signalVector::iterator wBurstItr = wBurst.end()-1;
signalVector::iterator shiftedItr = wBurst.end()-1-intOffset;
while (shiftedItr >= wBurst.begin())
*wBurstItr-- = *shiftedItr--;
while (wBurstItr >= wBurst.begin())
*wBurstItr-- = 0.0;
}
}
开发者ID:kluchnikov,项目名称:openbts-2.6-gprs,代码行数:41,代码来源:sigProcLib.cpp
示例18: unUSRPifyVector
void RadioInterface::unUSRPifyVector(short *shortVector, signalVector& newVector)
{
signalVector::iterator itr = newVector.begin();
short *shortItr = shortVector;
// need to flip I and Q from USRP
#ifndef SWLOOPBACK
#define FLIP_IQ 1
#else
#define FLIP_IQ 0
#endif
while (itr < newVector.end()) {
*itr++ = Complex<float>(usrp_to_host_short(*(shortItr+FLIP_IQ)),
usrp_to_host_short(*(shortItr+1-FLIP_IQ)));
//LOG(DEEPDEBUG) << (*(itr-1));
shortItr += 2;
}
}
开发者ID:chiuyinglay,项目名称:OpenBTS,代码行数:21,代码来源:radioInterface.cpp
示例19: radioifyVector
int RadioInterface::radioifyVector(signalVector &wVector,
float *retVector,
float scale,
bool zero)
{
int i;
signalVector::iterator itr = wVector.begin();
if (zero) {
memset(retVector, 0, wVector.size() * 2 * sizeof(float));
return wVector.size();
}
for (i = 0; i < wVector.size(); i++) {
retVector[2 * i + 0] = itr->real() * scale;
retVector[2 * i + 1] = itr->imag() * scale;
itr++;
}
return wVector.size();
}
开发者ID:0x7678,项目名称:OpenBTS,代码行数:21,代码来源:radioInterface.cpp
示例20: interpolatePoint
complex interpolatePoint(const signalVector &inSig,
float ix)
{
int start = (int) (floor(ix) - 10);
if (start < 0) start = 0;
int end = (int) (floor(ix) + 11);
if ((unsigned) end > inSig.size()-1) end = inSig.size()-1;
complex pVal = 0.0;
if (!inSig.isRealOnly()) {
for (int i = start; i < end; i++)
pVal += inSig[i] * sinc(M_PI_F*(i-ix));
}
else {
for (int i = start; i < end; i++)
pVal += inSig[i].real() * sinc(M_PI_F*(i-ix));
}
return pVal;
}
开发者ID:kluchnikov,项目名称:openbts-2.6-gprs,代码行数:21,代码来源:sigProcLib.cpp
注:本文中的signalVector类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论