Skip to content

Commit

Permalink
Clear output outside the STFT #30
Browse files Browse the repository at this point in the history
  • Loading branch information
jurihock committed Nov 17, 2023
1 parent 0bb4cbc commit 6b5877f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 0 additions & 2 deletions cpp/StftPitchShift/STFT.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,6 @@ namespace stftpitchshift
{
const size_t samples = (std::min)(input.size(), output.size());

std::fill(output.begin(), output.end(), T(0)); // clear output #30

if (chronometry)
{
struct
Expand Down
6 changes: 6 additions & 0 deletions cpp/StftPitchShift/StftPitchShift.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ void StftPitchShift::shiftpitch(
const double quefrency,
const double distortion)
{
// preemptively clear output #30
std::fill(output.begin(), output.end(), float(0));

StftPitchShiftCore<float> core(fft, framesize, hopsize, samplerate);

core.factors(factors);
Expand All @@ -136,6 +139,9 @@ void StftPitchShift::shiftpitch(
const double quefrency,
const double distortion)
{
// preemptively clear output #30
std::fill(output.begin(), output.end(), double(0));

StftPitchShiftCore<double> core(fft, framesize, hopsize, samplerate);

core.factors(factors);
Expand Down

0 comments on commit 6b5877f

Please sign in to comment.