From c48cdce3a245fcfde7c12a1d3704a3c87f2a3ff9 Mon Sep 17 00:00:00 2001 From: Billy Kozma Date: Sun, 3 Jan 2021 21:36:45 -0700 Subject: [PATCH 1/6] Fixed #11 --- src/IsolatedRidgeCorrectionFactor.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/IsolatedRidgeCorrectionFactor.cpp b/src/IsolatedRidgeCorrectionFactor.cpp index fc1b535..8253301 100644 --- a/src/IsolatedRidgeCorrectionFactor.cpp +++ b/src/IsolatedRidgeCorrectionFactor.cpp @@ -36,5 +36,9 @@ double IsolatedRidgeCorrectionFactor(double d1_hzn__km, double d2_hzn__km, doubl double c1 = curve_data[id1][id2] + (curve_data[id1][id2 + 1] - curve_data[id1][id2]) * (d2_hzn__km - d_2__km[id2]) / (d_2__km[id2 + 1] - d_2__km[id2]); double c2 = curve_data[id1 + 1][id2] + (curve_data[id1 + 1][id2 + 1] - curve_data[id1 + 1][id2]) * (d2_hzn__km - d_2__km[id2]) / (d_2__km[id2 + 1] - d_2__km[id2]); - return alpha * (c1 + (c2 - c1) * (d1_hzn__km - d_1__km[id1]) / (d_1__km[id1 + 1] - d_1__km[id1])); + // Isolated ridge correction factor (although sign is negative, ie, inverted) + double L_iso__db = alpha * (c1 + (c2 - c1) * MAX(0, (d1_hzn__km - d_1__km[id1])) / (d_1__km[id1 + 1] - d_1__km[id1])); + + // Clamp so the value doesn't result in a gain + return MIN(L_iso__db, 0); } \ No newline at end of file From 5fb3bdb06546e023b10e7795896ce86f5aed94fc Mon Sep 17 00:00:00 2001 From: Billy Kozma Date: Sun, 3 Jan 2021 21:37:53 -0700 Subject: [PATCH 2/6] bumped minor version number for build --- dotnet/ITS.Propagation.EHata/Properties/AssemblyInfo.cs | 4 ++-- dotnet/nuget/ExtendedHata.nuspec | 2 +- win32/ehata/ehata.rc | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/dotnet/ITS.Propagation.EHata/Properties/AssemblyInfo.cs b/dotnet/ITS.Propagation.EHata/Properties/AssemblyInfo.cs index fff8871..02c3fe6 100644 --- a/dotnet/ITS.Propagation.EHata/Properties/AssemblyInfo.cs +++ b/dotnet/ITS.Propagation.EHata/Properties/AssemblyInfo.cs @@ -32,5 +32,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("3.1.0.0")] -[assembly: AssemblyFileVersion("3.1.0.0")] +[assembly: AssemblyVersion("3.2.0.0")] +[assembly: AssemblyFileVersion("3.2.0.0")] diff --git a/dotnet/nuget/ExtendedHata.nuspec b/dotnet/nuget/ExtendedHata.nuspec index f39dd47..a88c77d 100644 --- a/dotnet/nuget/ExtendedHata.nuspec +++ b/dotnet/nuget/ExtendedHata.nuspec @@ -2,7 +2,7 @@ ExtendedHata - 3.1.0 + 3.2.0 The Institute for Telecommunication Sciences The Institute for Telecommunication Sciences LICENSE.md diff --git a/win32/ehata/ehata.rc b/win32/ehata/ehata.rc index a838ec9..7b90c65 100644 --- a/win32/ehata/ehata.rc +++ b/win32/ehata/ehata.rc @@ -51,8 +51,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 3,1,0,0 - PRODUCTVERSION 3,1,0,0 + FILEVERSION 3,2,0,0 + PRODUCTVERSION 3,2,0,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -69,11 +69,11 @@ BEGIN BEGIN VALUE "CompanyName", "The Institute for Telecommunication Sciences" VALUE "FileDescription", "Extended Hata Urban Propagation Model (EHata)" - VALUE "FileVersion", "3.1.0.0" + VALUE "FileVersion", "3.2.0.0" VALUE "InternalName", "ehata.dll" VALUE "OriginalFilename", "ehata.dll" VALUE "ProductName", "Extended Hata Urban Propagation Model (EHata)" - VALUE "ProductVersion", "3.1.0.0" + VALUE "ProductVersion", "3.2.0.0" END END BLOCK "VarFileInfo" From 8bb5688b768c96cbefc1b62286e5dfa18cdee7fe Mon Sep 17 00:00:00 2001 From: Billy Kozma Date: Tue, 12 Jan 2021 14:50:33 -0700 Subject: [PATCH 3/6] switch from class to struct --- dotnet/ITS.Propagation.EHata/IntermediateValues.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dotnet/ITS.Propagation.EHata/IntermediateValues.cs b/dotnet/ITS.Propagation.EHata/IntermediateValues.cs index 5cecdb6..9ae36f3 100644 --- a/dotnet/ITS.Propagation.EHata/IntermediateValues.cs +++ b/dotnet/ITS.Propagation.EHata/IntermediateValues.cs @@ -10,7 +10,7 @@ public static partial class EHata /// /// Intermediate values from EHata /// - public class IntermediateValues + public struct IntermediateValues { /// /// Breakpoint distance, in km From 5908f426fa3256878268456e3f26bcaa927152d5 Mon Sep 17 00:00:00 2001 From: Billy Kozma Date: Tue, 12 Jan 2021 16:03:29 -0700 Subject: [PATCH 4/6] Issue #11. updated fix code. ensures value between curves A and C, inclusive. applies asymptotic value of 0 dB as d2 increases, but allows gain for very small distances of d2 (as visible in Figure 31) --- src/IsolatedRidgeCorrectionFactor.cpp | 34 ++++++++++++++++++++------- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/src/IsolatedRidgeCorrectionFactor.cpp b/src/IsolatedRidgeCorrectionFactor.cpp index 8253301..f6fe856 100644 --- a/src/IsolatedRidgeCorrectionFactor.cpp +++ b/src/IsolatedRidgeCorrectionFactor.cpp @@ -16,29 +16,47 @@ double IsolatedRidgeCorrectionFactor(double d1_hzn__km, double d2_hzn__km, doubl double d_1__km[3] = { 15.0, 30.0, 60.0 }; double d_2__km[9] = { 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 }; - // points from Figure 31, Okumura + // points from Figure 31, Okumura, at corresponding d2 distances double curve_data[3][9] = { { 4.0, -13.0, -17.5, -17.5, -15.0, -12.5, -10.0, -8.0, -6.0 }, // C curve : d1 <= 15 km { 12.0, -8.5, -13.0, -12.0, -10.0, -8.0, -6.5, -5.0, -4.0 }, // B curve : d1 <= 30 km { 20.0, -4.0, -6.5, -6.0, -4.5, -3.5, -2.5, -2.0, -1.0 } }; // A curve : d1 <= 60 km // normalized ridge height factor - double alpha = sqrt(h_edge__meter / 200.0); // Eq 1, Okumura, alpha = 0.07 * sqrt(h) + // Eq 1, Okumura, alpha = 0.07 * sqrt(h) + double alpha = sqrt(h_edge__meter / 200.0); + // identify the d1 curve set to use int id1 = 0; if (d1_hzn__km >= d_1__km[1]) id1 = 1; - int id2 = 0; - while (id2 < 7 && d2_hzn__km > d_2__km[id2 + 1]) + // select the first d2 curve distance that is <= to actual path d2 distance + int id2 = 0; + while (id2 < 8 && d2_hzn__km > d_2__km[id2 + 1]) id2 = id2 + 1; + // c1 is value on "lower" curve in Figure 31, Okumura, relative to d1 - either curve B or C + // c2 is value on "upper" curve in Figure 31, Okumura, relative to d1 - either curve A or B double c1 = curve_data[id1][id2] + (curve_data[id1][id2 + 1] - curve_data[id1][id2]) * (d2_hzn__km - d_2__km[id2]) / (d_2__km[id2 + 1] - d_2__km[id2]); double c2 = curve_data[id1 + 1][id2] + (curve_data[id1 + 1][id2 + 1] - curve_data[id1 + 1][id2]) * (d2_hzn__km - d_2__km[id2]) / (d_2__km[id2 + 1] - d_2__km[id2]); - // Isolated ridge correction factor (although sign is negative, ie, inverted) - double L_iso__db = alpha * (c1 + (c2 - c1) * MAX(0, (d1_hzn__km - d_1__km[id1])) / (d_1__km[id1 + 1] - d_1__km[id1])); + // compute isolated ridge correction factor, K_im, from Figure 31, Okumura + double K_im; + if (d1_hzn__km <= 15) // clamp to curve C + K_im = c1; + else if (d1_hzn__km >= 60) // clamp to curve A + K_im = c2; + else // interpolate between curves + K_im = (c1 + (c2 - c1) * (d1_hzn__km - d_1__km[id1]) / (d_1__km[id1 + 1] - d_1__km[id1])); + + // clamp K_im asymptote value to 0 dB (to avoid causing a non-physical gain from occuring) + // allow the gain to occur for portion of the curve with d2 distances close to or equal to 0 km + if (d2_hzn__km > 2) + K_im = MIN(K_im, 0); + + // apply conversion factor to account for ridge height, Figure 32, Okumura + double L_iso__db = alpha * K_im; - // Clamp so the value doesn't result in a gain - return MIN(L_iso__db, 0); + return L_iso__db; } \ No newline at end of file From 722b7cd13b9746af6a663b4a7131ac8d8637101c Mon Sep 17 00:00:00 2001 From: Billy Kozma Date: Tue, 12 Jan 2021 16:05:47 -0700 Subject: [PATCH 5/6] Issue #11. didn't mean to change loop index. reverting back to 7 --- src/IsolatedRidgeCorrectionFactor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/IsolatedRidgeCorrectionFactor.cpp b/src/IsolatedRidgeCorrectionFactor.cpp index f6fe856..b49bac5 100644 --- a/src/IsolatedRidgeCorrectionFactor.cpp +++ b/src/IsolatedRidgeCorrectionFactor.cpp @@ -33,7 +33,7 @@ double IsolatedRidgeCorrectionFactor(double d1_hzn__km, double d2_hzn__km, doubl // select the first d2 curve distance that is <= to actual path d2 distance int id2 = 0; - while (id2 < 8 && d2_hzn__km > d_2__km[id2 + 1]) + while (id2 < 7 && d2_hzn__km > d_2__km[id2 + 1]) id2 = id2 + 1; // c1 is value on "lower" curve in Figure 31, Okumura, relative to d1 - either curve B or C From 19f6771b2c756086b1b36e2ad4aab52412a37f14 Mon Sep 17 00:00:00 2001 From: Billy Kozma Date: Thu, 21 Jan 2021 14:57:04 -0700 Subject: [PATCH 6/6] added a comment --- src/IsolatedRidgeCorrectionFactor.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/IsolatedRidgeCorrectionFactor.cpp b/src/IsolatedRidgeCorrectionFactor.cpp index b49bac5..1ed542d 100644 --- a/src/IsolatedRidgeCorrectionFactor.cpp +++ b/src/IsolatedRidgeCorrectionFactor.cpp @@ -24,6 +24,7 @@ double IsolatedRidgeCorrectionFactor(double d1_hzn__km, double d2_hzn__km, doubl // normalized ridge height factor // Eq 1, Okumura, alpha = 0.07 * sqrt(h) + // Note: 0.07 is approx sqrt (1/ 200), with 200 being the normalization height double alpha = sqrt(h_edge__meter / 200.0); // identify the d1 curve set to use