Document toolboxDocument toolbox

(8.D.2.7) PDF

Overview

pdf of data

Discussion

The PDF module builds a histogram of incoming data and allows you to freeze the histogram with an input pin. It also provides optional smoothing as well as an optional reset pin. A histogram is a graphical representation showing a visual impression of the distribution of data values. A histogram is essentially a table in which each entry represents the number of times that the input sample values fell in a particular range.

Unlike the Histogram module, the PDF module calculates the bin spacing based on the higherBinEdge and lowerBinEdge variables ((higherBinEdge - lowerBinEdge) / numBins). Set these variables to change the bin spacing of your PDF module’s histogram.

Connect an audio signal that you wish to analyze by wiring into input pin 1.

Conenct a BooleanSource module to the freeze pin and toggle to freeze the histogram in its current state.

(OPTIONAL) Enable the reset pin in the Arguments tab. Connect a BooleanSource module to the optional reset pin to clear the histogram data.

Type Definition

typedef struct _ModulePDF { ModuleInstanceDescriptor instance; // Common Audio Weaver module instance structure INT32 numBins; // Number of bins INT32 controllableResetPin; // Controlling Reset Pin FLOAT32 lowerBinEdge; // Specifies the lowest bin in the histogram FLOAT32 higherBinEdge; // Specifies the highest bin in the histogram FLOAT32 smoothingTime; // The smoothing time of the PDF in ms FLOAT32 alpha; // Forgetting factor FLOAT32 binSpacing; // BinSpacing INT32 reset; // Boolean parameter to reset the pdf. FLOAT32* binCenter; // indices FLOAT32* previousOut; // previous output. INT32* hist; // init hist. } ModulePDFClass;

Variables

Properties

Name

Type

Usage

isHidden

Default value

Range

Units

numBins

int

const

0

32

Unrestricted

 

controllableResetPin

int

const

0

1

Unrestricted

 

lowerBinEdge

float

parameter

0

-1

Unrestricted

 

higherBinEdge

float

parameter

0

1

Unrestricted

 

smoothingTime

float

parameter

0

1000

0:10000

 

alpha

float

derived

0

0.0006664

Unrestricted

 

binSpacing

float

derived

0

0.0625

Unrestricted

 

reset

int

parameter

0

0

0:1

 

binCenter

float*

derived

0

[32 x 1]

Unrestricted

 

previousOut

float*

state

0

[32 x 1]

Unrestricted

 

hist

int*

state

0

[32 x 1]

Unrestricted

 

Pins

Input Pins

Name: in

Description: Audio input

Data type: float

Channel range: Unrestricted

Block size range: Unrestricted

Sample rate range: Unrestricted

Complex support: Real

 

Name: freeze

Description: input freeze

Data type: int

Channel range: 1

Block size range: 1

Sample rate range: Unrestricted

Complex support: Real

 

Name: reset

Description: input reset

Data type: int

Channel range: 1

Block size range: 1

Sample rate range: Unrestricted

Complex support: Real

Output Pins

Name: out

Description: Audio output

Data type: float

MATLAB Usage

File Name: pdf_module.m

Â