diff --git a/.gitignore b/.gitignore
index d4ffa3c..0d01ff9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -17,6 +17,8 @@ Thumbs.db
**/bin
**/Debug/
**/Release/
+**/dotnet/packages
+**/dotnet/nuget
*.tlog
*.obj
*.log
diff --git a/.zenodo.json b/.zenodo.json
index da941ca..bcbd657 100644
--- a/.zenodo.json
+++ b/.zenodo.json
@@ -7,11 +7,11 @@
}
],
- "title": "Recommendation ITU-R P.2108-0, Release 0.0",
+ "title": "Recommendation ITU-R P.2108-1, Release 1.0",
"upload_type": "software",
- "version": "0.0.0",
+ "version": "1.0.0",
- "keywords": ["Study Group 3", "ITU-R", "P2108"]
+ "keywords": ["Study Group 3", "ITU-R", "P2108", "clutter", "propagation"]
}
\ No newline at end of file
diff --git a/AeronauticalStatisticalModelTestData.csv b/AeronauticalStatisticalModelTestData.csv
new file mode 100644
index 0000000..cdcad8f
--- /dev/null
+++ b/AeronauticalStatisticalModelTestData.csv
@@ -0,0 +1,14 @@
+f__ghz,theta_deg,p,rtn,L_ces__db
+30,2,5,0,7.7
+30,2,1,0,1.9
+30,2,99,0,87.3
+10,10.5,45,0,12.4
+15,90,50,0,0
+20,0,50,0,45.6
+11.1,15.5,80.5,0,14.7
+9.9,45,45,3300,0
+100.1,45,45,3300,0
+18,-0.1,50,3301,0
+18,90.1,50,3301,0
+22,25,0,3302,0
+22,25,100,3302,0
diff --git a/CITATION.cff b/CITATION.cff
index 75d49ea..1c1824d 100644
--- a/CITATION.cff
+++ b/CITATION.cff
@@ -1,5 +1,5 @@
cff-version: 1.2.0
-title: 'Recommendation ITU-R P.2108-0'
+title: 'Recommendation ITU-R P.2108-1'
message: >-
If you use this software, please cite it using the
metadata from this file.
diff --git a/HeightGainTerminalCorrectionModelTestData.csv b/HeightGainTerminalCorrectionModelTestData.csv
new file mode 100644
index 0000000..c26e648
--- /dev/null
+++ b/HeightGainTerminalCorrectionModelTestData.csv
@@ -0,0 +1,24 @@
+f__ghz,h__meter,w_s__meter,R__meter,clutter_type,rtn,A_h__db
+1.5,2,27,10,1,0,16
+1.5,2,27,6,1,0,10.9
+1.5,2,27,10,2,0,16
+1.5,2,27,6,2,0,10.9
+1.5,2,27,10,3,0,20.5
+1.5,2,27,6,3,0,14.6
+1.5,2,27,15,4,0,24.5
+1.5,2,27,6,4,0,14.6
+1.5,2,27,15,5,0,24.5
+1.5,2,27,6,5,0,14.6
+1.5,2,27,20,6,0,27.1
+1.5,2,27,6,6,0,14.6
+3,3,15,15,6,0,29
+0.9,2.3,30,10,2,0,13.7
+1.5,2.5,25,10,3,0,20.2
+0.03,2.1,24.5,9.8,3,0,5.7
+1.7,30,24.5,9.8,3,0,0
+1.7,30,24.5,30,3,0,0
+0.02,2,27,10,3,3100,0
+4,2,27,10,3,3100,0
+1,0,10,9,2,3101,0
+2,1,0,9,6,3102,0
+2,1,27,0,6,3103,0
\ No newline at end of file
diff --git a/LICENSE.md b/LICENSE.md
index 12746a1..add8ca7 100644
--- a/LICENSE.md
+++ b/LICENSE.md
@@ -1,14 +1,34 @@
-SOFTWARE DISCLAIMER / RELEASE
+# SOFTWARE DISCLAIMER / RELEASE
-This software was developed by employees of the National Telecommunications and Information Administration (NTIA), an agency of the Federal Government and is provided to you as a public service. Pursuant to Title 15 United States Code Section 105, works of NTIA employees are not subject to copyright protection within the United States.
+This software was developed by employees of the National Telecommunications and Information
+Administration (NTIA), an agency of the Federal Government and is provided to you
+as a public service. Pursuant to Title 15 United States Code Section 105, works
+of NTIA employees are not subject to copyright protection within the United States.
-The software is provided by NTIA “AS IS.” NTIA MAKES NO WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR STATUTORY, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT AND DATA ACCURACY. NTIA does not warrant or make any representations regarding the use of the software or the results thereof, including but not limited to the correctness, accuracy, reliability or usefulness of the software.
+The software is provided by NTIA “AS IS.” NTIA MAKES NO WARRANTY OF ANY KIND, EXPRESS,
+IMPLIED OR STATUTORY, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTY OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT AND DATA ACCURACY. NTIA does
+not warrant or make any representations regarding the use of the software or the
+results thereof, including but not limited to the correctness, accuracy, reliability
+or usefulness of the software.
-To the extent that NTIA holds rights in countries other than the United States, you are hereby granted the non-exclusive irrevocable and unconditional right to print, publish, prepare derivative works and distribute the NTIA software, in any medium, or authorize others to do so on your behalf, on a royalty-free basis throughout the World.
+To the extent that NTIA holds rights in countries other than the United States,
+you are hereby granted the non-exclusive irrevocable and unconditional right to
+print, publish, prepare derivative works and distribute the NTIA software, in any
+medium, or authorize others to do so on your behalf, on a royalty-free basis throughout
+the World.
-You may improve, modify, and create derivative works of the software or any portion of the software, and you may copy and distribute such modifications or works. Modified works should carry a notice stating that you changed the software and should note the date and nature of any such change.
+You may improve, modify, and create derivative works of the software or any portion
+of the software, and you may copy and distribute such modifications or works. Modified
+works should carry a notice stating that you changed the software and should note
+the date and nature of any such change.
-You are solely responsible for determining the appropriateness of using and distributing the software and you assume all risks associated with its use, including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and the unavailability or interruption of operation. This software is not intended to be used in any situation where a failure could cause risk of injury or damage to property.
-
-Please provide appropriate acknowledgments of NTIA’s creation of the software in any copies or derivative works of this software.
+You are solely responsible for determining the appropriateness of using and distributing
+the software and you assume all risks associated with its use, including but not
+limited to the risks and costs of program errors, compliance with applicable laws,
+damage to or loss of data, programs or equipment, and the unavailability or interruption
+of operation. This software is not intended to be used in any situation where a failure
+could cause risk of injury or damage to property.
+Please provide appropriate acknowledgments of NTIA’s creation of the software in
+any copies or derivative works of this software.
diff --git a/README.md b/README.md
index 1db352b..34eb571 100644
--- a/README.md
+++ b/README.md
@@ -1,24 +1,33 @@
-# Recommendation ITU-R P.2108-0 - U.S. Reference Implementation #
+# Recommendation ITU-R P.2108-1 - U.S. Reference Implementation #
Persistent Identifier: [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.7114033.svg)](https://doi.org/10.5281/zenodo.7114033)
-This code repository contains the U.S. Reference Software Implementation of Recommendation ITU-R P.2108. This Recommendation contains three methods for the prediction of clutter loss: [Height Gain Terminal Correction Model](README.md#height-gain-terminal-correction-model), [Terrestrial Statistical Model](README.md#terrestrial-statistical-model), [Aeronautical Statistical Model](README.md#aeronautical-statistical-model). The software implements Section 3 of Annex 1 of the Recommendation.
+This code repository contains the U.S. Reference Software Implementation of
+Recommendation ITU-R P.2108. This Recommendation contains three methods for the
+prediction of clutter loss: [Height Gain Terminal Correction Model](README.md#height-gain-terminal-correction-model),
+[Terrestrial Statistical Model](README.md#terrestrial-statistical-model),
+[Aeronautical Statistical Model](README.md#aeronautical-statistical-model).
+The software implements Section 3 of Annex 1 of the Recommendation.
## Height Gain Terminal Correction Model ##
-The height gain terminal correction model is described in Section 3.1. This end-point clutter method gives the median loss due to different terminal surroundings for terrestrial paths for frequencies between 0.3 to 3 GHz. This model can be applied to both transmitting and receiving ends of the path.
+The height gain terminal correction model is described in Section 3.1.
+This end-point clutter method gives the median loss due to different terminal
+surroundings for terrestrial paths for frequencies between 0.3 to 3 GHz. This
+model can be applied to both transmitting and receiving ends of the path.
-### Inputs ###
+### Inputs (Height Gain Terminal Correction Model) ###
-| Variable | Type | Units | Limits | Description |
-|-------------------|--------|-------|--------------|--------------|
-| `f__ghz` | double | GHz | 0.3 <= `f__ghz` <= 3 | Frequency |
-| `h__meter` | double | meter | 0 <= `h__meter` | Antenna height |
-| `w_s__meter` | double | meter | 0 < `w_s__meter` | Street width |
-| `R__meter` | double | meter | 0 < `R__meter` | Representative clutter height |
-| `clutter_type` | int | | | Clutter type
1 = Water/sea 2 = Open/rural 3 = Suburban 4 = Urban 5 = Trees/forest 6 = Dense urban |
+| Variable | Type | Units | Limits | Description |
+|----------------|--------|-------|----------------------|-------------------------------|
+| `f__ghz` | double | GHz | 0.3 <= `f__ghz` <= 3 | Frequency |
+| `h__meter` | double | meter | 0 <= `h__meter` | Antenna height |
+| `w_s__meter` | double | meter | 0 < `w_s__meter` | Street width |
+| `R__meter` | double | meter | 0 < `R__meter` | Representative clutter height |
+| `clutter_type` | int | | | Clutter type 1 = Water/sea 2 = Open/rural 3 = Suburban 4 = Urban 5 = Trees/forest 6 = Dense urban |
-Where site-specific values for the representative clutter height are not available, the following default values are recommended.
+Where site-specific values for the representative clutter height are not available,
+the following default values are recommended.
| Clutter Type | `R__meter` |
|--------------|:----------:|
@@ -28,109 +37,129 @@ Where site-specific values for the representative clutter height are not availab
| Urban | 15 |
| Trees/forest | 15 |
| Dense urban | 20 |
-
-### Outputs ###
+
+### Outputs (Height Gain Terminal Correction Model) ###
| Variable | Type | Units | Description |
|------------|--------|-------|-------------|
| `A_h__db` | double | dB | Additional loss (clutter loss) |
-### Return Codes ###
+### Return Codes (Height Gain Terminal Correction Model) ###
-Possible return codes, including the corresponding defined constant name as defined in `Errors.h`:
+Possible return codes, including the corresponding defined constant name as
+defined in [`Errors.h`](include/Errors.h):
-| Value | Const Name | Description |
-| ------|----------------------------|--------------|
-| 0 | `SUCCESS` | Successful execution |
-| 3100 | `ERROR31__FREQUENCY` | Frequency must be between 0.3 and 3 GHz, inclusive |
-| 3101 | `ERROR31__ANTENNA_HEIGHT` | Antenna height must be >= 0 meters |
-| 3102 | `ERROR31__STREET_WIDTH` | Street width must be > 0 meters |
-| 3103 | `ERROR31__CLUTTER_HEIGHT` | Representative clutter height must be > 0 meters |
-| 3104 | `ERROR31__CLUTTER_TYPE` | Invalid value for clutter type |
+| Value | Const Name | Description |
+|-------|---------------------------|----------------------------------------------------|
+| 0 | `SUCCESS` | Successful execution |
+| 3100 | `ERROR31__FREQUENCY` | Frequency must be between 0.3 and 3 GHz, inclusive |
+| 3101 | `ERROR31__ANTENNA_HEIGHT` | Antenna height must be >= 0 meters |
+| 3102 | `ERROR31__STREET_WIDTH` | Street width must be > 0 meters |
+| 3103 | `ERROR31__CLUTTER_HEIGHT` | Representative clutter height must be > 0 meters |
+| 3104 | `ERROR31__CLUTTER_TYPE` | Invalid value for clutter type |
## Terrestrial Statistical Model ##
-The statistical clutter loss model for terrestrial paths as described in Section 3.2. This model is valid for urban and suburban clutter environments. For paths between 0.25 and 1 km, this model can only be applied to one end of the path. For paths greater than 1 km, the model can be applied to both terminals, if desired.
+The statistical clutter loss model for terrestrial paths as described in Section
+3.2. This model is valid for urban and suburban clutter environments. For paths
+between 0.25 and 1 km, this model can only be applied to one end of the path.
+For paths greater than 1 km, the model can be applied to both terminals, if desired.
+
+### Inputs (Terrestrial Statistical Model) ###
-### Inputs ###
+| Variable | Type | Units | Limits | Description |
+|----------|--------|-------|---------------------|---------------|
+| `f__ghz` | double | GHz | 2 <= `f__ghz` <= 67 | Frequency |
+| `d__km` | double | km | 0.25 <= `d__km` | Path distance |
+| `p` | double | % | 0 < `p` < 100 | Percentage of locations clutter loss not exceeded |
-| Variable | Type | Units | Limits | Description |
-|-------------------|--------|-------|--------------|--------------|
-| `f__ghz` | double | GHz | 2 <= `f__ghz` <= 67 | Frequency |
-| `d__km` | double | km | 0.25 <= `d__km` | Path distance |
-| `p` | double | % | 0 < `p` < 100 | Percentage of locations clutter loss not exceeded |
-
-### Outputs ###
+### Outputs (Terrestrial Statistical Model) ###
| Variable | Type | Units | Description |
|------------|--------|-------|-------------|
| `L_ctt__db` | double | dB | Clutter loss |
-### Return Codes ###
+### Return Codes (Terrestrial Statistical Model) ###
-Possible return codes, including the corresponding defined constant name as defined in `Errors.h`:
+Possible return codes, including the corresponding defined constant name as
+defined in [`Errors.h`](include/Errors.h):
-| Value | Const Name | Description |
-| ------|----------------------------|--------------|
-| 0 | `SUCCESS` | Successful execution |
-| 3200 | `ERROR32__FREQUENCY` | Frequency must be between 2 and 67 GHz, inclusive |
-| 3201 | `ERROR32__DISTANCE` | Path distance must be >= 0.25 km |
-| 3202 | `ERROR32__PERCENTAGE` | Percentage must be between 0 and 100 |
+| Value | Const Name | Description |
+|-------|-----------------------|---------------------------------------------------|
+| 0 | `SUCCESS` | Successful execution |
+| 3200 | `ERROR32__FREQUENCY` | Frequency must be between 2 and 67 GHz, inclusive |
+| 3201 | `ERROR32__DISTANCE` | Path distance must be >= 0.25 km |
+| 3202 | `ERROR32__PERCENTAGE` | Percentage must be between 0 and 100 |
## Aeronautical Statistical Model ##
-The Earth-space and aeronautical statistical clutter loss model as described in Section 3.3. This model is applicable when one end of the path is within man-made clutter and the other end is a satellite, aeroplane, or other platform above the Earth. This model is valid for urban and suburban clutter environments.
+The Earth-space and aeronautical statistical clutter loss model as described in
+Section 3.3. This model is applicable when one end of the path is within man-made
+clutter and the other end is a satellite, aeroplane, or other platform above the
+Earth. This model is valid for urban and suburban clutter environments.
+
+### Inputs (Aeronautical Statistical Model) ###
-### Inputs ###
+| Variable | Type | Units | Limits | Description |
+|--------------|--------|-------|-------------------------|-----------------|
+| `f__ghz` | double | GHz | 10 <= `f__ghz` <= 100 | Frequency |
+| `theta__deg` | double | deg | 0 <= `theta__deg` <= 90 | Elevation angle |
+| `p` | double | % | 0 < `p` < 100 | Percentage of locations clutter loss not exceeded |
-| Variable | Type | Units | Limits | Description |
-|-------------------|--------|-------|--------------|--------------|
-| `f__ghz` | double | GHz | 10 <= `f__ghz` <= 100 | Frequency |
-| `theta__deg` | double | deg | 0 <= `theta__deg` <= 90 | Elevation angle |
-| `p` | double | % | 0 < `p` < 100 | Percentage of locations clutter loss not exceeded |
-
-### Outputs ###
+### Outputs (Aeronautical Statistical Model) ###
| Variable | Type | Units | Description |
|------------|--------|-------|-------------|
| `L_ces__db` | double | dB | Clutter loss |
-### Return Codes ###
+### Return Codes (Aeronautical Statistical Model) ###
-Possible return codes, including the corresponding defined constant name as defined in `Errors.h`:
+Possible return codes, including the corresponding defined constant name as defined
+in [`Errors.h`](include/Errors.h):
-| Value | Const Name | Description |
-| ------|----------------------------|--------------|
-| 0 | `SUCCESS` | Successful execution |
-| 3300 | `ERROR33__FREQUENCY` | Frequency must be between 10 and 100 GHz, inclusive |
-| 3301 | `ERROR33__THETA` | Elevation angle must be between 0 and 100 GHz, inclusive |
-| 3302 | `ERROR33__PERCENTAGE` | Percentage must be between 0 and 100, inclusive |
+| Value | Const Name | Description |
+|-------|-----------------------|----------------------------------------------------------|
+| 0 | `SUCCESS` | Successful execution |
+| 3300 | `ERROR33__FREQUENCY` | Frequency must be between 10 and 100 GHz, inclusive |
+| 3301 | `ERROR33__THETA` | Elevation angle must be between 0 and 100 GHz, inclusive |
+| 3302 | `ERROR33__PERCENTAGE` | Percentage must be between 0 and 100, inclusive |
## Example Values ##
-The [Study Group Clutter Excel Workbook](https://www.itu.int/en/ITU-R/study-groups/rsg3/ionotropospheric/Clutter%20and%20BEL%20workbook.xlsx) contains an extensive set of validation example values.
+The [Study Group Clutter Excel Workbook](https://www.itu.int/en/ITU-R/study-groups/rsg3/ionotropospheric/Clutter%20and%20BEL%20workbook_V2.xlsx)
+contains an extensive set of validation example values.
## Notes on Code Style ##
- * In general, variables follow the naming convention in which a single underscore denotes a subscript (pseudo-LaTeX format), where a double underscore is followed by the units, i.e. h_1__meter.
- * Variables are named to match their corresponding mathematical variables in the underlying Recommendation text.
- * Wherever possible, equation numbers are provided. It is assumed that a user reviewing this source code would have a copy of the Recommendation's text available as a primary reference.
+* In general, variables follow the naming convention in which a single underscore
+denotes a subscript (pseudo-LaTeX format), where a double underscore is followed
+by the units, i.e. `h_1__meter`.
+* Variables are named to match their corresponding mathematical variables in the
+underlying Recommendation text.
+* Wherever possible, equation numbers are provided. It is assumed that a user
+reviewing this source code would have a copy of the Recommendation's text available
+as a primary reference.
## Configure and Build ##
-### C++ Software
+### C++ Software ###
-The software is designed to be built into a DLL (or corresponding library for non-Windows systems). The source code can be built for any OS that supports the standard C++ libraries. A Visual Studio 2019 project file is provided for Windows users to support the build process and configuration.
+The software is designed to be built into a DLL (or corresponding library for
+non-Windows systems). The source code can be built for any OS that supports the
+standard C++ libraries. A Visual Studio 2019 project file is provided for Windows
+users to support the build process and configuration.
-### C#/.NET Wrapper Software
+### C#/.NET Wrapper Software ###
-The .NET support of P.2108 consists of a simple pass-through wrapper around the native DLL. It is compiled to target .NET Framework 4.7.2. Distribution and updates are provided through the published [NuGet package](https://github.com/NTIA/p2108/packages).
+The .NET support of P.2108 consists of a simple pass-through wrapper around the
+native DLL. It is compiled to target .NET Framework 4.8.1. Distribution and updates
+are provided through the published [NuGet package](https://github.com/NTIA/p2108/packages).
## References ##
- * [Recommendation ITU-R P.2108](https://www.itu.int/rec/R-REC-P.2108/en)
- * [Report ITU-R P.2402](https://www.itu.int/pub/R-REP-P.2402)
+* [Recommendation ITU-R P.2108](https://www.itu.int/rec/R-REC-P.2108/en)
+* [Report ITU-R P.2402](https://www.itu.int/pub/R-REP-P.2402)
## Contact ##
-For questions, contact Billy Kozma, wkozma@ntia.gov
+For questions, contact Billy Kozma,
diff --git a/TerrestrialStatisticalModelTestData.csv b/TerrestrialStatisticalModelTestData.csv
new file mode 100644
index 0000000..589034c
--- /dev/null
+++ b/TerrestrialStatisticalModelTestData.csv
@@ -0,0 +1,13 @@
+f__ghz,d__km,p,rtn,L_ctt__db
+0.5,0.25,50,0,17.4
+0.5,0.25,1,0,3.9
+0.5,0.25,99,0,30.9
+26.6,15.8,45,0,32.5
+67,5.4,30.5,0,30.9
+3.5,1,0.1,0,16.8
+3.5,1,99.9,0,42.8
+0.24,2,50,3200,0
+67.1,5,50,3200,0
+10,0.24,50,3201,0
+6,3,0,3202,0
+6,3,100,3202,0
diff --git a/dotnet/ITS.Propagation.P2108/ITS.Propagation.P2108.csproj b/dotnet/ITS.ITU.PSeries.P2108/ITS.ITU.PSeries.P2108.csproj
similarity index 88%
rename from dotnet/ITS.Propagation.P2108/ITS.Propagation.P2108.csproj
rename to dotnet/ITS.ITU.PSeries.P2108/ITS.ITU.PSeries.P2108.csproj
index 3d0618b..517e36a 100644
--- a/dotnet/ITS.Propagation.P2108/ITS.Propagation.P2108.csproj
+++ b/dotnet/ITS.ITU.PSeries.P2108/ITS.ITU.PSeries.P2108.csproj
@@ -7,11 +7,12 @@
{6AA0C335-F019-4818-97B6-7B32BBE190E4}
Library
Properties
- ITS.Propagation
- ITS.Propagation.P2108
- v4.7.2
+ ITS.ITU.PSeries
+ ITS.ITU.PSeries.P2108
+ v4.8.1
512
true
+
true
@@ -29,7 +30,7 @@
TRACE
prompt
4
- bin\Release\ITS.Propagation.P2108.xml
+ bin\Release\ITS.ITU.PSeries.P2108.xml
diff --git a/dotnet/ITS.Propagation.P2108/P2108.cs b/dotnet/ITS.ITU.PSeries.P2108/P2108.cs
similarity index 90%
rename from dotnet/ITS.Propagation.P2108/P2108.cs
rename to dotnet/ITS.ITU.PSeries.P2108/P2108.cs
index f35b082..e560cc1 100644
--- a/dotnet/ITS.Propagation.P2108/P2108.cs
+++ b/dotnet/ITS.ITU.PSeries.P2108/P2108.cs
@@ -1,10 +1,10 @@
using System;
using System.Runtime.InteropServices;
-namespace ITS.Propagation
+namespace ITS.ITU.PSeries
{
///
- /// Recommendation ITU-R P.2108-0
+ /// Recommendation ITU-R P.2108-1
///
public static class P2108
{
@@ -77,9 +77,9 @@ public enum ClutterType : int
private delegate int HeightGainTerminalCorrectionModelDelegate(double f__ghz, double h__meter, double w_s__meter, double R__meter, int clutter_type, out double A_h__db);
private delegate int TerrestrialStatisticalModelDelegate(double f__ghz, double d__km, double p, out double L_ctt__db);
- private static AeronauticalStatisticalModelDelegate AeronauticalStatisticalModel_Invoke;
- private static HeightGainTerminalCorrectionModelDelegate HeightGainTerminalCorrectionModel_Invoke;
- private static TerrestrialStatisticalModelDelegate TerrestrialStatisticalModel_Invoke;
+ private static readonly AeronauticalStatisticalModelDelegate AeronauticalStatisticalModel_Invoke;
+ private static readonly HeightGainTerminalCorrectionModelDelegate HeightGainTerminalCorrectionModel_Invoke;
+ private static readonly TerrestrialStatisticalModelDelegate TerrestrialStatisticalModel_Invoke;
static P2108()
{
@@ -104,7 +104,7 @@ static P2108()
///
/// Frequency, in GHz
/// Elevation angle, in degrees
- /// Percentange of locations, in %
+ /// Percentage of locations, in %
/// Additional loss (clutter loss), in dB
/// Error code
public static int AeronauticalStatisticalModel(double f__ghz, double theta__deg, double p, out double L_ces__db)
@@ -120,15 +120,15 @@ public static int AeronauticalStatisticalModel(double f__ghz, double theta__deg,
/// Clutter type
/// Additional loss (clutter loss), in dB
/// Error code
- public static int HeightGainTerminalCorrectionModel(double f__ghz, double h__meter, double w_s__meter, double R__meter, int clutter_type, out double A_h__db)
- => HeightGainTerminalCorrectionModel_Invoke(f__ghz, h__meter, w_s__meter, R__meter, clutter_type, out A_h__db);
+ public static int HeightGainTerminalCorrectionModel(double f__ghz, double h__meter, double w_s__meter, double R__meter, ClutterType clutter_type, out double A_h__db)
+ => HeightGainTerminalCorrectionModel_Invoke(f__ghz, h__meter, w_s__meter, R__meter, (int)clutter_type, out A_h__db);
///
/// Statistical clutter loss model for terrestrial paths as described in Section 3.2.
///
/// Frequency, in GHz
/// Path distance, in km
- /// Percentange of locations, in %
+ /// Percentage of locations, in %
/// Additional loss (clutter loss), in dB
/// Error code
public static int TerrestrialStatisticalModel(double f__ghz, double d__km, double p, out double L_ctt__db)
diff --git a/dotnet/ITS.Propagation.P2108/Properties/AssemblyInfo.cs b/dotnet/ITS.ITU.PSeries.P2108/Properties/AssemblyInfo.cs
similarity index 79%
rename from dotnet/ITS.Propagation.P2108/Properties/AssemblyInfo.cs
rename to dotnet/ITS.ITU.PSeries.P2108/Properties/AssemblyInfo.cs
index daad97f..60f50ac 100644
--- a/dotnet/ITS.Propagation.P2108/Properties/AssemblyInfo.cs
+++ b/dotnet/ITS.ITU.PSeries.P2108/Properties/AssemblyInfo.cs
@@ -1,15 +1,14 @@
using System.Reflection;
-using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
-[assembly: AssemblyTitle("Recommendation ITU-R P.2108-0")]
-[assembly: AssemblyDescription("Recommendation ITU-R P.2108-0")]
+[assembly: AssemblyTitle("Recommendation ITU-R P.2108-1")]
+[assembly: AssemblyDescription("Recommendation ITU-R P.2108-1")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("The Institute for Telecommunication Sciences")]
-[assembly: AssemblyProduct("Recommendation ITU-R P.2108-0")]
+[assembly: AssemblyProduct("Recommendation ITU-R P.2108-1")]
[assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
@@ -32,5 +31,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("0.0.0.0")]
-[assembly: AssemblyFileVersion("0.0.0.0")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/dotnet/UnitTests/BVT.cs b/dotnet/UnitTests/BVT.cs
new file mode 100644
index 0000000..042a4af
--- /dev/null
+++ b/dotnet/UnitTests/BVT.cs
@@ -0,0 +1,69 @@
+using ITS.ITU.PSeries;
+using Xunit;
+
+namespace UnitTests
+{
+ public class BVT
+ {
+ const double EPSILON = 0.1;
+
+ ///
+ /// Tests for Sec 3.1 Height Gain Terminal Correction clutter model
+ ///
+ /// Frequency, in GHz
+ /// Antenna height, in meters
+ /// Street width, in meters
+ /// Representative clutter height, in meters
+ /// Clutter type
+ /// Return code
+ /// Additional loss (clutter loss), in dB
+ [Theory]
+ [MemberData(nameof(TestData.HeightGainTerminalCorrectionModelTestData), MemberType = typeof(TestData))]
+ public void HeightGainTerminalCorrectionModelTest(double f__ghz,
+ double h__meter, double w_s__meter, double R__meter,
+ P2108.ClutterType clutter_type, int rtn, double A_h__db)
+ {
+ var r = P2108.HeightGainTerminalCorrectionModel(f__ghz, h__meter, w_s__meter, R__meter, clutter_type, out double A__db);
+
+ Assert.Equal(rtn, r);
+ Assert.Equal(A_h__db, A__db, EPSILON);
+ }
+
+ ///
+ /// Tests for Sec 3.2 Terrestrial Statistical clutter model
+ /// Frequency, in GHz
+ /// Path distance, in km
+ /// Percentage of locations, in %
+ /// Return code
+ /// Additional loss (clutter loss), in dB
+ [Theory]
+ [MemberData(nameof(TestData.TerrestrialStatisticalModelTestData), MemberType = typeof(TestData))]
+ public void TerrestrialStatisticalModelTest(double f__ghz,
+ double d__km, double p, int rtn, double L_ctt__db)
+ {
+ var r = P2108.TerrestrialStatisticalModel(f__ghz, d__km, p, out double L__db);
+
+ Assert.Equal(rtn, r);
+ Assert.Equal(L_ctt__db, L__db, EPSILON);
+ }
+
+ ///
+ /// Tests for Sec 3.3 Aeronautical Statistical clutter model
+ ///
+ /// Frequency, in GHz
+ /// Elevation angle, in degrees
+ /// Percentage of locations, in %
+ /// Return code
+ /// Additional loss (clutter loss), in dB
+ [Theory]
+ [MemberData(nameof(TestData.AeronauticalStatisticalModelTestData), MemberType = typeof(TestData))]
+ public void AeronauticalStatisticalModelTest(double f__ghz,
+ double theta__deg, double p, int rtn, double L_ces__db)
+ {
+ var r = P2108.AeronauticalStatisticalModel(f__ghz, theta__deg, p, out double L__db);
+
+ Assert.Equal(rtn, r);
+ Assert.Equal(L_ces__db, L__db, EPSILON);
+ }
+ }
+}
diff --git a/dotnet/UnitTests/Properties/AssemblyInfo.cs b/dotnet/UnitTests/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..eb90b8c
--- /dev/null
+++ b/dotnet/UnitTests/Properties/AssemblyInfo.cs
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("UnitTests")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("UnitTests")]
+[assembly: AssemblyCopyright("Copyright © 2023")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("1fb5483e-2eed-4e27-a1d4-16646507ec9f")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/dotnet/UnitTests/TestData.cs b/dotnet/UnitTests/TestData.cs
new file mode 100644
index 0000000..f3e65c5
--- /dev/null
+++ b/dotnet/UnitTests/TestData.cs
@@ -0,0 +1,108 @@
+using ITS.ITU.PSeries;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+
+namespace UnitTests
+{
+ public class TestData
+ {
+ static readonly string[] _heightGainTestData;
+ static readonly string[] _terrestrialStatisticalTestData;
+ static readonly string[] _aeronauticalStatisticalTestData;
+
+ public static IEnumerable HeightGainTerminalCorrectionModelTestData
+ {
+ get
+ {
+ foreach (var line in _heightGainTestData)
+ {
+ var parts = line.Split(',');
+
+ // parse data line
+ double f__ghz = Convert.ToDouble(parts[0]);
+ double h__meter = Convert.ToDouble(parts[1]);
+ double w_s__meter = Convert.ToDouble(parts[2]);
+ double R__meter = Convert.ToDouble(parts[3]);
+ P2108.ClutterType clutter_type = (P2108.ClutterType)Convert.ToInt32(parts[4]);
+ int rtn = Convert.ToInt32(parts[5]);
+ double A_h__db = Convert.ToDouble(parts[6]);
+
+ yield return new object[]
+ {
+ f__ghz,
+ h__meter,
+ w_s__meter,
+ R__meter,
+ clutter_type,
+ rtn,
+ A_h__db
+ };
+ }
+ }
+ }
+
+ public static IEnumerable TerrestrialStatisticalModelTestData
+ {
+ get
+ {
+ foreach (var line in _terrestrialStatisticalTestData)
+ {
+ var parts = line.Split(',');
+
+ // parse data line
+ double f__ghz = Convert.ToDouble(parts[0]);
+ double d__km = Convert.ToDouble(parts[1]);
+ double p = Convert.ToDouble(parts[2]);
+ int rtn = Convert.ToInt32(parts[3]);
+ double L_ctt__db = Convert.ToDouble(parts[4]);
+
+ yield return new object[]
+ {
+ f__ghz,
+ d__km,
+ p,
+ rtn,
+ L_ctt__db
+ };
+ }
+ }
+ }
+
+ public static IEnumerable AeronauticalStatisticalModelTestData
+ {
+ get
+ {
+ foreach (var line in _aeronauticalStatisticalTestData)
+ {
+ var parts = line.Split(',');
+
+ // parse data line
+ double f__ghz = Convert.ToDouble(parts[0]);
+ double theta__deg = Convert.ToDouble(parts[1]);
+ double p = Convert.ToDouble(parts[2]);
+ int rtn = Convert.ToInt32(parts[3]);
+ double L_ces__db = Convert.ToDouble(parts[4]);
+
+ yield return new object[]
+ {
+ f__ghz,
+ theta__deg,
+ p,
+ rtn,
+ L_ces__db
+ };
+ }
+ }
+ }
+
+ static TestData()
+ {
+ // load test data from file
+ _heightGainTestData = File.ReadAllLines("HeightGainTerminalCorrectionModelTestData.csv").Skip(1).ToArray();
+ _terrestrialStatisticalTestData = File.ReadAllLines("TerrestrialStatisticalModelTestData.csv").Skip(1).ToArray();
+ _aeronauticalStatisticalTestData = File.ReadAllLines("AeronauticalStatisticalModelTestData.csv").Skip(1).ToArray();
+ }
+ }
+}
diff --git a/dotnet/UnitTests/Unit-Test-Instructions.txt b/dotnet/UnitTests/Unit-Test-Instructions.txt
new file mode 100644
index 0000000..5ec611b
--- /dev/null
+++ b/dotnet/UnitTests/Unit-Test-Instructions.txt
@@ -0,0 +1,7 @@
+Instructions for running unit tests
+-----------------------------------
+1. Build C++ code in x64 and x86 configuration.
+2. Rename C++ DLLs with corresponding suffix '_x64' or '_x86', accordingly. These
+ are the DLL names that .NET class is looking for.
+3. Move C++ DLLs to the Debug directory where the UnitTests project is built.
+4. Use Visual Studio Text Explorer to run the tests.
\ No newline at end of file
diff --git a/dotnet/UnitTests/UnitTests.csproj b/dotnet/UnitTests/UnitTests.csproj
new file mode 100644
index 0000000..7866218
--- /dev/null
+++ b/dotnet/UnitTests/UnitTests.csproj
@@ -0,0 +1,102 @@
+
+
+
+
+
+
+ Debug
+ AnyCPU
+ {1FB5483E-2EED-4E27-A1D4-16646507EC9F}
+ Library
+ Properties
+ UnitTests
+ UnitTests
+ v4.8.1
+ 512
+ true
+
+
+
+
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+
+
+
+
+
+
+
+
+ ..\packages\xunit.abstractions.2.0.3\lib\net35\xunit.abstractions.dll
+
+
+ ..\packages\xunit.assert.2.4.2\lib\netstandard1.1\xunit.assert.dll
+
+
+ ..\packages\xunit.extensibility.core.2.4.2\lib\net452\xunit.core.dll
+
+
+ ..\packages\xunit.extensibility.execution.2.4.2\lib\net452\xunit.execution.desktop.dll
+
+
+
+
+
+
+
+
+
+ {6aa0c335-f019-4818-97b6-7b32bbe190e4}
+ ITS.ITU.PSeries.P2108
+
+
+
+
+ AeronauticalStatisticalModelTestData.csv
+ Always
+
+
+ HeightGainTerminalCorrectionModelTestData.csv
+ Always
+
+
+ TerrestrialStatisticalModelTestData.csv
+ Always
+
+
+
+
+
+
+
+
+
+
+
+
+
+ This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/dotnet/UnitTests/packages.config b/dotnet/UnitTests/packages.config
new file mode 100644
index 0000000..1be12c9
--- /dev/null
+++ b/dotnet/UnitTests/packages.config
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/dotnet/nuget/build/net472/p2108.targets b/dotnet/nuget/build/net481/p2108.targets
similarity index 100%
rename from dotnet/nuget/build/net472/p2108.targets
rename to dotnet/nuget/build/net481/p2108.targets
diff --git a/dotnet/nuget/p2108.nuspec b/dotnet/nuget/p2108.nuspec
index 2f7c706..7722383 100644
--- a/dotnet/nuget/p2108.nuspec
+++ b/dotnet/nuget/p2108.nuspec
@@ -2,7 +2,7 @@
P2108
- 0.0.0
+ 1.0.0
The Institute for Telecommunication Sciences
The Institute for Telecommunication Sciences
LICENSE.md
@@ -14,17 +14,17 @@
ITU SG3 Propagation P2108 P.2108
-
+
-
-
-
-
+
+
+
+
\ No newline at end of file
diff --git a/dotnet/p2108_dotnet.sln b/dotnet/p2108_dotnet.sln
index 7fd4286..1d1f703 100644
--- a/dotnet/p2108_dotnet.sln
+++ b/dotnet/p2108_dotnet.sln
@@ -1,9 +1,14 @@
Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio Version 16
-VisualStudioVersion = 16.0.31424.327
+# Visual Studio Version 17
+VisualStudioVersion = 17.5.33516.290
MinimumVisualStudioVersion = 10.0.40219.1
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ITS.Propagation.P2108", "ITS.Propagation.P2108\ITS.Propagation.P2108.csproj", "{6AA0C335-F019-4818-97B6-7B32BBE190E4}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ITS.ITU.PSeries.P2108", "ITS.ITU.PSeries.P2108\ITS.ITU.PSeries.P2108.csproj", "{6AA0C335-F019-4818-97B6-7B32BBE190E4}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnitTests", "UnitTests\UnitTests.csproj", "{1FB5483E-2EED-4E27-A1D4-16646507EC9F}"
+ ProjectSection(ProjectDependencies) = postProject
+ {6AA0C335-F019-4818-97B6-7B32BBE190E4} = {6AA0C335-F019-4818-97B6-7B32BBE190E4}
+ EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -15,6 +20,10 @@ Global
{6AA0C335-F019-4818-97B6-7B32BBE190E4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6AA0C335-F019-4818-97B6-7B32BBE190E4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6AA0C335-F019-4818-97B6-7B32BBE190E4}.Release|Any CPU.Build.0 = Release|Any CPU
+ {1FB5483E-2EED-4E27-A1D4-16646507EC9F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {1FB5483E-2EED-4E27-A1D4-16646507EC9F}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {1FB5483E-2EED-4E27-A1D4-16646507EC9F}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {1FB5483E-2EED-4E27-A1D4-16646507EC9F}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/include/Consts.h b/include/Consts.h
index c2237d4..c81d127 100644
--- a/include/Consts.h
+++ b/include/Consts.h
@@ -15,7 +15,7 @@
#define DEFAULT_CLUTTER_HEIGHT__WATER_SEA 10
#define DEFAULT_CLUTTER_HEIGHT__OPEN_RURAL 10
#define DEFAULT_CLUTTER_HEIGHT__SUBURBAN 10
-#define DEFAULT_CLUTTER_HEIGHT__URBAN 10
+#define DEFAULT_CLUTTER_HEIGHT__URBAN 15
#define DEFAULT_CLUTTER_HEIGHT__TREES_FOREST 15
#define DEFAULT_CLUTTER_HEIGHT__DENSE_URBAN 20
diff --git a/include/P2108.h b/include/P2108.h
index b521f84..0983b57 100644
--- a/include/P2108.h
+++ b/include/P2108.h
@@ -25,3 +25,4 @@ int Section3p1_InputValidation(double f__ghz, double h__meter, double w_s__meter
double R__meter);
int Section3p2_InputValidation(double f__ghz, double d__km, double p);
int Section3p3_InputValidation(double f__ghz, double theta__deg, double p);
+double TerrestrialStatisticalModelHelper(double f__ghz, double d__km, double p);
diff --git a/src/AeronauticalStatisticalModel.cpp b/src/AeronauticalStatisticalModel.cpp
index 3c9a276..bad7d0d 100644
--- a/src/AeronauticalStatisticalModel.cpp
+++ b/src/AeronauticalStatisticalModel.cpp
@@ -11,7 +11,7 @@
|
| Input: f__ghz - Frequency, in GHz
| theta__deg - Elevation angle, in degrees
- | p - Percentange of locations, in %
+ | p - Percentage of locations, in %
|
| Output: L_ces__db - Additional loss (clutter loss), in dB
|
@@ -45,7 +45,7 @@ int AeronauticalStatisticalModel(double f__ghz, double theta__deg, double p,
|
| Input: f__ghz - Frequency, in GHz
| theta__deg - Elevation angle, in degrees
- | p - Percentange of locations, in %
+ | p - Percentage of locations, in %
|
| Returns: error code or SUCCESS
|
diff --git a/src/HeightGainTerminalCorrectionModel.cpp b/src/HeightGainTerminalCorrectionModel.cpp
index 925bef0..764383f 100644
--- a/src/HeightGainTerminalCorrectionModel.cpp
+++ b/src/HeightGainTerminalCorrectionModel.cpp
@@ -27,9 +27,15 @@ int HeightGainTerminalCorrectionModel(double f__ghz, double h__meter,
if (rtn != SUCCESS)
return rtn;
- double h_dif__meter = R__meter - h__meter; // Equation (2d)
- double theta_clut__deg = atan(h_dif__meter / w_s__meter); // Equation (2e)
- double K_h2 = 21.8 + 6.2 * log10(f__ghz); // Equation (2f)
+ if (h__meter >= R__meter)
+ {
+ *A_h__db = 0;
+ return SUCCESS;
+ }
+
+ double h_dif__meter = R__meter - h__meter; // Equation (2d)
+ double theta_clut__deg = atan(h_dif__meter / w_s__meter) * 180.0 / PI; // Equation (2e)
+ double K_h2 = 21.8 + 6.2 * log10(f__ghz); // Equation (2f)
switch (clutter_type)
{
@@ -78,7 +84,7 @@ int Section3p1_InputValidation(double f__ghz, double h__meter, double w_s__meter
if (f__ghz < 0.03 || f__ghz > 3)
return ERROR31__FREQUENCY;
- if (h__meter < 0)
+ if (h__meter <= 0)
return ERROR31__ANTENNA_HEIGHT;
if (w_s__meter <= 0)
diff --git a/src/InverseComplementaryCumulativeDistribution.cpp b/src/InverseComplementaryCumulativeDistribution.cpp
index 97facc5..a192806 100644
--- a/src/InverseComplementaryCumulativeDistribution.cpp
+++ b/src/InverseComplementaryCumulativeDistribution.cpp
@@ -16,7 +16,7 @@
*===========================================================================*/
double InverseComplementaryCumulativeDistribution(double q)
{
- double C_0 = 2.515516;
+ double C_0 = 2.515517;
double C_1 = 0.802853;
double C_2 = 0.010328;
double D_1 = 1.432788;
@@ -24,7 +24,7 @@ double InverseComplementaryCumulativeDistribution(double q)
double D_3 = 0.001308;
double x = q;
- if (q > 50)
+ if (q > 0.5)
x = 1.0 - x;
double T_x = sqrt(-2.0 * log(x));
@@ -33,7 +33,7 @@ double InverseComplementaryCumulativeDistribution(double q)
double Q_q = T_x - zeta_x;
- if (q > 50)
+ if (q > 0.5)
Q_q = -Q_q;
return Q_q;
diff --git a/src/TerrestrialStatisticalModel.cpp b/src/TerrestrialStatisticalModel.cpp
index 14f0bb8..4b92b41 100644
--- a/src/TerrestrialStatisticalModel.cpp
+++ b/src/TerrestrialStatisticalModel.cpp
@@ -9,7 +9,7 @@
|
| Input: f__ghz - Frequency, in GHz
| d__km - Path distance, in km
- | p - Percentange of locations, in %
+ | p - Percentage of locations, in %
|
| Output: L_ctt__db - Additional loss (clutter loss), in dB
|
@@ -22,15 +22,51 @@ int TerrestrialStatisticalModel(double f__ghz, double d__km, double p, double* L
if (rtn != SUCCESS)
return rtn;
- double L_l__db = 23.5 + 9.6 * log10(f__ghz); // Equation 4
- double L_s__db = 32.98 + 23.9 * log10(d__km) + 3 * log10(f__ghz); // Equation 5
+ // compute clutter loss at 2 km
+ double L_ctt_2km__db = TerrestrialStatisticalModelHelper(f__ghz, 2, p);
- *L_ctt__db = -5 * log10(pow(10, -0.2 * L_l__db) + pow(10, -0.2 * L_s__db))
- - 6 * InverseComplementaryCumulativeDistribution(p / 100);
+ // compute clutter loss at requested distance
+ double L_ctt_d__db = TerrestrialStatisticalModelHelper(f__ghz, d__km, p);
+
+ // "clutter loss must not exceed a maximum value given by [Equation 6]"
+ *L_ctt__db = fmin(L_ctt_2km__db, L_ctt_d__db);
return SUCCESS;
}
+/*=============================================================================
+ |
+ | Description: Compute the clutter loss
+ |
+ | Input: f__ghz - Frequency, in GHz
+ | d__km - Path distance, in km
+ | p - Percentage of locations, in %
+ |
+ | Returns: L_ctt__db - Clutter loss, in dB
+ |
+ *===========================================================================*/
+double TerrestrialStatisticalModelHelper(double f__ghz, double d__km, double p)
+{
+ // Equations 4a and 4b
+ double sigma_l__db = 4;
+ double L_l__db = -2 * log10(pow(10, -5 * log10(f__ghz) - 12.5) + pow(10, -16.5));
+
+ // Equations 5a and 5b
+ double sigma_s__db = 6;
+ double L_s__db = 32.98 + 23.9 * log10(d__km) + 3 * log10(f__ghz);
+
+ // Equation 3b
+ double numerator = pow(sigma_l__db, 2) * pow(10, -0.2 * L_l__db) + pow(sigma_s__db, 2) * pow(10, -0.2 * L_s__db);
+ double denominator = pow(10, -0.2 * L_l__db) + pow(10, -0.2 * L_s__db);
+ double sigma_cb__db = sqrt(numerator / denominator);
+
+ // Equation 3a
+ double L_ctt__db = -5 * log10(pow(10, -0.2 * L_l__db) + pow(10, -0.2 * L_s__db))
+ - sigma_cb__db * InverseComplementaryCumulativeDistribution(p / 100);
+
+ return L_ctt__db;
+}
+
/*=============================================================================
|
| Description: Input validation for the statistical clutter loss model
@@ -38,14 +74,14 @@ int TerrestrialStatisticalModel(double f__ghz, double d__km, double p, double* L
|
| Input: f__ghz - Frequency, in GHz
| d__km - Path distance, in km
- | p - Percentange of locations, in %
+ | p - Percentage of locations, in %
|
| Returns: error code or SUCCESS
|
*===========================================================================*/
int Section3p2_InputValidation(double f__ghz, double d__km, double p)
{
- if (f__ghz < 2 || f__ghz > 67)
+ if (f__ghz < 0.5 || f__ghz > 67)
return ERROR32__FREQUENCY;
if (d__km < 0.25)
diff --git a/win32/p2108.rc b/win32/p2108.rc
index 45ad89f..8614fde 100644
--- a/win32/p2108.rc
+++ b/win32/p2108.rc
@@ -51,8 +51,8 @@ END
//
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 0,0,0,0
- PRODUCTVERSION 0,0,0,0
+ FILEVERSION 1,0,0,0
+ PRODUCTVERSION 1,0,0,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -68,12 +68,12 @@ BEGIN
BLOCK "040904b0"
BEGIN
VALUE "CompanyName", "The Institute for Telecommunication Sciences"
- VALUE "FileDescription", "Recommendation ITU-R P.2108-0"
- VALUE "FileVersion", "0.0.0.0"
+ VALUE "FileDescription", "Recommendation ITU-R P.2108-1"
+ VALUE "FileVersion", "1.0.0.0"
VALUE "InternalName", "p2108.dll"
VALUE "OriginalFilename", "p2108.dll"
- VALUE "ProductName", "Recommendation ITU-R P.2108-0"
- VALUE "ProductVersion", "0.0.0.0"
+ VALUE "ProductName", "Recommendation ITU-R P.2108-1"
+ VALUE "ProductVersion", "1.0.0.0"
END
END
BLOCK "VarFileInfo"
diff --git a/win32/p2108.vcxproj b/win32/p2108.vcxproj
index a039700..8ff091c 100644
--- a/win32/p2108.vcxproj
+++ b/win32/p2108.vcxproj
@@ -47,26 +47,26 @@
DynamicLibrary
true
- v142
+ v143
Unicode
DynamicLibrary
false
- v142
+ v143
true
Unicode
DynamicLibrary
true
- v142
+ v143
Unicode
DynamicLibrary
false
- v142
+ v143
true
Unicode