/  Unit Analyzers

UAna

UAnaBlob

Centroid

Chroma

Flux

Kurtosis

MFCC

RMS

RollOff

SFM

ZeroX

AutoCorr

DCT

FeatureCollector

FFT

Flip

IDCT

IFFT

UnFlip

XCorr

Windowing

Unit analyzer (UAna) objects are specialized UGens that can perform audio analysis and pass analysis information to other UAnae. (See also: AI Tools API reference.)

UAna

inherits : UGen : Object

Base class from which all unit analyzer (UAna) types inherit; UAnae (note plural form) can be interconnected using => (chuck operator for synthesis; all UAnae are also UGens) or using =^ (upchuck operator for analysis) -- the operator used will determine how data is passed. When .upchuck() is invoked on a given UAna, the UAna-chain (i.e., UAnae connected via =^) is traversed upstream from the upchucked UAna, and analysis is performed at each UAna along the chain; the analysis results are returned in UAnaBlobs.

constructors

UAna()

Default constructor for UAna.

member functions

complex cval(int index)

Get blob's complex value at index.

complex[] cvals()

Get blob's complex array.

float fval(int index)

Get blob's float value at index.

float[] fvals()

Get blob's float array.

int isUpConnectedTo(UAna right)

Is connected to another uana via =^?

UAnaBlob upchuck()

Initiate analysis at the UAna and return result.


UAnaBlob

inherits : Object

A data structure that contains results associated with UAna analysis. There is a UAnaBlob associated with every UAna. As a UAna is upchucked (using .upchuck()), the result is stored in the UAnaBlob's floating point vector and/or complex vector. The interpretation of the results depends on the specific UAna.

constructors

UAnaBlob()

Default constructor for UAnaBlob.

member functions

complex cval(int index)

Get blob's complex value at index.

complex[] cvals()

Get blob's complex array.

float fval(int index)

Get blob's float value at index.

float[] fvals()

Get blob's float array.

time when()

Get the time when blob was last upchucked.

member variables

complex[] m_cvals

No description available

float[] m_fvals

No description available

time m_when

No description available


Centroid

inherits : UAna : UGen : Object

A unit analyzer that computes the spectral centroid from a magnitude spectrum (either from incoming UAna or manually given), and outputs a single number.

examples

constructors

Centroid()

Default constructor for Centroid.

static member functions

float compute(float[] input)

Manually computes the centroid from a float array.


Chroma

inherits : UAna : UGen : Object

A unit analyzer that computes the Chroma features from a magnitude spectrum (either from an incoming UAna, or given manually), and outputs a vector of coefficients.

examples

constructors

Chroma()

Default constructor for Chroma.

member functions

float compute(float[] input, float[] output)

Manually computes the Chroma of the input (an FFT spectrum), and stores the results in the output array (Chroma coefficients).

int highOctNum(int high_oct_num)

Set the highest octave number for Chroma analysis.

int highOctNum()

Get the highest octave number for Chroma analysis.

int lowOctNum(int low_oct_num)

Set the lowest octave number for Chroma analysis.

int lowOctNum()

Get the lowest octave number for Chroma analysis.

float sampleRate(float sample_rate)

Set the sample rate for Chroma analysis.

float sampleRate()

Get the sample rate for Chroma analysis.


Flux

inherits : UAna : UGen : Object

A unit analyzer that computes the spectral flux between successive magnitude spectra (via incoming UAna, or given manually), and outputs a single number.

examples

constructors

Flux()

Default constructor for Flux.

member functions

void reset()

Reset the extractor.

static member functions

float compute(float[] lhs, float[] rhs)

Manually computes the flux between two frames.

float compute(float[] lhs, float[] rhs, float[] diff)

Manually computes the flux between two frames, and stores the difference in a third array.


Kurtosis

inherits : UAna : UGen : Object

A unit analyzer that computes the kurtosis of a given input array, and outputs a single number.

examples

constructors

Kurtosis()

Default constructor for Kurtosis.

static member functions

float compute(float[] input)

Manually computes the kurtosis of a given input array.


MFCC

inherits : UAna : UGen : Object

A unit analyzer that computes Mel-frequency Cepstral Coefficients (MFCCs), and outputs a vector of coefficients.

examples

constructors

MFCC()

Default constructor for MFCC.

member functions

float compute(float[] input, float[] output)

Manually computes the MFCC of the input (an FFT spectrum), and stores the results in the output array (MFCC coefficients).

int numCoeffs(int n)

Set the number of MFCC coefficients to compute.

int numCoeffs()

Get the number of MFCC coefficients to compute.

int numFilters(int n)

Set the number of linearly spaced filters in MEL space.

int numFilters()

Get the number of linearly spaced filters in MEL space.

int sampleRate(int sr)

Set the sample rate for MFCC analysis; NOTE: by default this is set to current ChucK sample rate.

int sampleRate()

Get the sample rate for MFCC analysis.


RMS

inherits : UAna : UGen : Object

A unit analyzer that computes the root-mean-square (RMS) power mean from a magnitude spectrum (either from an incoming UAna, or given manually), and outputs a single number.

examples

constructors

RMS()

Default constructor for RMS.

static member functions

float compute(float[] input)

Manually computes the RMS from a float array.


RollOff

inherits : UAna : UGen : Object

A unit analyzer that computes the spectral rolloff from a magnitude spectrum (either from incoming UAna, or given manually), and outputs a single number.

examples

constructors

RollOff()

Default constructor for RollOff.

member functions

float percent(float percent)

Set the percentage for computing rolloff.

float percent()

Get the percentage specified for the rolloff.

static member functions

float compute(float[] input, float percent)

Manually computes the rolloff from a float array.


SFM

inherits : UAna : UGen : Object

A unit analyzer that computes the Spectral Flatness Measure (SFM) from a magnitude spectrum (either from an incoming UAna, or given manually), and outputs a single number.

examples

constructors

SFM()

Default constructor for SFM.

member functions

float compute(float[] input, float[] output)

Manually computes the SFM of the input (an FFT spectrum), and stores the results in the output array (SFM coefficients).

int nrBands(int nr_bands)

Set the number of frequency bands to use for SFM analysis.

int nrBands()

Get the number of frequency bands to use for SFM analysis.


ZeroX

inherits : UAna : UGen : Object

Zero crossing detector.

examples

constructors

ZeroX()

Default constructor for ZeroX.

static member functions

float compute(float[] input)

Manually computes the zero crossing rate for an array.


AutoCorr

inherits : UAna : UGen : Object

A unit analyzer that computes auto-correlation of the incoming analysis frame.

examples

constructors

AutoCorr()

Default constructor for AutoCorr.

member functions

int normalize(int flag)

No description available

int normalize()

No description available

static member functions

float[] compute(float[] input, int normalize, float[] output)

No description available


DCT

inherits : UAna : UGen : Object

Computes the Discrete Cosine Transform on incoming audio samples, and outputs the result via its UAnaBlob as real values in the D.C. spectrum. A buffering mechanism maintains the previous DCT size # of samples, allowing DCT to be taken at any point in time, on demand (via .upchuck() or by upchucking a downstream UAna; see UAna documentation). The window size (along with an arbitrary window shape) is controlled via the .window method. The hop size is complete dynamic, and is throttled by how time is advanced.

examples

constructors

DCT()

Default constructor for DCT.

member functions

int size(int size)

Set the DCT size.

int size()

Get the DCT size.

void spectrum(float[] buffer)

Manually retrieve the results of a transform.

void transform(float[] from)

Manually take DCT (as opposed to using .upchuck() / upchuck operator).

float[] window(float[] win)

Set/get the transform window/size.

int windowSize()

Get the current window size.


FeatureCollector

inherits : UAna : UGen : Object

Turns UAna input into a single feature vector, upon .upchuck()

examples

constructors

FeatureCollector()

Default constructor for FeatureCollector.


FFT

inherits : UAna : UGen : Object

Computes the Fast Fourier Transform on incoming audio samples, and outputs the result via its UAnaBlob as both the complex spectrum and the magnitude spectrum. A buffering mechanism maintains the previous FFTsize # of samples, allowing FFT's to be taken at any point in time, on demand (via .upchuck() or by upchucking a downstream UAna. The window size (along with an arbitrary window shape) is controlled via the .window method. The hop size is complete dynamic, and is throttled by how time is advanced.

examples

constructors

FFT()

Default constructor for FFT.

member functions

int size(int size)

Set the FFT-size.

int size()

Get the FFT-size.

void spectrum(complex[] buffer)

Manually retrieve the results of a transform.

void transform(float[] from)

Manually take FFT (as opposed to using .upchuck() / upchuck operator)

float[] window(float[] win)

Set/get the transform window/size.

int windowSize()

Get the current window size.


Flip

inherits : UAna : UGen : Object

Turn N (size) audio samples into a Unit Analyzer audio analysis frame.

examples

constructors

Flip()

Default constructor for Flip.

member functions

void output(float[] buffer)

Manually take Flip (as opposed to using .upchuck() / upchuck operator)

int size(int size)

Set the Flip size.

int size()

Get the Flip size.

void transform(float[] from)

Manually take Flip (as opposed to using .upchuck() / upchuck operator).

float[] window(float[] win)

Set/get the transform window/size.

int windowSize()

Get the current window size.


IDCT

inherits : UAna : UGen : Object

Computes the inverse Discrete Cosine Transform on incoming spectral frames (on demand), and overlap-adds the results into its internal buffer, ready to be sent to other UGen's connected via =>. The window size (along with an arbitrary window shape) is controlled via the .window method.

constructors

IDCT()

Default constructor for IDCT.

member functions

void samples(float[] buffer)

Manually get result of previous IDCT.

int size(int size)

Set the IDCT size.

int size()

Get the IDCT size.

void transform(complex[] from)

Manually take IDCT (as opposed to using .upchuck() / upchuck operator).

float[] window(float[] win)

Set/get the transform window/size.

int windowSize()

Get the current window size.


IFFT

inherits : UAna : UGen : Object

Computes the inverse Fast Fourier Transform on incoming spectral frames (on demand), and overlap-adds the results into its internal buffer, ready to be sent to other UGen's connected via =>. The window size (along with an arbitrary window shape) is controlled via the .window method.

examples

constructors

IFFT()

Default constructor for IFFT.

member functions

void samples(float[] buffer)

Manually take IFFT (as opposed to using .upchuck() / upchuck operator)

int size(int size)

Set the IFFT-size.

int size()

Get the IFFT-size.

void transform(complex[] from)

Manually take IFFT (as opposed to using .upchuck() / upchuck operator)

float[] window(float[] win)

Set/get the transform window/size.

int windowSize()

Get the current window size.


UnFlip

inherits : UAna : UGen : Object

Turns UAna frames into audio samples, via overlap add.

examples

constructors

UnFlip()

Default constructor for UnFlip.

member functions

void output(float[] buffer)

Manually take pilF (as opposed to using .upchuck() / upchuck operator)

int size(int size)

Set the pilF size.

int size()

Get the pilF size.

void transform()

Manually take pilF (as opposed to using .upchuck() / upchuck operator).

float[] window(float[] win)

Set/get the transform window/size.

int windowSize()

Get the current window size.


XCorr

inherits : UAna : UGen : Object

A unit analyzer that computes cross-correlation between two incoming analysis frames.

examples

constructors

XCorr()

Default constructor for XCorr.

member functions

int normalize(int flag)

No description available

int normalize()

No description available

static member functions

float[] compute(float[] f, float[] g, int normalize, float[] y)

No description available


Windowing

inherits : Object

No description available

examples

static member functions

float[] blackmanHarris(int size)

No description available

float[] hamming(int size)

No description available

float[] hann(int size)

No description available

float[] rectangle(int size)

No description available

float[] triangle(int size)

No description available