gtkIOStream  1.6.0
GTK+ << C++ IOStream operators for GTK+. Now with ORBing, numerical computation, audio client and more ...
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
AudioMasker Class Reference

#include <AudioMasker.H>

Inheritance diagram for AudioMasker:
[legend]
Collaboration diagram for AudioMasker:
[legend]

Public Member Functions

 AudioMasker (int sampFreq, int fBankCount)
 
 AudioMasker (void)
 Audio masker constructor - allowing specification of fs and sub-band count later. More...
 
 ~AudioMasker (void)
 Audio masker deconstructor. More...
 
void excite (short int *Input, int sCount)
 
void excite (double *Input, int sCount)
 
template<typename Derived >
int excite (const Eigen::DenseBase< Derived > &Input)
 
double findThreshold (double freq)
 
int getBankCount (void)
 
- Public Member Functions inherited from AudioMask
 AudioMask (int sampFreq, int fBankCount)
 
 ~AudioMask (void)
 Deconstructor. More...
 
void setCFreq (int which, double value)
 
void exciteTerhardt (double **filterBankOutput, int sampleCount)
 
void exciteBeerends (double **filterBankOutput, int sampleCount)
 

Public Attributes

DepUKFBpfb
 roex filters More...
 
- Public Attributes inherited from AudioMask
double * mask
 The audio mask. More...
 
double max
 The maximum value of the mask. More...
 

Private Member Functions

void FBDeMalloc (void)
 Filter bank output matrix memory de-allocation. More...
 
void FBMalloc (void)
 Filter bank output matrix memory allocation. More...
 
void process (void)
 Process the transformation. More...
 

Private Attributes

double ** output
 Filter bank output. More...
 
double ** powOutput
 Filter bank output power. More...
 
double * input
 Filter bank input. More...
 
int sampleCount
 The sample count. More...
 
int bankCount
 The filter bank count. More...
 
RealFFTDatafftData
 The FFT data. More...
 
RealFFTfft
 The FFT. More...
 

Additional Inherited Members

- Protected Attributes inherited from AudioMask
int fs
 Sample frequency. More...
 

Detailed Description

libAudioMask - Simultaneous audio mask threshold estimation library

masking.example.jpg

This code also implements the roex auditory filters.

Please read the article located on the debian file system file:///usr/shar/doc/libaudiomask-1.0/Flax.2000.Improved.Auditory.Masking.Models.pdf

It may also be found on the web http://www.assta.org/sst/SST-00/cache/SST-00-Chapter9-p2.pdf

This example shows how to use the hybrid simultaneous audio masking class to find the masking threshold of a time domain signal.

========================= HOWTO =============================== See the AudioMaskerExample.C example for a more detailed scenario.

// First find the masking threshold
AudioMasker masker(sampleFreq, count); // Create the audio masker class using fs=sampleFreq and count filters
masker.excite(input, sampleCount); // find the mask for the array of input data which has sampleCount time samples.
// Now do something with the masking threshold ...
// The frequency domain mask is now located here
for (int j=0; j<count;j++)
masker.mask[j]; // This is the mask at each of the count frequencies of interest
// A more sophisticated example - find the threshold for each Fourier bin
double fact=(double)sampleFreq/((double)sampleCount-1.0); // convert from an index to the equivalent * Fourier bin frequency
for (int j=0; j<halfSampleCount;j++){
cout<<"finding for freq "<<j*fact<<'\t'; // The frequency we are inspecting
double threshold=masker.findThreshold(j*fact); // The masking threshold
20*log10(threshold); // The threshold in decibels (dB)
}
Examples:
AudioMaskerExample.C.

Definition at line 100 of file AudioMasker.H.

Constructor & Destructor Documentation

AudioMasker::AudioMasker ( int  sampFreq,
int  fBankCount 
)

The Audio masking constructor @ sampFreq The sample frequency of the time domain data @ fBankCount The number of filter banks

Definition at line 30 of file AudioMasker.C.

Here is the call graph for this function:

AudioMasker::AudioMasker ( void  )

Audio masker constructor - allowing specification of fs and sub-band count later.

Definition at line 46 of file AudioMasker.C.

Here is the call graph for this function:

AudioMasker::~AudioMasker ( void  )

Audio masker deconstructor.

Definition at line 62 of file AudioMasker.C.

Here is the call graph for this function:

Member Function Documentation

void AudioMasker::excite ( short int *  Input,
int  sCount 
)

Finds the excitation for input data @ Input Using short int input data @ sCount samples

These should be implemented differently for different Input types

Examples:
AudioMaskerExample.C.

Definition at line 171 of file AudioMasker.C.

Here is the call graph for this function:

Here is the caller graph for this function:

void AudioMasker::excite ( double *  Input,
int  sCount 
)

Finds the excitation for input data @ Input Using double input data @ sCount samples

Definition at line 187 of file AudioMasker.C.

Here is the call graph for this function:

template<typename Derived >
int AudioMasker::excite ( const Eigen::DenseBase< Derived > &  Input)
inline

Finds the excitation for input data. @ Input The data in the form of an Eigen column.

Returns
NO_ERROR on success, or the appropriate error otherwise.

Definition at line 148 of file AudioMasker.H.

Here is the call graph for this function:

void AudioMasker::FBDeMalloc ( void  )
private

Filter bank output matrix memory de-allocation.

Definition at line 69 of file AudioMasker.C.

Here is the caller graph for this function:

void AudioMasker::FBMalloc ( void  )
private

Filter bank output matrix memory allocation.

Definition at line 102 of file AudioMasker.C.

Here is the call graph for this function:

Here is the caller graph for this function:

double AudioMasker::findThreshold ( double  freq)

Returns the simultaneous masking threshold at a particular frequency @ freq The frequency of interest

Examples:
AudioMaskerExample.C.

Definition at line 203 of file AudioMasker.C.

int AudioMasker::getBankCount ( void  )
inline
Returns
The number of auditoy filters in use.

Definition at line 177 of file AudioMasker.H.

void AudioMasker::process ( void  )
private

Process the transformation.

Definition at line 217 of file AudioMasker.C.

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

int AudioMasker::bankCount
private

The filter bank count.

Definition at line 105 of file AudioMasker.H.

RealFFT* AudioMasker::fft
private

The FFT.

Definition at line 108 of file AudioMasker.H.

RealFFTData* AudioMasker::fftData
private

The FFT data.

Definition at line 107 of file AudioMasker.H.

double* AudioMasker::input
private

Filter bank input.

Definition at line 103 of file AudioMasker.H.

double** AudioMasker::output
private

Filter bank output.

Definition at line 101 of file AudioMasker.H.

DepUKFB* AudioMasker::pfb

roex filters

Definition at line 116 of file AudioMasker.H.

double** AudioMasker::powOutput
private

Filter bank output power.

Definition at line 102 of file AudioMasker.H.

int AudioMasker::sampleCount
private

The sample count.

Definition at line 104 of file AudioMasker.H.


The documentation for this class was generated from the following files:
gtkIOStream: AudioMasker Class Reference
GTK+ IOStream  Beta
GTK+ << C++ IOStream operators for GTK+. Now with extra abilities ... like ORBing, numerical computation, audio clients and more...