# spectralFlux

Spectral flux for audio signals and auditory spectrograms

## Syntax

## Description

specifies the previous spectral state. This syntax is supported only for frequency-domain
inputs.`flux`

= spectralFlux(`x`

,`f`

,`initialCondition`

)

specifies options using one or more name-value arguments.`flux`

= spectralFlux(___,`Name=Value`

)

For example, `flux = spectralFlux(x,f,NormType=1)`

calculates spectral
flux using norm type 1.

`[`

also returns the final spectral state. You can specify an input combination from any of the
previous syntaxes.`flux`

,`finalCondition`

] = spectralFlux(___)

`spectralFlux(___)`

with no output arguments plots the
spectral flux.

If the input is in the time domain, the spectral flux is plotted against time.

If the input is in the frequency domain, the spectral flux is plotted against frame number.

## Examples

## Input Arguments

## Output Arguments

## Algorithms

The spectral flux is calculated as described in [1]:

$$\text{flux(}t\text{)}={\left({\displaystyle \sum _{k={b}_{1}}^{{b}_{2}}{\left|{s}_{k}(t)-{s}_{k}(t-1)\right|}^{P}}\right)}^{\raisebox{1ex}{$1$}\!\left/ \!\raisebox{-1ex}{$P$}\right.}$$

where

*s*is the spectral value at bin_{k}*k*.*b*_{1}and*b*_{2}are the band edges, in bins, over which to calculate the spectral flux.*P*is the norm type. You can specify the norm type using`NormType`

.

## References

[1] Scheirer, E., and M. Slaney.
"Construction and Evaluation of a Robust Multifeature Speech/Music Discriminator." *IEEE International Conference on Acoustics, Speech, and Signal
Processing*. Volume 2, 1997, pp. 1221–1224.

## Extended Capabilities

## Version History

**Introduced in R2019a**