OLD | NEW |
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) 2011 The Boeing Company | 3 * Copyright (c) 2011 The Boeing Company |
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 |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 * GNU General Public License for more details. | 12 * GNU General Public License for more details. |
13 * | 13 * |
14 * You should have received a copy of the GNU General Public License | 14 * You should have received a copy of the GNU General Public License |
15 * along with this program; if not, write to the Free Software | 15 * along with this program; if not, write to the Free Software |
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
17 * | 17 * |
18 * Author: Gary Pei <guangyu.pei@boeing.com> | 18 * Author: Gary Pei <guangyu.pei@boeing.com> |
19 * Pjotr Kourzanov <peter.kourzanov@xs4all.nl> | 19 * Peter Kourzanov <peter.kourzanov@gmail.com> |
20 */ | 20 */ |
21 #include "lr-wpan-spectrum-value-helper.h" | 21 #include "lr-wpan-spectrum-value-helper.h" |
22 #include <ns3/log.h> | 22 #include <ns3/log.h> |
23 #include <ns3/spectrum-value.h> | 23 #include <ns3/spectrum-value.h> |
24 | 24 |
25 #include <cmath> | 25 #include <cmath> |
26 | 26 |
27 namespace ns3 { | 27 namespace ns3 { |
28 | 28 |
29 NS_LOG_COMPONENT_DEFINE ("LrWpanSpectrumValueHelper"); | 29 NS_LOG_COMPONENT_DEFINE ("LrWpanSpectrumValueHelper"); |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 (*newPsd)[6 + 5 * (channel - 11)] = (*oldPsd)[6 + 5 * (channel - 11)]; | 164 (*newPsd)[6 + 5 * (channel - 11)] = (*oldPsd)[6 + 5 * (channel - 11)]; |
165 (*newPsd)[7 + 5 * (channel - 11)] = (*oldPsd)[7 + 5 * (channel - 11)]; | 165 (*newPsd)[7 + 5 * (channel - 11)] = (*oldPsd)[7 + 5 * (channel - 11)]; |
166 | 166 |
167 // numerically integrate to get area under psd using | 167 // numerically integrate to get area under psd using |
168 // 1 MHz resolution from 2400 to 2483 MHz (center freq) | 168 // 1 MHz resolution from 2400 to 2483 MHz (center freq) |
169 centralAvgPower = (*newPsd)[5 + 5 * (channel - 11)]*2.0e6; | 169 centralAvgPower = (*newPsd)[5 + 5 * (channel - 11)]*2.0e6; |
170 return centralAvgPower; | 170 return centralAvgPower; |
171 } | 171 } |
172 | 172 |
173 } // namespace ns3 | 173 } // namespace ns3 |
OLD | NEW |