@@ -78,12 +78,12 @@ class ButterworthLowpass {
7878
7979 b[POLE_DATA_SIZE - 1 ] = 0.0 ;
8080
81- for (auto i = 0 ; i <= num_pole; ++i) {
81+ for (size_t i = 0 ; i <= num_pole; ++i) {
8282 a[i] = a[i + 2 ];
8383 b[i] = -b[i + 2 ];
8484 }
8585
86- for (auto i = 0 ; i <= num_pole; ++i) {
86+ for (size_t i = 0 ; i <= num_pole; ++i) {
8787 sa += a[i];
8888 sb += b[i];
8989 }
@@ -166,7 +166,7 @@ class KaiserWindowInterpolation {
166166 int outputSize = static_cast <int >(std::ceil (static_cast <float >(input.size ()) * factor));
167167 output.resize (outputSize);
168168
169- for (int i = 0 ; i < outputSize; i++) {
169+ for (size_t i = 0 ; i < outputSize; i++) {
170170 float index = i / factor; // Fractional index for interpolation
171171
172172 // Calculate the integer and fractional parts of the index
@@ -175,20 +175,20 @@ class KaiserWindowInterpolation {
175175
176176 // Calculate the range of input samples for interpolation
177177 int range = static_cast <int >(std::ceil (kBeta / (2.0 * factor)));
178- int startSample = std::max (0 , integerPart - range);
179- int endSample = std::min (static_cast <int >(input.size ()) - 1 , integerPart + range);
178+ size_t startSample = std::max (0 , integerPart - range);
179+ size_t endSample = std::min (static_cast <int >(input.size ()) - 1 , integerPart + range);
180180
181181 // Calculate the Kaiser window weights for the input samples
182182 std::vector<double > weights = KaiserWin (static_cast <size_t >(endSample - startSample + 1 ));
183- for (int j = startSample; j <= endSample; j++) {
184- double distance = std::abs (j - index);
183+ for (size_t j = startSample; j <= endSample; j++) {
184+ double distance = std::abs (static_cast < double >(j) - index);
185185 double sincValue = (distance < 1e-6f ) ? 1 .0f : std::sin (M_PI * distance) / (M_PI * distance);
186186 weights[j - startSample] *= sincValue;
187187 }
188188
189189 // Perform the interpolation
190190 double interpolatedValue = 0 .0f ;
191- for (int j = startSample; j <= endSample; j++) {
191+ for (size_t j = startSample; j <= endSample; j++) {
192192 interpolatedValue += input[j] * weights[j - startSample];
193193 }
194194
0 commit comments