164 * - \f$ G_t \f$ : transmission gain (unit-less) |
164 * - \f$ G_t \f$ : transmission gain (unit-less) |
165 * - \f$ G_r \f$ : reception gain (unit-less) |
165 * - \f$ G_r \f$ : reception gain (unit-less) |
166 * - \f$ \lambda \f$ : wavelength (m) |
166 * - \f$ \lambda \f$ : wavelength (m) |
167 * - \f$ d \f$ : distance (m) |
167 * - \f$ d \f$ : distance (m) |
168 * - \f$ L \f$ : system loss (unit-less) |
168 * - \f$ L \f$ : system loss (unit-less) |
169 * |
|
170 * |
|
171 * This model is invalid for small distance values. |
|
172 * The current implementation returns the txpower as the rxpower |
|
173 * for any distance smaller than MinDistance. |
|
174 * |
169 * |
175 * In the implementation, \f$ \lambda \f$ is calculated as |
170 * In the implementation, \f$ \lambda \f$ is calculated as |
176 * \f$ \frac{C}{f} \f$, where \f$ C = 299792458\f$ m/s is the speed of light in |
171 * \f$ \frac{C}{f} \f$, where \f$ C = 299792458\f$ m/s is the speed of light in |
177 * vacuum, and \f$ f \f$ is the frequency in Hz which can be configured by |
172 * vacuum, and \f$ f \f$ is the frequency in Hz which can be configured by |
178 * the user via the Frequency attribute. |
173 * the user via the Frequency attribute. |
|
174 * |
|
175 * The Friis model is valid only for propagation in free space within |
|
176 * the so-called far field region, which can be considered |
|
177 * approximately as the region for \f$ d > 3 \lambda \f$. |
|
178 * The model will still return a value for \f$ d < 3 \lambda \f$, as |
|
179 * doing so (rather than triggering a fatal error) is practical for |
|
180 * many simulation scenarios. However, we stress that the values |
|
181 * obtained in such conditions shall not be considered realistic. |
|
182 * |
|
183 * Related with this issue, we note that the Friis formula is |
|
184 * undefined for \f$ d = 0 \f$, and results in |
|
185 * \f$ P_r > P_t \f$ for \f$ d < \lambda / 2 \sqrt{\pi} \f$. |
|
186 * Both these conditions occur outside of the far field region, so in |
|
187 * principle the Friis model shall not be used in these conditions. |
|
188 * In practice, however, Friis is often used in scenarios where accurate |
|
189 * propagation modeling is not deemed important, and values of \f$ d = |
|
190 * 0 \f$ can occur. To allow practical use of the model in such |
|
191 * scenarios, we have to 1) return some value for \f$ d = 0 \f$, and |
|
192 * 2) avoid large discontinuities in propagation loss values (which |
|
193 * could lead to artifacts such as bogus capture effects which are |
|
194 * much worse than inaccurate propagation loss values). The two issues |
|
195 * are conflicting, as, according to the Friis formula, |
|
196 * \f$\lim_{d \to 0 } P_r = +\infty \f$; |
|
197 * so if, for \f$ d = 0 \f$, we use a fixed loss value, we end up with an infinitely large |
|
198 * discontinuity, which as we discussed can cause undesireable |
|
199 * simulation artifacts. |
|
200 * |
|
201 * To avoid these artifact, this implmentation of the Friis model |
|
202 * provides an attribute called MinLoss which allows to specify the |
|
203 * minimum total loss (in dB) returned by the model. This is used in |
|
204 * such a way that |
|
205 * \f$ P_r \f$ continuously increases for \f$ d \to 0 \f$, until |
|
206 * MinLoss is reached, and then stay constant; this allow to |
|
207 * return a value for \f$ d = 0 \f$ and at the same time avoid |
|
208 * discontinuities. The model won't be much realistic, but at least |
|
209 * the simulation artifacts discussed before are avoided. The default value of |
|
210 * MinLoss is 0 dB, which means that by default the model will return |
|
211 * \f$ P_r = P_t \f$ for \f$ d <= \lambda / 2 \sqrt{\pi} \f$. We note |
|
212 * that this value of \f$ d \f$ is outside of the far field |
|
213 * region, hence the validity of the model in the far field region is |
|
214 * not affected. |
|
215 * |
179 */ |
216 */ |
180 class FriisPropagationLossModel : public PropagationLossModel |
217 class FriisPropagationLossModel : public PropagationLossModel |
181 { |
218 { |
182 public: |
219 public: |
183 static TypeId GetTypeId (void); |
220 static TypeId GetTypeId (void); |
195 * Set the system loss used by the Friis propagation model. |
232 * Set the system loss used by the Friis propagation model. |
196 */ |
233 */ |
197 void SetSystemLoss (double systemLoss); |
234 void SetSystemLoss (double systemLoss); |
198 |
235 |
199 /** |
236 /** |
200 * \param minDistance the minimum distance |
237 * \param minLoss the minimum loss (dB) |
201 * |
238 * |
202 * Below this distance, the txpower is returned |
239 * no matter how short the distance, the total propagation loss (in |
203 * unmodified as the rxpower. |
240 * dB) will always be greater or equal than this value |
204 */ |
241 */ |
205 void SetMinDistance (double minDistance); |
242 void SetMinLoss (double minLoss); |
206 |
243 |
207 /** |
244 /** |
208 * \returns the minimum distance. |
245 * \return the minimum loss. |
209 */ |
246 */ |
210 double GetMinDistance (void) const; |
247 double GetMinLoss (void) const; |
211 |
248 |
212 /** |
249 /** |
213 * \returns the current frequency (Hz) |
250 * \returns the current frequency (Hz) |
214 */ |
251 */ |
215 double GetFrequency (void) const; |
252 double GetFrequency (void) const; |