diff --git a/src/uan/model/uan-prop-model.cc b/src/uan/model/uan-prop-model.cc --- a/src/uan/model/uan-prop-model.cc +++ b/src/uan/model/uan-prop-model.cc @@ -330,6 +330,25 @@ } UanPdp +UanPdp::NormalizeToSumNc (void) const +{ + double sumNc = 0.0; + std::vector newTaps; + + for (uint32_t i = 0; i < GetNTaps (); i++) + { + sumNc += std::abs (m_taps[i].GetAmp ()); + } + + for (uint32_t i = 0; i < GetNTaps (); i++) + { + newTaps.push_back ( Tap (m_taps[i].GetDelay (), (m_taps[i].GetAmp () / sumNc))); + } + + return UanPdp (newTaps, m_resolution); +} + +UanPdp UanPdp::CreateImpulsePdp (void) { UanPdp pdp; diff --git a/src/uan/model/uan-prop-model.h b/src/uan/model/uan-prop-model.h --- a/src/uan/model/uan-prop-model.h +++ b/src/uan/model/uan-prop-model.h @@ -233,7 +233,12 @@ * \return Coherent sum of arrivals after max in given window. */ std::complex SumTapsFromMaxC (Time delay, Time duration) const; - + /** + * Creates a new UanPdp normalized to its non coherent sum. + * \see SumTapsNc + * \returns the new PDP + */ + UanPdp NormalizeToSumNc (void) const; /** * Get a unit impulse PDP at time 0. *