AuxPort 0.2
Modules for Audio Software Development
Loading...
Searching...
No Matches
AuxPort::Utility Class Reference

This class provides interfaces (Static Functions) for stuff that are easy to implement but still require you to write code for it. More...

#include <AuxUtility.h>

Static Public Member Functions

static uint32 numberOfDigits (int32 number)
 Calculates the number of digits present in an integer.

 
static float dBToLinear (float val)
 Converts decibels (dB) to single-precision float

 
static double dBToLinear (double val)
 Converts decibels (dB) to double-precision float.
 
static float linearTodB (float val)
 Converts single-precision float to decibels (dB)
 
static double linearTodB (double val)
 Converts double-precision float to decibels (dB)

 
template<class sample >
static void zeroThis (std::vector< sample > &audio)
 Fill a standard vector with zeros

 
template<class sample >
static sample signum (const sample &audio)
 Evaluates the Signum function.
 
template<class sample >
static sample round (const sample &audio)
 Rounds a number to the nearest integer

 
template<class range >
static range remap (range input, range outputStart, range outputEnd, range inputStart, range inputEnd)
 Remaps a input in a particular range to another range.
 
template<class sample >
static sample mean (const std::vector< sample > &vector)
 Computes the mean for a vector

 
template<class sample >
static sample median (std::vector< sample > vector)
 Computes the median for a vector [Time Complexity : O(Nlog2(n)), Memory Complexity : O(N)]

 
template<class sample >
static void norm (std::vector< sample > &vec, float norm)
 Normalizes a vector with a val.

 
template<class sample >
static sample abssum (const std::vector< sample > &vec)
 Computes absolute sum of a std::vector.
 
template<class sample >
static std::vector< sample > generateRandomValues (size_t size, float rangeStart=-1.0, float rangeEnd=1.0)
 Returns a std::vector with Random Values between a range.
 
template<class sample >
static void generateRandomValues (std::vector< sample > &vector, float rangeStart=-1.0, float rangeEnd=1.0)
 Fills a memory allocated std::vector with random values.
 
template<class sample >
static sample getMax (const std::vector< sample > &vector)
 Computes the max element in an std::vector

 
template<class sample >
static void divide (std::vector< sample > &vector, sample value)
 Dot-Divide operation over a std::vector.
 
template<class sample >
static void multiply (std::vector< sample > &vector, sample value)
 Dot-Divide operation over a std::vector.
 
template<class sample >
static void multiply (std::vector< sample > &vector1, const std::vector< sample > &vector2)
 Dot-Divide operation over a std::vector.
 
template<class sample >
static sample sinc (sample val)
 Sinc(x) = sin(pi*x)/pi*x (Normalized Sinc Function)
 
template<class sample >
static void constantThis (std::vector< sample > &vec, sample val)
 Fills up all the elements of the given vector with the given value.
 
static void split (std::vector< std::string > &tokens, const std::string &str, const char &delimiter)
 Splits the given string in a vector of tokens based on the given delimiter.
 
static void join (std::string &str, const std::vector< std::string > &tokens, const char &delimiter)
 Joins the given vector of tokens using the given delimiter to form a string.
 

Detailed Description

This class provides interfaces (Static Functions) for stuff that are easy to implement but still require you to write code for it.

Definition at line 56 of file AuxUtility.h.

Member Function Documentation

◆ abssum()

template<class sample >
static sample AuxPort::Utility::abssum ( const std::vector< sample > & vec)
inlinestatic

Computes absolute sum of a std::vector.

Definition at line 188 of file AuxUtility.h.

◆ constantThis()

template<class sample >
static void AuxPort::Utility::constantThis ( std::vector< sample > & vec,
sample val )
inlinestatic

Fills up all the elements of the given vector with the given value.

Definition at line 289 of file AuxUtility.h.

◆ dBToLinear() [1/2]

static double AuxPort::Utility::dBToLinear ( double val)
inlinestatic

Converts decibels (dB) to double-precision float.

Definition at line 91 of file AuxUtility.h.

◆ dBToLinear() [2/2]

static float AuxPort::Utility::dBToLinear ( float val)
inlinestatic

Converts decibels (dB) to single-precision float

Definition at line 83 of file AuxUtility.h.

◆ divide()

template<class sample >
static void AuxPort::Utility::divide ( std::vector< sample > & vector,
sample value )
inlinestatic

Dot-Divide operation over a std::vector.

Definition at line 248 of file AuxUtility.h.

◆ generateRandomValues() [1/2]

template<class sample >
static std::vector< sample > AuxPort::Utility::generateRandomValues ( size_t size,
float rangeStart = -1.0,
float rangeEnd = 1.0 )
inlinestatic

Returns a std::vector with Random Values between a range.

Definition at line 201 of file AuxUtility.h.

◆ generateRandomValues() [2/2]

template<class sample >
static void AuxPort::Utility::generateRandomValues ( std::vector< sample > & vector,
float rangeStart = -1.0,
float rangeEnd = 1.0 )
inlinestatic

Fills a memory allocated std::vector with random values.

Definition at line 218 of file AuxUtility.h.

◆ getMax()

template<class sample >
static sample AuxPort::Utility::getMax ( const std::vector< sample > & vector)
inlinestatic

Computes the max element in an std::vector

Definition at line 233 of file AuxUtility.h.

◆ join()

static void AuxPort::Utility::join ( std::string & str,
const std::vector< std::string > & tokens,
const char & delimiter )
inlinestatic

Joins the given vector of tokens using the given delimiter to form a string.

Definition at line 312 of file AuxUtility.h.

◆ linearTodB() [1/2]

static double AuxPort::Utility::linearTodB ( double val)
inlinestatic

Converts double-precision float to decibels (dB)

Definition at line 107 of file AuxUtility.h.

◆ linearTodB() [2/2]

static float AuxPort::Utility::linearTodB ( float val)
inlinestatic

Converts single-precision float to decibels (dB)

Definition at line 99 of file AuxUtility.h.

◆ mean()

template<class sample >
static sample AuxPort::Utility::mean ( const std::vector< sample > & vector)
inlinestatic

Computes the mean for a vector

Definition at line 154 of file AuxUtility.h.

◆ median()

template<class sample >
static sample AuxPort::Utility::median ( std::vector< sample > vector)
inlinestatic

Computes the median for a vector [Time Complexity : O(Nlog2(n)), Memory Complexity : O(N)]

Definition at line 167 of file AuxUtility.h.

◆ multiply() [1/2]

template<class sample >
static void AuxPort::Utility::multiply ( std::vector< sample > & vector,
sample value )
inlinestatic

Dot-Divide operation over a std::vector.

Definition at line 259 of file AuxUtility.h.

◆ multiply() [2/2]

template<class sample >
static void AuxPort::Utility::multiply ( std::vector< sample > & vector1,
const std::vector< sample > & vector2 )
inlinestatic

Dot-Divide operation over a std::vector.

Definition at line 269 of file AuxUtility.h.

◆ norm()

template<class sample >
static void AuxPort::Utility::norm ( std::vector< sample > & vec,
float norm )
inlinestatic

Normalizes a vector with a val.

Definition at line 177 of file AuxUtility.h.

◆ numberOfDigits()

static uint32 AuxPort::Utility::numberOfDigits ( int32 number)
inlinestatic

Calculates the number of digits present in an integer.

Definition at line 73 of file AuxUtility.h.

◆ remap()

template<class range >
static range AuxPort::Utility::remap ( range input,
range outputStart,
range outputEnd,
range inputStart,
range inputEnd )
inlinestatic

Remaps a input in a particular range to another range.

Definition at line 144 of file AuxUtility.h.

◆ round()

template<class sample >
static sample AuxPort::Utility::round ( const sample & audio)
inlinestatic

Rounds a number to the nearest integer

Definition at line 135 of file AuxUtility.h.

◆ signum()

template<class sample >
static sample AuxPort::Utility::signum ( const sample & audio)
inlinestatic

Evaluates the Signum function.

Definition at line 126 of file AuxUtility.h.

◆ sinc()

template<class sample >
static sample AuxPort::Utility::sinc ( sample val)
inlinestatic

Sinc(x) = sin(pi*x)/pi*x (Normalized Sinc Function)

Definition at line 280 of file AuxUtility.h.

◆ split()

static void AuxPort::Utility::split ( std::vector< std::string > & tokens,
const std::string & str,
const char & delimiter )
inlinestatic

Splits the given string in a vector of tokens based on the given delimiter.

Definition at line 298 of file AuxUtility.h.

◆ zeroThis()

template<class sample >
static void AuxPort::Utility::zeroThis ( std::vector< sample > & audio)
inlinestatic

Fill a standard vector with zeros

Definition at line 116 of file AuxUtility.h.


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