File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
src/AudioTools/AudioLibs/FFT Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff 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 {
102102class 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/* *
You can’t perform that action at this time.
0 commit comments