|
arduino-audio-tools
|
3 Band Equalizer with identical settings for all channels More...
#include <Equalizer3Bands.h>
Classes | |
| struct | EQSTATE |
| Filter state for each channel. More... | |
Protected Member Functions | |
| void | filterSamples (const uint8_t *data, size_t len) |
| virtual int | not_supported (int out, const char *msg="") |
| void | notifyAudioChange (AudioInfo info) |
| void | refillReadBuffer () |
| Refill small read buffer (e.g. 8 bytes) to avoid single byte reads when calling read() | |
| float | sample (EQSTATE &es, float sample) |
Protected Attributes | |
| int | _timeout = 10 |
| ConfigEqualizer3Bands | cfg |
| Default configuration instance. | |
| AudioInfo | info |
| bool | is_active = false |
| Indicates if the equalizer is active. | |
| bool | is_notify_active = true |
| int | max_state_count = 0 |
| Maximum number of allocated channel states. | |
| Vector< AudioInfoSupport * > | notify_vector |
| ConfigEqualizer3Bands * | p_cfg = &cfg |
| Pointer to active configuration. | |
| Print * | p_print = nullptr |
| Output stream for write operations. | |
| Stream * | p_stream = nullptr |
| Input/output stream for read operations. | |
| struct audio_tools::Equalizer3Bands::EQSTATE * | state = nullptr |
| RingBuffer< uint8_t > | tmp_in {0} |
| RingBuffer< uint8_t > | tmp_out {0} |
| const float | vsa |
| Very small amount for denormal fix. | |
| int | write_buffer_size = MAX_SINGLE_CHARS |
3 Band Equalizer with identical settings for all channels
Digital 3-band equalizer implementation inspired from https://www.musicdsp.org/en/latest/Filters/236-3-band-equaliser.html
This equalizer applies the same frequency response and gain settings to all audio channels. The audio spectrum is divided into three bands:
Each band uses a 4-pole filter implementation for smooth frequency response. If you need different settings per channel, use Equalizer3BandsPerChannel instead.
After calling begin() you can update the gain parameters of the ConfigEqualizer3Bands directly w/o calling any other methods. If you change the freq. parameters, you need to call begin() again.
|
inline |
|
inline |
|
inline |
Constructor with AudioOutput (includes automatic audio format notifications)
| out | AudioOutput where processed audio will be written |
|
inline |
Constructor with AudioStream (includes automatic audio format notifications)
| stream | AudioStream for both input and output |
|
inline |
|
inlinevirtualinherited |
Adds target to be notified about audio changes.
Reimplemented in CodecNOP, EncodedAudioOutput, EncodedAudioStream, AACDecoderFDK, DecoderBasic, CodecChain, MP3DecoderHelix, MP3DecoderMAD, OggContainerDecoder, RTSPClient< TcpClient, UdpSocket >, Pipeline, and Pipeline::ModifyingStreamAdapter.
provides the actual input AudioInfo
Implements AudioInfoSupport.
Reimplemented in JupyterAudioT< T >, MozziStream, TimerCallbackAudioStream, EncodedAudioStream, PureDataStream, AdapterAudioOutputToAudioStream, GeneratedSoundStream< T >, GeneratedSoundStream< int16_t >, and InputMerge< T >.
provides the actual output AudioInfo: this is usually the same as audioInfo() unless we use a transforming stream
Reimplemented in PureDataStream, PWMAudioOutput, ChannelFormatConverterStreamT< T >, ChannelFormatConverterStream, NumberFormatConverterStreamT< TFrom, TTo >, NumberFormatConverterStream, FormatConverterStream, Pipeline, ResampleStream, and ResampleStreamT< TInterpolator >.
|
inlineoverridevirtual |
Get available data for reading
Reimplemented from BaseStream.
|
inlineoverridevirtual |
Get available space for writing
Reimplemented from BaseStream.
|
inlinevirtual |
Reimplemented from BaseStream.
|
inline |
Initialize the equalizer with the provided configuration
| config | Configuration settings including frequencies and gains |
Deletes all change notify subscriptions.
Reimplemented in RTSPClient< TcpClient, UdpSocket >.
|
inline |
Access to the current configuration
|
inline |
Access to the default configuration
|
inlinevirtual |
Reimplemented from BaseStream.
Apply 3-band equalization to audio samples
| data | Pointer to audio data buffer (modified in-place) |
| len | Length of data buffer in bytes |
Reimplemented from Print.
Reimplemented in PureDataStream, URLStreamBufferedT< T >, URLStreamBufferedT< ICYStream >, ReformatBaseStream, AudioStreamWrapper, ResampleStream, EncodedAudioStream, URLStream, BufferedTaskStream, I2SStream, MemoryStream, RingBufferStream, GeneratedSoundStream< T >, GeneratedSoundStream< int16_t >, and BufferedStream.
Read and process audio data through the equalizer
| data | Buffer to store processed audio data |
| len | Maximum number of bytes to read |
Reimplemented from AudioStream.
Source to generate silence: just sets the buffer to 0.
|
inlineprotectedinherited |
Refill small read buffer (e.g. 8 bytes) to avoid single byte reads when calling read()
|
inlinevirtualinherited |
Removes a target in order not to be notified about audio changes.
Reimplemented in RTSPClient< TcpClient, UdpSocket >.
Process a single audio sample through the 3-band equalizer
| es | Reference to the filter state for this channel |
| sample | Input sample value (normalized float) |
Called automatically when audio format changes
| info | New audio format information |
Reimplemented from AudioStream.
Deactivate/Reactivate automatic AudioInfo updates: (default is active)
Defines/Changes the output target
| out | Print stream where processed audio will be written |
Implements ModifyingStream.
Defines/Changes the input & output stream
| io | Stream to use for both reading and writing audio data |
Implements ModifyingStream.
Process and write audio data through the equalizer
| data | Pointer to audio data buffer |
| len | Length of data in bytes |
Reimplemented from AudioStream.
Reimplemented in MemoryStream, AudioStreamWrapper, BufferedTaskStream, RingBufferStream, BufferedStream, and URLStream.
|
protectedinherited |
|
protected |
Default configuration instance.
|
protectedinherited |
|
protected |
Maximum number of allocated channel states.
|
protectedinherited |
|
protected |
Pointer to active configuration.
|
protected |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |