@@ -103,15 +103,11 @@ public static RetCode HtPhasor(double[] inReal, int startIdx, int endIdx, double
103103 outInPhase [ outIdx ++ ] = i1ForOddPrev3 ;
104104 }
105105
106- DoHilbertOdd ( hilbertVariables , "jI" , i1ForEvenPrev3 , hilbertIdx , adjustedPrevPeriod ) ;
106+ DoHilbertOdd ( hilbertVariables , "jI" , i1ForOddPrev3 , hilbertIdx , adjustedPrevPeriod ) ;
107107 DoHilbertOdd ( hilbertVariables , "jQ" , hilbertVariables [ "q1" ] , hilbertIdx , adjustedPrevPeriod ) ;
108- if ( ++ hilbertIdx == 3 )
109- {
110- hilbertIdx = 0 ;
111- }
112108
113109 q2 = 0.2 * ( hilbertVariables [ "q1" ] + hilbertVariables [ "jI" ] ) + 0.8 * prevQ2 ;
114- i2 = 0.2 * ( i1ForEvenPrev3 - hilbertVariables [ "jQ" ] ) + 0.8 * prevI2 ;
110+ i2 = 0.2 * ( i1ForOddPrev3 - hilbertVariables [ "jQ" ] ) + 0.8 * prevI2 ;
115111 i1ForEvenPrev3 = i1ForEvenPrev2 ;
116112 i1ForEvenPrev2 = hilbertVariables [ "detrender" ] ;
117113 }
@@ -255,15 +251,11 @@ public static RetCode HtPhasor(decimal[] inReal, int startIdx, int endIdx, decim
255251 outInPhase [ outIdx ++ ] = i1ForOddPrev3 ;
256252 }
257253
258- DoHilbertOdd ( hilbertVariables , "jI" , i1ForEvenPrev3 , hilbertIdx , adjustedPrevPeriod ) ;
254+ DoHilbertOdd ( hilbertVariables , "jI" , i1ForOddPrev3 , hilbertIdx , adjustedPrevPeriod ) ;
259255 DoHilbertOdd ( hilbertVariables , "jQ" , hilbertVariables [ "q1" ] , hilbertIdx , adjustedPrevPeriod ) ;
260- if ( ++ hilbertIdx == 3 )
261- {
262- hilbertIdx = 0 ;
263- }
264256
265257 q2 = 0.2m * ( hilbertVariables [ "q1" ] + hilbertVariables [ "jI" ] ) + 0.8m * prevQ2 ;
266- i2 = 0.2m * ( i1ForEvenPrev3 - hilbertVariables [ "jQ" ] ) + 0.8m * prevI2 ;
258+ i2 = 0.2m * ( i1ForOddPrev3 - hilbertVariables [ "jQ" ] ) + 0.8m * prevI2 ;
267259 i1ForEvenPrev3 = i1ForEvenPrev2 ;
268260 i1ForEvenPrev2 = hilbertVariables [ "detrender" ] ;
269261 }
0 commit comments