Table Of Contents

Histogram (Arbitrary Bins) (G Dataflow)

Version:
    Last Modified: January 9, 2017

    Finds the discrete histogram of a signal based on the given bin specifications.

    connector_pane_image
    datatype_icon

    signal

    The input signal.

    datatype_icon

    bins

    Boundaries of each bin of the histogram. This input is an array of clusters where each cluster defines the range of values for a bin.

    datatype_icon

    lower

    Lower boundaries of the bin.

    datatype_icon

    upper

    Upper boundaries of the bin.

    datatype_icon

    inclusion

    Method to treat the boundaries of each bin. If no bin specifications are provided in bins, this node uses maximum, minimum, number of bins, and inclusion to specify a set of uniformly spaced bins.

    Name Value Description
    lower 0

    Includes the lower boundary.

    upper 1

    Includes the upper boundary.

    both 2

    Includes both boundaries.

    neither 3

    Includes neither boundaries.

    datatype_icon

    maximum

    Maximum value to include in the histogram.

    Default: 0

    datatype_icon

    minimum

    Minimum value to include in the histogram.

    Default: 0

    datatype_icon

    error in

    Error conditions that occur before this node runs. The node responds to this input according to standard error behavior.

    Default: No error

    datatype_icon

    number of bins

    Number of bins in the histogram.

    Default: 10

    datatype_icon

    inclusion

    The boundary of each bin to handle.

    Name Description
    lower

    Includes the lower boundary.

    upper

    Includes the upper boundary.

    Determining the Bin Widths When inclusion Is lower

    If inclusion is set to lower, the bin widths are determined according to the following equations.

    Δ 0 = [ min , min + Δ x )
    Δ 1 = [ min + Δ x , min + 2 Δ x )
    Δ i = [ min + i Δ x , min + ( i + 1 ) Δ x )
    Δ k 1 = [ min + ( k 1 ) Δ x , max ]

    where

    • Δ x = max min m
    • max is the maximum
    • min is the minimum
    • m is the number of bins

    Determining the Bin Widths When inclusion Is upper

    If inclusion is set to upper, the bin widths are determined according to the following equations.

    Δ 0 = [ min , min + Δ x ]
    Δ 1 = ( min + Δ x , min + 2 Δ x ]
    Δ i = ( min + i Δ x , min + ( i + 1 ) Δ x ]
    Δ k 1 = ( min + ( k 1 ) Δ x , max ]

    where

    • Δ x = max min m
    • max is the maximum
    • min is the minimum
    • m is the number of bins

    Default: lower

    datatype_icon

    histogram graph

    The histogram of the input signal.

    datatype_icon

    x values

    An array of the center values of the bins of the histogram.

    datatype_icon

    histogram h(x)

    Discrete histogram of the input signal.

    datatype_icon

    histogram h(x)

    Discrete histogram of the input signal.

    datatype_icon

    x values

    An array of the center values of the bins of the histogram.

    datatype_icon

    samples outside

    Information about points not falling in any bin upon successful execution of the node.

    datatype_icon

    total

    Total number of values in signal not falling in any bin upon successful execution.

    datatype_icon

    below

    Number of values in signal below the first bin on the lower boundary.

    datatype_icon

    above

    Number of values in signal above the last bin on the upper boundary.

    datatype_icon

    error out

    Error information. The node produces this output according to standard error behavior.

    Algorithm for Obtaining the Histogram

    The node completes the following steps to obtain the histogram h(x):

    1. Establishes all the bins, which are the intervals, based on the information in the input array bins.
    2. Defines the function yi(x).
    3. Evaluates the histogram h(x).

    Algorithm for Calculating the Bin Intervals

    The following equation defines the bin intervals.

    Δ i = ( bins [ i ] . lower : bins [ i ] . upper ) for i = 0 , 1 , 2 , ... , k 1

    where

    • bins[i].lower is the value lower in the ith cluster of array bins
    • bins[i].upper is the value upper in the ith cluster of array bins
    • k is the number of elements in bins, which consists of the number of total bins

    Whether the two ending points bins[i].lower and bins[i].upper of each bin are included in the bin Δ i depends on the value of inclusion in the corresponding cluster i of bins.

    If bins is an empty array, this node uses the inputs maximum, minimum, and number of bins to establish the bins. Each bin width Δ x is the same and calculated with the following equation.

    The following equation calculates the width of the frequency bin Δx.

    Δ x = max min m

    where

    • max is the maximum
    • min is the minimum
    • m is the number of bins

    Algorithm for Defining the Function yi(x)

    The following equation defines the function yi(x).

    y i ( x ) = { 1 if x Δ i 0 elsewhere

    Algorithm for Evaluating the Histogram

    This node evaluates the histogram h(x) with the following equation.

    h i = j = 0 n 1 y i ( x j )

    where

    • n is the number of elements in the input signal
    • hi is the total number of points in the input signal that fall into the bin Δ i
    • i = 0, 1, ..., k - 1
    • k is the number of bins

    Where This Node Can Run:

    Desktop OS: Windows

    FPGA: Not supported


    Recently Viewed Topics