Sound Design Toolkit 075 Physically informed sound synthesis for everyday sounds

- Main Page
- Modules
- Data Structures
- Files

Typedefs | Functions
Spectral audio descriptors
SDTAnalysis.h: Sound analysis tools

## Typedefs
typedef struct SDTSpectralFeats | SDTSpectralFeats
| Opaque data structure for a spectral features extractor.

## Functions
SDTSpectralFeats * | SDTSpectralFeats_new (unsigned int size)
| Instantiates a spectral features extractor. More...
void | SDTSpectralFeats_free (SDTSpectralFeats *x)
| Destroys a spectral features extractor. More...
void | SDTSpectralFeats_setOverlap (SDTSpectralFeats *x, double f)
| Sets the analysis window overlapping ratio. Accepted values go from 0.0 to 1.0, with 0.0 meaning no overlap and 1.0 meaning total overlap. More...
void | SDTSpectralFeats_setMinFreq (SDTSpectralFeats *x, double f)
| Sets the lower frequency bound for spectral analysis. Spectral bins below this frequency are ignored in the audio descriptors computation. More...
void | SDTSpectralFeats_setMaxFreq (SDTSpectralFeats *x, double f)
| Sets the upper frequency bound for spectral analysis. Spectral bins above this frequency are ignored in the audio descriptors computation. More...
int | SDTSpectralFeats_dsp (SDTSpectralFeats *x, double *outs, double in)
| Signal processing routine. Call this function for each sample to perform signal analysis. More...

## Detailed Description

Spectral features extractor: statistical moments (centroid, spread, skewness, kurtosis), spectral flatness, spectral flux and an onset detection function based on rectified, whitened spectral flux.

## Function Documentation

int SDTSpectralFeats_dsp | ( | SDTSpectralFeats * | x,
|  | double * | outs,
|  | double | in
| ) |  |

Signal processing routine. Call this function for each sample to perform signal analysis.

Parameters

  [in] | x | Pointer to the instance
  [out] | outs | Pointer to an array of seven doubles, containing the algorithm outputs. Array members represent the following information respectively: Spectral centroid, Spectral spread, Spectral skewness, Spectral kurtosis, Spectral flatness, Spectral flux, Onset detection function (rectified and whitened spectral flux).
  [in] | in | Input sample

Returns
  1 if output available (analysis window full), 0 otherwise

void SDTSpectralFeats_free | ( | SDTSpectralFeats * | x | ) |

Destroys a spectral features extractor.

Parameters

  [in] | x | Pointer to the instance to destroy

SDTSpectralFeats* SDTSpectralFeats_new | ( | unsigned int | size | ) |

Instantiates a spectral features extractor.

Parameters

  [in] | size | Size of the analysis window, in samples

Returns
  Pointer to the new instance

void SDTSpectralFeats_setMaxFreq | ( | SDTSpectralFeats * | x,
|  | double | f
| ) |  |

Sets the upper frequency bound for spectral analysis. Spectral bins above this frequency are ignored in the audio descriptors computation.

Parameters

  [in] | x | Pointer to the instance
  [in] | f | Maximum analyzed frequency, in Hz

void SDTSpectralFeats_setMinFreq | ( | SDTSpectralFeats * | x,
|  | double | f
| ) |  |

Sets the lower frequency bound for spectral analysis. Spectral bins below this frequency are ignored in the audio descriptors computation.

Parameters

  [in] | x | Pointer to the instance
  [in] | f | Minimum analyzed frequency, in Hz

void SDTSpectralFeats_setOverlap | ( | SDTSpectralFeats * | x,
|  | double | f
| ) |  |

Sets the analysis window overlapping ratio. Accepted values go from 0.0 to 1.0, with 0.0 meaning no overlap and 1.0 meaning total overlap.

Parameters

  [in] | x | Pointer to the instance
  [in] | f | Overlap ratio [0.0, 1.0]