arduino-audio-tools
Loading...
Searching...
No Matches
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Decimate Class Reference

Provides a reduced sampling rate by taking a sample at every factor location (ingoring factor-1 samples) More...

#include <BaseConverter.h>

Inheritance diagram for Decimate:
BaseConverter

Classes

struct  DecimateState
 
struct  DecimateStateT
 

Public Member Functions

 Decimate ()=default
 
 Decimate (int factor, int channels, int bits_per_sample)
 
 ~Decimate () override
 
void clear ()
 
size_t convert (uint8_t *src, size_t size)
 
size_t convert (uint8_t *target, uint8_t *src, size_t size)
 
 operator bool ()
 
void reset ()
 
void setBits (int bits)
 
void setChannels (int channels)
 Defines the number of channels.
 
void setFactor (int factor)
 Sets the factor: e.g. with 4 we keep every forth sample.
 

Protected Member Functions

bool isConfigValid ()
 
void resetState ()
 

Protected Attributes

int bits = 16
 
int channels = 2
 
int factor = 1
 
DecimateStatestate = nullptr
 

Detailed Description

Provides a reduced sampling rate by taking a sample at every factor location (ingoring factor-1 samples)

Constructor & Destructor Documentation

◆ Decimate() [1/2]

Decimate ( )
default

◆ Decimate() [2/2]

Decimate ( int  factor,
int  channels,
int  bits_per_sample 
)
inline

◆ ~Decimate()

~Decimate ( )
inlineoverride

Member Function Documentation

◆ clear()

void clear ( )
inline

◆ convert() [1/2]

size_t convert ( uint8_t src,
size_t  size 
)
inlinevirtual

Implements BaseConverter.

◆ convert() [2/2]

size_t convert ( uint8_t target,
uint8_t src,
size_t  size 
)
inline

◆ isConfigValid()

bool isConfigValid ( )
inlineprotected

◆ operator bool()

operator bool ( )
inline

◆ reset()

void reset ( )
inline

◆ resetState()

void resetState ( )
inlineprotected

◆ setBits()

void setBits ( int  bits)
inline

◆ setChannels()

void setChannels ( int  channels)
inline

Defines the number of channels.

◆ setFactor()

void setFactor ( int  factor)
inline

Sets the factor: e.g. with 4 we keep every forth sample.

Member Data Documentation

◆ bits

int bits = 16
protected

◆ channels

int channels = 2
protected

◆ factor

int factor = 1
protected

◆ state

DecimateState* state = nullptr
protected

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