# octaveSpectrumEstimator

## Description

The `octaveSpectrumEstimator`

System object™ measures the spectrum of streaming audio data using octave or fractional-octave
bands.

To estimate the octave-band spectrum:

Create the

`octaveSpectrumEstimator`

object and set its properties.Call the object with arguments, as if it were a function.

To learn more about how System objects work, see What Are System Objects?

## Creation

### Syntax

### Description

creates an
octave spectrum estimator System object with default property values.`o`

= octaveSpectrumEstimator

sets the SampleRate
property to `o`

= octaveSpectrumEstimator(`fs`

)`fs`

.

sets Properties using one or more
name-value arguments.`o`

= octaveSpectrumEstimator(`Name=Value`

)

## Properties

## Usage

### Description

### Input Arguments

### Output Arguments

## Object Functions

To use an object function, specify the
System object as the first input argument. For
example, to release system resources of a System object named `obj`

, use
this syntax:

release(obj)

## Examples

## Algorithms

To compute the octave-band spectrum, the `octaveSpectrumEstimator`

object first
optionally applies frequency-weighted filtering on the input signal using `weightingFilter`

based on the `FrequencyWeighting`

property. The `octaveSpectrumEstimator`

object then passes
the signal through an octave filter bank constructed using `octaveFilterBank`

with the `Bandwidth`

, `FrequencyRange`

, `ReferenceFrequency`

, `FilterOrder`

, and `OctaveRatioBase`

properties. The `octaveSpectrumEstimator`

object takes the
square of the filter bank output to get the power in each band then applies an averaging,
time-weighted filter to perform time smoothing on the power values.

The time-weighted filter with attack time *A* and release time
*R* is defined as:

$$y[n]=\{\begin{array}{cc}{\alpha}_{A}y[n-1]+(1-{\alpha}_{A})x[n],& x[n]\le y[n-1]\\ {\alpha}_{R}y[n-1]+(1-{\alpha}_{R})x[n],& x[n]>y[n-1]\end{array}$$

The attack time coefficient *α*_{A}
with sample rate *Fs* is:

$${\alpha}_{A}=\mathrm{exp}\left(\frac{-1}{Fs\times A}\right)$$

The release time coefficient *α*_{R}
is:

$${\alpha}_{R}=\mathrm{exp}\left(\frac{-1}{Fs\times R}\right)$$

## References

[1] Acoustical Society of America.
*American National Standard Specification for Octave-Band and
Fractional-Octave-Band Analog and Digital Filters*. ANSI S1.11-2004. Melville,
NY: Acoustical Society of America, 2009.

## Extended Capabilities

## Version History

**Introduced in R2024b**