24 #include "cheetah/rcpt_low/BeamFormerDataTraits.h" 25 #include <panda/Log.h> 33 template<
typename PacketDataType,
unsigned TimeSamplesPerPacket,
unsigned ChannelsPerPacket>
34 BeamFormerDataTraits<PacketDataType, TimeSamplesPerPacket, ChannelsPerPacket>::BeamFormerDataTraits()
38 template<
typename PacketDataType,
unsigned TimeSamplesPerPacket,
unsigned ChannelsPerPacket>
39 BeamFormerDataTraits<PacketDataType, TimeSamplesPerPacket, ChannelsPerPacket>::~BeamFormerDataTraits()
44 template<
typename PacketDataType,
unsigned TimeSamplesPerPacket,
unsigned ChannelsPerPacket>
50 template<
typename PacketDataType,
unsigned TimeSamplesPerPacket,
unsigned ChannelsPerPacket>
56 template<
typename PacketDataType,
unsigned TimeSamplesPerPacket,
unsigned ChannelsPerPacket>
59 return (PacketInspector::Packet::number_of_samples()/2);
62 template<
typename PacketDataType,
unsigned TimeSamplesPerPacket,
unsigned ChannelsPerPacket>
65 return PacketInspector::Packet::data_size();
68 template<
typename PacketDataType,
unsigned TimeSamplesPerPacket,
unsigned ChannelsPerPacket>
71 return inspector.packet().first_channel_number() == 0;
74 template<
typename PacketDataType,
unsigned TimeSamplesPerPacket,
unsigned ChannelsPerPacket>
77 if(packets_missing > 0)
79 PANDA_LOG_WARN <<
"missing packets: " << packets_missing <<
" in " << packets_expected;
83 template<
typename PacketDataType,
unsigned TimeSamplesPerPacket,
unsigned ChannelsPerPacket>
84 template<
typename ContextType>
88 unsigned offset = context.offset();
89 auto packet_it=packet.packet().begin() + context.packet_offset();
90 auto weights_it = packet.packet().begin_weights();
91 auto it=context.chunk().begin() + offset;
93 uint32_t number_of_time_samples = packet.packet().number_of_time_samples();
94 uint32_t number_of_channels = packet.packet().number_of_channels();
97 for(uint32_t channel=0;channel<number_of_channels;++channel)
99 for(uint32_t sample=0; sample<number_of_time_samples; ++sample)
101 Sample temp_sample0 = (*(packet_it+((channel*number_of_time_samples*2+sample))));
102 Sample temp_sample1 = (*(packet_it+((channel*number_of_time_samples*2+sample+number_of_time_samples))));
103 *(it+(channel*number_of_time_samples+sample)) = (temp_sample0.intensity()+temp_sample1.intensity())*(*(weights_it+channel));
108 template<
typename PacketDataType,
unsigned TimeSamplesPerPacket,
unsigned ChannelsPerPacket>
109 template<
typename ContextType>
113 unsigned offset = context.offset();
114 auto it=context.chunk().begin() + offset;
115 PANDA_LOG_DEBUG <<
"processing missing packet: data=" << (
void*)&*it << context;
116 for(std::size_t i=0; i < context.size() ; ++i) {
118 assert(it!=context.chunk().end());
123 template<
typename PacketDataType,
unsigned TimeSamplesPerPacket,
unsigned ChannelsPerPacket>
124 template<
typename ResizeContextType>
127 PANDA_LOG_DEBUG <<
"resizing data: " << context;
129 context.chunk().resize(data::DimensionSize<data::Time>(context.size()/context.chunk().number_of_channels()));
132 template<
typename PacketDataType,
unsigned TimeSamplesPerPacket,
unsigned ChannelsPerPacket>
136 return PacketInspector::Packet::max_sequence_number();
The incoming RF signal sample from the UDP stream.
Some limits and constants for FLDO.
std::size_t number_of_channels() const
std::size_t number_of_spectra() const