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 {
31
31
this ->i_half_samples = samples / 2 - 1 ;
32
32
}
33
33
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
35
35
inline float factor (int idx) {
36
36
float result = idx < i_half_samples ? factor_internal (idx) : factor_internal (i_samples-idx-1 );
37
37
return result>1 .0f ? 1 .0f : result;
@@ -102,7 +102,9 @@ class BufferedWindow : public WindowFunction {
102
102
class Rectange : public WindowFunction {
103
103
public:
104
104
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 ; }
106
108
};
107
109
108
110
/* *
You can’t perform that action at this time.
0 commit comments