Skip to content

Commit 8b2b1a1

Browse files
committed
FFT Windows correct comment
1 parent d34cdd3 commit 8b2b1a1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/AudioTools/AudioLibs/FFT/FFTWindows.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class WindowFunction {
3131
this->i_half_samples = samples / 2 - 1;
3232
}
3333

34-
/// Provides the multipication factor at the indicated position. The result is symetirically mirrored around the center
34+
/// Provides the multipication factor at the indicated position. The result is symetrically mirrored around the center
3535
inline float factor(int idx) {
3636
float result = idx < i_half_samples ? factor_internal(idx) : factor_internal(i_samples-idx-1);
3737
return result>1.0f ? 1.0f : result;
@@ -102,7 +102,9 @@ class BufferedWindow : public WindowFunction {
102102
class Rectange : public WindowFunction {
103103
public:
104104
Rectange() = default;
105-
float factor_internal(int idx) { return 1.0f; }
105+
float factor_internal(int idx) {
106+
if (idx < 0 || idx >= i_samples) return 0;
107+
return 1.0f; }
106108
};
107109

108110
/**

0 commit comments

Comments
 (0)