arduino-audio-tools
Loading...
Searching...
No Matches
Classes | Namespaces | Macros | Typedefs | Functions
MDFEchoCancellation.h File Reference
#include <algorithm>
#include <cmath>
#include <cstdint>
#include <cstdlib>
#include <cstring>
#include <type_traits>
#include "MDFEchoCancellationConfig.h"
#include "PseudoFloat.h"
#include "AudioTools/FFT/AudioFFT.h"
#include "AudioTools/CoreAudio/AudioBasic/Collections/Allocator.h"
#include "AudioTools/CoreAudio/AudioTypes.h"

Go to the source code of this file.

Classes

struct  EchoState< T, SampleType >
 Internal echo canceller state structure. More...
 
struct  fft_state
 FFT state management structure. More...
 
class  MDFEchoCancellation< T, SampleType >
 Acoustic echo canceller using MDF algorithm. More...
 
struct  MDFFixedPoint
 Selects PseudoFloat (see PseudoFloat.h) as MDFEchoCancellation's internal numeric representation, so the algorithm runs on integer mantissa/exponent arithmetic instead of native float instructions – useful on microcontrollers without an FPU. PseudoFloat's arithmetic is verified against native float directly (see the PseudoFloat tests in tests-cmake/stt/stt_test.cpp), and MDFEchoCancellation<int16_t, MDFFixedPoint> is smoke-tested to run without crashing/NaN and to converge similarly to MDFFloat on the same synthetic signal – but it has not received the same depth of numerical scrutiny as MDFFloat, so treat it as less battle-tested. Despite the name, this is not a classic narrow Q15 fixed-point format (that would over/underflow across this algorithm's actual value range – see PseudoFloat's class doc for why). More...
 
struct  MDFFloat
 Selects float as MDFEchoCancellation's internal numeric representation for sample/spectrum arrays (word16_t/word32_t) and wide-dynamic-range control state (float_t). This is the default, and the one that has been verified to converge (see test_mdf_converges in tests-cmake/stt/stt_test.cpp) – prefer it unless you specifically need to avoid hardware floating-point instructions (e.g. no FPU). More...
 

Namespaces

namespace  audio_tools
 Generic Implementation of sound input and output for desktop environments using portaudio.
 

Macros

#define ECHO_GET_FRAME_SIZE   3
 
#define ECHO_GET_IMPULSE_RESPONSE   29
 
#define ECHO_GET_IMPULSE_RESPONSE_SIZE   27
 
#define ECHO_GET_SAMPLING_RATE   25
 
#define ECHO_SET_SAMPLING_RATE   24
 

Typedefs

using echo_int16_t = int16_t
 
using echo_int32_t = int32_t
 
using echo_uint16_t = uint16_t
 
using echo_uint32_t = uint32_t
 

Functions

template<typename T >
void echo_fft (void *table, T *in, T *out)
 Perform forward FFT.
 
void echo_fft_destroy (void *table)
 Destroy FFT state and release resources.
 
void * echo_fft_init (int size, FFTDriver *driver)
 Initialize FFT state.
 
template<typename T >
void echo_ifft (void *table, T *in, T *out)
 Perform inverse FFT.
 

Macro Definition Documentation

◆ ECHO_GET_FRAME_SIZE

#define ECHO_GET_FRAME_SIZE   3

◆ ECHO_GET_IMPULSE_RESPONSE

#define ECHO_GET_IMPULSE_RESPONSE   29

◆ ECHO_GET_IMPULSE_RESPONSE_SIZE

#define ECHO_GET_IMPULSE_RESPONSE_SIZE   27

◆ ECHO_GET_SAMPLING_RATE

#define ECHO_GET_SAMPLING_RATE   25

◆ ECHO_SET_SAMPLING_RATE

#define ECHO_SET_SAMPLING_RATE   24