本文整理汇总了C++中Gaussian::addCwSignal方法的典型用法代码示例。如果您正苦于以下问题:C++ Gaussian::addCwSignal方法的具体用法?C++ Gaussian::addCwSignal怎么用?C++ Gaussian::addCwSignal使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gaussian
的用法示例。
在下文中一共展示了Gaussian::addCwSignal方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sizeof
/**
* Create a time series of input data.
*
* Description:\n
* Creates a time series of complex floats representing a signal at
* a given frequency.
*/
ComplexFloat32 *
createTdData(float64_t fMHz, float64_t driftHz, int32_t samples,
float64_t noise)
{
size_t size = samples * sizeof(ComplexFloat32);
ComplexFloat32 *td = static_cast<ComplexFloat32 *> (fftwf_malloc(size));
float64_t dfMHz = fMHz - centerFreqMHz;
float64_t widthMHz = subchannels * subchannelWidthMHz;
Gaussian gen;
// no noise, just signal
gen.setup(0, widthMHz, noise);
gen.addCwSignal(dfMHz, driftHz, 1);
gen.getSamples(td, samples);
return (td);
}
示例2: MCSend
int
main(int argc, char **argv)
{
parseArgs(argc, argv);
if (beam)
channel = 0;
sndX = new MCSend(channel, mcPortX+channel, mcAddr);
sndY = new MCSend(channel, mcPortY+channel, mcAddr);
/**
* initialize the sample generators
*/
genX.setup(seedX, bandwidth, power);
genY.setup(seedY, bandwidth, power);
/**
* if we're writing to output, open the file
*/
if (packetFile.length())
openFile(packetFile);
if (beam) {
pkt = new BeamPacket(source, channel);
xPkt = new BeamPacket(source, channel);
yPkt = new BeamPacket(source, channel);
ATADataPacketHeader hdr = pkt->getHeader();
complex<float> val(1, 1);
for (uint32_t i = 0; i < hdr.len; ++i) {
pkt->putSample(i, val);
xPkt->putSample(i, val);
yPkt->putSample(i, val);
}
/**
* send packets with no valid bit to reset Channelizer
*/
createPackets(genX, genY, *xPkt, *yPkt);
sendPackets(*xPkt, *yPkt);
}
else {
pkt = new ChannelPacket(source, channel);
xPkt = new ChannelPacket(source, channel);
yPkt = new ChannelPacket(source, channel);
ATADataPacketHeader hdr = pkt->getHeader();
complex<float> val(1, 1);
for (uint32_t i = 0; i < hdr.len; ++i) {
pkt->putSample(i, val);
xPkt->putSample(i, val);
yPkt->putSample(i, val);
}
}
//
// set the valid flag for all remaining packets
//
data_valid = ATADataPacketHeader::DATA_VALID;
//
// add signals
//
for (PacketSigList::iterator p = signals.begin(); p != signals.end(); ++p) {
PacketSig sig = *p;
if (sig.tOff == 0.0)
{
if (sig.pol == ATADataPacketHeader::XLINEAR ||
sig.pol == ATADataPacketHeader::BOTH )
genX.addCwSignal(sig.freq, sig.drift, sig.snr);
if (sig.pol == ATADataPacketHeader::YLINEAR ||
sig.pol == ATADataPacketHeader::BOTH )
genY.addCwSignal(sig.freq, sig.drift, sig.snr);
}
else
{
if (sig.pol == ATADataPacketHeader::XLINEAR ||
sig.pol == ATADataPacketHeader::BOTH )
genX.addPulseSignal(sig.freq, sig.drift, sig.snr,
sig.tStart, sig.tOn, sig.tOff);
if (sig.pol == ATADataPacketHeader::YLINEAR ||
sig.pol == ATADataPacketHeader::BOTH )
genY.addPulseSignal(sig.freq, sig.drift, sig.snr,
sig.tStart, sig.tOn, sig.tOff);
}
}
gettimeofday(&start, NULL);
//
// now create and send packets at an interval or
// continuously
//
if (alarmInterval)
frameAlarm.set(&alarmHandler, alarmInterval, alarmInterval);
else
fullThrottle();
while (1)
;
}