kopia lustrzana https://github.com/OpenRTX/OpenRTX
Add invert phase DSP filter
rodzic
be21364b30
commit
3439f3a497
|
@ -54,6 +54,15 @@ void dsp_pwmCompensate(audio_sample_t *buffer, size_t length);
|
|||
*/
|
||||
void dsp_dcRemoval(audio_sample_t *buffer, size_t length);
|
||||
|
||||
/*
|
||||
* Inverts the phase of the audio buffer passed as paramenter.
|
||||
* The buffer will be processed in place to save memory.
|
||||
*
|
||||
* @param buffer: the buffer to be used as both source and destination.
|
||||
* @param length: the length of the input buffer.
|
||||
*/
|
||||
void dsp_invertPhase(audio_sample_t *buffer, uint16_t length);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
|
|
|
@ -57,9 +57,11 @@ void dsp_applyFIR(audio_sample_t *buffer,
|
|||
uint16_t length,
|
||||
std::array<float, order> taps)
|
||||
{
|
||||
for(int i = length - 1; i >= 0; i--) {
|
||||
for(int i = length - 1; i >= 0; i--)
|
||||
{
|
||||
float acc = 0.0f;
|
||||
for(uint16_t j = 0; j < order; j++) {
|
||||
for(uint16_t j = 0; j < order; j++)
|
||||
{
|
||||
if (i >= j)
|
||||
acc += buffer[i - j] * taps[j];
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue