Skip to content

Commit

Permalink
FFT Windows correct comment
Browse files Browse the repository at this point in the history
  • Loading branch information
pschatzmann committed Feb 20, 2025
1 parent d34cdd3 commit 8b2b1a1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/AudioTools/AudioLibs/FFT/FFTWindows.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class WindowFunction {
this->i_half_samples = samples / 2 - 1;
}

/// Provides the multipication factor at the indicated position. The result is symetirically mirrored around the center
/// Provides the multipication factor at the indicated position. The result is symetrically mirrored around the center
inline float factor(int idx) {
float result = idx < i_half_samples ? factor_internal(idx) : factor_internal(i_samples-idx-1);
return result>1.0f ? 1.0f : result;
Expand Down Expand Up @@ -102,7 +102,9 @@ class BufferedWindow : public WindowFunction {
class Rectange : public WindowFunction {
public:
Rectange() = default;
float factor_internal(int idx) { return 1.0f; }
float factor_internal(int idx) {
if (idx < 0 || idx >= i_samples) return 0;
return 1.0f; }
};

/**
Expand Down

0 comments on commit 8b2b1a1

Please sign in to comment.