Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Delay.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Delay.cpp: implementation of the CDelay class.
// ( also performs Hilbert Real to complex I/Q 3KHz filtering )

#include <cstring>

#include "Delay.h"
#include "FilterTables.h"

Expand Down
9 changes: 7 additions & 2 deletions NoiseGen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,13 @@ void NoiseGen::add_band_limited_noise(int bufsize, double *pInOut, double siggai
m_queue_pos = HILBPFIR_LENGTH - 1;
} else
acc = noise[j];
// Add BP filtered noise to signal
pInOut[i] = siggain * pInOut[i ++] + acc;
// Add BP filtered noise to signal.
// NB: this must not be written as pInOut[i] = ... pInOut[i++] ...:
// since C++17 the RHS (including i++) is sequenced BEFORE the
// left-hand subscript, so the store lands at pInOut[i+1] and
// destroys the next input sample before it is read.
pInOut[i] = siggain * pInOut[i] + acc;
++ i;
}
}
}
Expand Down
1 change: 1 addition & 0 deletions Path.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "Path.h"

#include <assert.h>
#include <cstring>

#define _USE_MATH_DEFINES
#include <math.h>
Expand Down