arduino-audio-tools
Loading...
Searching...
No Matches
ChannelBinDiffT< T > Class Template Reference

We first bin the channels then we calculate the difference between pairs of channels in a datastream. E.g. For binning, if we bin 4 samples in each channel we will have 4 times less samples per channel E.g. For subtracting if we have 4 channels we end up with 2 channels. The channels will be channel_1 - channel_2 channel_3 - channel_4 This is the same as combining binning and subtracting channels. This will not work if you provide single channel data! More...

#include <CodecOpusOgg.h>

Inheritance diagram for ChannelBinDiffT< T >:
BaseConverter BaseConverter

Public Member Functions

 ChannelBinDiffT ()=default
 ChannelBinDiffT ()=default
 ChannelBinDiffT (int binSize, int channels, bool average)
 ChannelBinDiffT (int binSize, int channels, bool average)
 ~ChannelBinDiffT ()
 ~ChannelBinDiffT ()
void clear ()
void clear ()
size_t convert (uint8_t *src, size_t size)
size_t convert (uint8_t *src, size_t size)
size_t convert (uint8_t *target, uint8_t *src, size_t size)
size_t convert (uint8_t *target, uint8_t *src, size_t size)
void reset ()
void reset ()
void setAverage (bool average)
void setAverage (bool average)
void setBinSize (int binSize)
void setBinSize (int binSize)
void setChannels (int channels)
void setChannels (int channels)

Protected Types

using SumT = typename AppropriateSumType<T>::type
using SumT = typename AppropriateSumType<T>::type

Protected Member Functions

bool isConfigValid ()
bool isConfigValid ()
void resetState ()
void resetState ()
void resizeState ()
void resizeState ()

Protected Attributes

bool average = true
int binSize = 4
int channels = 2
SumT * partialBin = nullptr
int partialBinSize = 0

Detailed Description

template<typename T = int16_t>
class audio_tools::audio_tools::ChannelBinDiffT< T >

We first bin the channels then we calculate the difference between pairs of channels in a datastream. E.g. For binning, if we bin 4 samples in each channel we will have 4 times less samples per channel E.g. For subtracting if we have 4 channels we end up with 2 channels. The channels will be channel_1 - channel_2 channel_3 - channel_4 This is the same as combining binning and subtracting channels. This will not work if you provide single channel data!

Author
Urs Utzinger
Template Parameters
T

Member Typedef Documentation

◆ SumT [1/2]

template<typename T = int16_t>
using SumT = typename AppropriateSumType<T>::type
protected

◆ SumT [2/2]

template<typename T = int16_t>
using SumT = typename AppropriateSumType<T>::type
protected

Constructor & Destructor Documentation

◆ ChannelBinDiffT() [1/4]

template<typename T = int16_t>
ChannelBinDiffT ( )
default

◆ ChannelBinDiffT() [2/4]

template<typename T = int16_t>
ChannelBinDiffT ( int binSize,
int channels,
bool average )
inline

◆ ~ChannelBinDiffT() [1/2]

template<typename T = int16_t>
~ChannelBinDiffT ( )
inline

◆ ChannelBinDiffT() [3/4]

template<typename T = int16_t>
ChannelBinDiffT ( )
default

◆ ChannelBinDiffT() [4/4]

template<typename T = int16_t>
ChannelBinDiffT ( int binSize,
int channels,
bool average )
inline

◆ ~ChannelBinDiffT() [2/2]

template<typename T = int16_t>
~ChannelBinDiffT ( )
inline

Member Function Documentation

◆ clear() [1/2]

template<typename T = int16_t>
void clear ( )
inline

◆ clear() [2/2]

template<typename T = int16_t>
void clear ( )
inline

◆ convert() [1/4]

template<typename T = int16_t>
size_t convert ( uint8_t * src,
size_t size )
inlinevirtual

Implements BaseConverter.

◆ convert() [2/4]

template<typename T = int16_t>
size_t convert ( uint8_t * src,
size_t size )
inlinevirtual

Implements BaseConverter.

◆ convert() [3/4]

template<typename T = int16_t>
size_t convert ( uint8_t * target,
uint8_t * src,
size_t size )
inline

◆ convert() [4/4]

template<typename T = int16_t>
size_t convert ( uint8_t * target,
uint8_t * src,
size_t size )
inline

◆ isConfigValid() [1/2]

template<typename T = int16_t>
bool isConfigValid ( )
inlineprotected

◆ isConfigValid() [2/2]

template<typename T = int16_t>
bool isConfigValid ( )
inlineprotected

◆ reset() [1/2]

template<typename T = int16_t>
void reset ( )
inline

◆ reset() [2/2]

template<typename T = int16_t>
void reset ( )
inline

◆ resetState() [1/2]

template<typename T = int16_t>
void resetState ( )
inlineprotected

◆ resetState() [2/2]

template<typename T = int16_t>
void resetState ( )
inlineprotected

◆ resizeState() [1/2]

template<typename T = int16_t>
void resizeState ( )
inlineprotected

◆ resizeState() [2/2]

template<typename T = int16_t>
void resizeState ( )
inlineprotected

◆ setAverage() [1/2]

template<typename T = int16_t>
void setAverage ( bool average)
inline

◆ setAverage() [2/2]

template<typename T = int16_t>
void setAverage ( bool average)
inline

◆ setBinSize() [1/2]

template<typename T = int16_t>
void setBinSize ( int binSize)
inline

◆ setBinSize() [2/2]

template<typename T = int16_t>
void setBinSize ( int binSize)
inline

◆ setChannels() [1/2]

template<typename T = int16_t>
void setChannels ( int channels)
inline

◆ setChannels() [2/2]

template<typename T = int16_t>
void setChannels ( int channels)
inline

Member Data Documentation

◆ average

template<typename T = int16_t>
bool average = true
protected

◆ binSize

template<typename T = int16_t>
int binSize = 4
protected

◆ channels

template<typename T = int16_t>
int channels = 2
protected

◆ partialBin

template<typename T = int16_t>
SumT * partialBin = nullptr
protected

◆ partialBinSize

template<typename T = int16_t>
int partialBinSize = 0
protected

The documentation for this class was generated from the following files: