Overview
Histogram of data
Discussion
The histogram module builds a histogram of the incoming data. 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.
...
Values which are less than the lower edge of the first bin are not placed into the histogram. numUnderSamples indicates how many sample values are less than the lower edge of first bin. Value which are equal or more than the upper edge of the last bin are also not placed into the histogram. numOverSamples indicates how many sample values are equal or more than the upper edge of last bin. The module has the parameter "reset" to reset the histogram. Set this to 1 to reset the histogram and set all counts to zero. The histogram is stored in the internal array hist. If OUTPUTVALUE is 1, then the array hist is output on a pin.
Type Definition
Code Block |
---|
typedef struct _ModuleHistogram { ModuleInstanceDescriptor instance; // Common Audio Weaver module instance structure INT32 numBins; // Number of bins in the histogram FLOAT32 lowerBinCenter; // Specifies the center of the first (lowest) bin in the histogram FLOAT32 binSpacing; // Specifies the spacing between bins INT32 reset; // Boolean parameter to reset the histogram. INT32 numHistSamples; // Number of input samples processed. INT32 numUnderSamples; // Total number of input samples that were outside of the histogram range on the low end. INT32 numOverSamples; // Total number of input samples that were outside of the histogram range on the high end. INT32* hist; // Histogram array. } ModuleHistogramClass; |
Variables
Properties
Name | Type | Usage | isHidden | Default value | Range | Units |
numBins | int | const | 0 | 32 | Unrestricted | |
lowerBinCenter | float | parameter | 0 | -1 | -100:100 | |
binSpacing | float | parameter | 0 | 0.05 | 0.01:100 | |
reset | int | parameter | 0 | 0 | 0:1 | |
numHistSamples | int | state | 0 | 0 | Unrestricted | |
numUnderSamples | int | state | 0 | 0 | Unrestricted | |
numOverSamples | int | state | 0 | 0 | Unrestricted | |
hist | int* | state | 0 | [32 x 1] | Unrestricted |
Pins
Input Pins
Name: in
Description: Audio input
...
Sample rate range: Unrestricted
Complex support: Real
Output Pins
Name: out
Description: histogram value output
Data type: int
MATLAB Usage
File Name: histogram_module.m
...