|
Wave Arts VQE
1.00
Voice Quality Enhancement
|
Virtual base class for AEC algorithms. More...
#include <AecObjects.h>
Public Member Functions | |
| virtual | ~AecProcessor () |
| destructor | |
| virtual void | Process (float *refBuf, float *recBuf, int n)=0 |
| Process AEC samples. | |
| virtual void | Reset (bool isHard)=0 |
| Reset AEC. | |
| virtual void | SetLatency (int latency) |
| Set I/O latency. | |
Virtual base class for AEC algorithms.
| virtual void AecProcessor::Process | ( | float * | refBuf, |
| float * | recBuf, | ||
| int | n | ||
| ) | [pure virtual] |
Process AEC samples.
| [in] | refBuf | reference (far) signal buffer |
| [in,out] | recBuf | record (near) signal buffer, replaced |
| [in] | n | number of sample frames |
The AEC algorithm is called with a matched pair of reference and record signal buffers which should have a constant latency relationship, provided the sample rates are synchronized. The AEC algorithm is responsible for compensating for the latency, usually by internally delaying the reference signal. See AecProcessor::SetLatency. If the sample rates are not synchronized then the latency relationship will drift. The AecInFifo will discard or repeat a record buffer when the drift exceeds a single buffer time. This is called a buffer overrun or buffer underrun.
The recBuf buffer is replaced by the "error signal", the echo cancelled result. Note the AEC algorithm already knows the frame size and numbers of input and output channels. Hence passing the number of sample frames via n is redundant.
Implemented in AecObject, AesObject, and AecLatCalObject.
| virtual void AecProcessor::Reset | ( | bool | isHard | ) | [pure virtual] |
Reset AEC.
| [in] | isHard | true if hard reset, else soft reset |
A hard reset resets the AEC algorithm to initial conditions. A hard reset will also cause the latency to be measured if the AecLatCalObject is used. A soft reset should be called when a signal discontinuity is detected due to lack of buffer synchronization.
Implemented in AecObject, AesObject, and AecLatCalObject.
| void AecProcessor::SetLatency | ( | int | latency | ) | [virtual] |
Set I/O latency.
| [in] | latency | I/O latency in samples |
Set the latency in samples. The AEC algorithm may compensate for latency by delaying the reference signal by this amount. It's very important not to overestimate the latency. The adaptive filter can't function if the reference is delayed so much that the echo occurs before the corresponding reference signal. It's better to underestimate the latency and allow leading zeros in the AEC response.
1.7.5.1