LEFT | RIGHT |
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * Copyright (c) 2015 Federico Guerra | 3 * Copyright (c) 2015 Federico Guerra |
4 * | 4 * |
5 * This program is free software; you can redistribute it and/or modify | 5 * This program is free software; you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 2 as | 6 * it under the terms of the GNU General Public License version 2 as |
7 * published by the Free Software Foundation; | 7 * published by the Free Software Foundation; |
8 * | 8 * |
9 * This program is distributed in the hope that it will be useful, | 9 * This program is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 { | 182 { |
183 totalAttCh += ::std::pow (::std::abs (it->GetAmp ()), 2.0); | 183 totalAttCh += ::std::pow (::std::abs (it->GetAmp ()), 2.0); |
184 | 184 |
185 NS_LOG_DEBUG ("summing tap:" << tapCnt << "; totalAttCh:" << t
otalAttCh); | 185 NS_LOG_DEBUG ("summing tap:" << tapCnt << "; totalAttCh:" << t
otalAttCh); |
186 } | 186 } |
187 } | 187 } |
188 | 188 |
189 if (delayFound == true) | 189 if (delayFound == true) |
190 { | 190 { |
191 totalAttCh = ::std::sqrt (totalAttCh); | 191 totalAttCh = ::std::sqrt (totalAttCh); |
192 totalAttChdB = -10.0 * ::std::log10 (totalAttCh); | 192 totalAttChdB = -20.0 * ::std::log10 (totalAttCh); |
193 | 193 |
194 rxPowerDb = txPowerDb - totalAttChdB; | 194 rxPowerDb = txPowerDb - totalAttChdB; |
195 | 195 |
196 NS_LOG_DEBUG ("totalAttCh:" << totalAttCh << "; totalAttChdB:" <<
totalAttChdB | 196 NS_LOG_DEBUG ("totalAttCh:" << totalAttCh << "; totalAttChdB:" <<
totalAttChdB |
197 << "dB; rxPowerDb:" << rxPowerDb << "d
B"); | 197 << "dB; rxPowerDb:" << rxPowerDb << "d
B"); |
198 | 198 |
199 } | 199 } |
200 | 200 |
201 // else rxPowerDb is -infinite and rx is not possible | 201 // else rxPowerDb is -infinite and rx is not possible |
202 | 202 |
(...skipping 26 matching lines...) Expand all Loading... |
229 } | 229 } |
230 } | 230 } |
231 } | 231 } |
232 | 232 |
233 | 233 |
234 } // namespace ns3 | 234 } // namespace ns3 |
235 | 235 |
236 #endif /* NS3_WOSS_SUPPORT */ | 236 #endif /* NS3_WOSS_SUPPORT */ |
237 | 237 |
238 | 238 |
LEFT | RIGHT |