114 std::vector<SatPhyRxCarrierPerFrame::crdsaPacketRxParams_s>& combinedPacketsForFrame)
116 NS_LOG_FUNCTION(
this);
119 NS_LOG_INFO(
"Number of slots: " << nbSlots);
121 std::map<uint32_t, std::list<SatPhyRxCarrierPerFrame::crdsaPacketRxParams_s>>::iterator iter;
124 NS_LOG_INFO(
"Iterating slot: " << iter->first);
126 std::list<SatPhyRxCarrierPerFrame::crdsaPacketRxParams_s>& slotContent = iter->second;
127 if (slotContent.size() < 1)
129 NS_FATAL_ERROR(
"No packet in slot! This should not happen");
132 std::list<SatPhyRxCarrierPerFrame::crdsaPacketRxParams_s>::iterator currentPacket;
133 for (currentPacket = slotContent.begin(); currentPacket != slotContent.end();
136 NS_LOG_INFO(
"Iterating packet in slot: " << currentPacket->ownSlotId);
139 uint32_t otherReplicasCount = currentPacket->slotIdsForOtherReplicas.size();
140 uint32_t replicasCount = 1 + otherReplicasCount;
141 uint32_t replicasCountSquared = replicasCount * replicasCount;
142 uint32_t packetsInSlotsCount = slotContent.size();
144 double replicasIfPower = currentPacket->rxParams->GetInterferencePower();
149 double replicasIfPowerInSatellite =
150 currentPacket->rxParams->GetInterferencePowerInSatellite();
151 double replicasNoisePowerInSatellite =
152 currentPacket->rxParams->GetRxNoisePowerInSatellite();
153 double replicasAciIfPowerInSatellite =
154 currentPacket->rxParams->GetRxAciIfPowerInSatellite();
155 double replicasExtNoisePowerInSatellite =
156 currentPacket->rxParams->GetRxExtNoisePowerInSatellite();
159 for (uint16_t& replicaSlotId : currentPacket->slotIdsForOtherReplicas)
161 NS_LOG_INFO(
"Processing replica in slot: " << replicaSlotId);
164 std::list<SatPhyRxCarrierPerFrame::crdsaPacketRxParams_s>>::iterator
169 NS_FATAL_ERROR(
"Slot " << replicaSlotId <<
" not found in frame!");
171 packetsInSlotsCount += replicaSlot->second.size();
175 replicasIfPower += replica.
rxParams->GetInterferencePower();
176 replicasIfPowerInSatellite += replica.
rxParams->GetInterferencePowerInSatellite();
177 replicasNoisePowerInSatellite += replica.
rxParams->GetRxNoisePowerInSatellite();
178 replicasAciIfPowerInSatellite += replica.
rxParams->GetRxAciIfPowerInSatellite();
179 replicasExtNoisePowerInSatellite +=
180 replica.
rxParams->GetRxExtNoisePowerInSatellite();
183 double sinr =
CalculateSinr(replicasCountSquared * currentPacket->rxParams->m_rxPower_W,
187 replicasExtNoisePower,
195 replicasCountSquared * currentPacket->rxParams->GetRxPowerInSatellite(),
196 replicasIfPowerInSatellite,
197 replicasNoisePowerInSatellite,
198 replicasAciIfPowerInSatellite,
199 replicasExtNoisePowerInSatellite,
200 currentPacket->rxParams->GetAdditionalInterference());
209 currentPacket->rxParams->m_packetsInBurst;
210 SatSignalParameters::PacketsInBurst_t::const_iterator i;
211 for (i = packets.begin(); i != packets.end(); i++)
214 (*i)->RemovePacketTag(satUplinkInfoTag);
216 (*i)->AddPacketTag(satUplinkInfoTag);
226 NS_LOG_INFO(
"MARSALA correlation computation, Replicas: "
227 << replicasCount <<
" Interferents: "
228 << (packetsInSlotsCount - replicasCount) <<
" Correlated SINR: " << cSinr);
232 uint32_t correlations = 1;
233 for (uint32_t i = nbSlots - otherReplicasCount; i < nbSlots; ++i)
238 currentPacket->sourceAddress,
239 currentPacket->phyError);
241 NS_LOG_INFO(
"Packet error: " << currentPacket->phyError);
243 if (!currentPacket->phyError)
247 NS_LOG_INFO(
"Packet successfully received, removing its interference and "
248 "processing the replicas");
250 slotContent.erase(currentPacket);
253 combinedPacketsForFrame.push_back(processedPacket);