Octave Filter Bank
Libraries:
Audio Toolbox /
Filters
Description
The Octave Filter Bank block decomposes a signal into octave or fractionaloctave subbands. An octaveband is a frequency band where the highest frequency is twice the lowest frequency. Octaveband and fractional octaveband filters are commonly used to mimic how humans perceive loudness.
Ports
Input
Port_1 — Input signal
vector  matrix
Vector input –– The block treats the input as a single channel.
Matrix input –– The block treats each column of the input as an independent channel.
Data Types: single
 double
Output
Port_1 — Output signal
matrix  3D array
The Octave Filter Bank block outputs a signal with the same data type as the input signal. The shape of the output depends on the shape of the input, the number of filters in the bank, and whether or not you enable the Bands as separate output ports parameter.
If F is the number of filters in the bank, and the input signal is an LbyC matrix, then the block returns an LbyFbyC array. If C is 1, then the block outputs a matrix.
Vector input –– When you provide a vector input, the block outputs an LbyF matrix, where L is the number of elements in the vector and F is the number of filters in the bank.
Matrix input –– When you provide a matrix input, the block outputs a 3D array with size LbyFbyC, where C is the number of channels in the matrix input.
Note
When you enable the Bands as separate output ports parameter, each output is the same size as the input.
Data Types: single
 double
Parameters
Bandwidth (octaves) — Bandwidth of filters specified in octaves
1 octave
(default)  2/3 octave
 1/2 octave
 1/3 octave
 1/6 octave
 1/12 octave
 1/24 octave
 1/48 octave
Filter bandwidth in octaves, specified as 1 octave
, 2/3
octave
, 1/2 octave
, 1/3 octave
,
1/6 octave
, 1/12 octave
, 1/24
octave
, 1/48 octave
.
Frequency range (Hz) — Frequency range of filter bank (Hz)
[22 22050]
(default)  twoelement row vector of positive monotonically increasing values
Frequency range of the filter bank in Hz, specified as a twoelement row vector of positive monotonically increasing values. The block places filter bank center frequencies according to the Bandwidth (octaves), Reference frequency (Hz), and Octave ratio base parameters. Filters that have a center frequency outside of Frequency range (Hz) are ignored.
Reference frequency (Hz) — Reference frequency of filter bank (Hz)
1000
(default)  positive integer scalar
Reference frequency of the filter bank in Hz, specified as a positive integer scalar. The reference frequency defines one of the center frequencies. All other center frequencies are set relative to the reference frequency.
Filter order — Order of octave filters
12
(default)  positive even integer
Order of the octave filters, specified as a positive even integer. The filter order applies to each individual filter in the bank.
Note
The default filter order for the octaveFilterBank
object is 2
.
Octave ratio — Distance between filters
Base ten (ANSI S1.11 preferred)
(default)  Base two (musical scale)
Octave ratio base, specified as Base ten (ANSI S1.11
preferred)
or Base two (musical scale)
. The
octave ratio base determines the distribution of the center frequencies of the octave
filters. The ANSI S1.11 standard recommends base 10. Base 2 is popular for music
applications. Base two (musical scale) defines an octave as a
factor of 2, and Base ten (ANSI S1.11 preferred) defines an octave
as a factor of 10 ^{0.3}.
Inherit sample rate from input — Allow sample rate to be set by input signal
off
(default)  on
When you select this parameter, the block inherits its sample rate from the input signal. When you clear this parameter, you specify the sample rate in the Input sample rate (Hz) parameter.
Input sample rate (Hz) — Sample rate of input
44100
(default)  positive scalar
When you select this parameter, the block accepts the sample rate from the user.
Dependencies
To enable this parameter, clear the Inherit sample rate from input parameter.
Bands as separate output ports — One output port per filter band
off
(default)  on
When you select this parameter, the block provides an output port for each filter in the bank. Each output port is labeled with the center frequency of the filter and has a size identical to the input signal.
Simulate using — Specify type of simulation to run
Interpreted execution
(default)  Code generation
Code generation
–– Simulate the model using generated C code. The first time you run a simulation, Simulink^{®} generates C code for the block. The C code is reused for subsequent simulations as long as the model does not change. This option requires additional startup time.Interpreted execution
–– Simulate the model using the MATLAB^{®} interpreter. In this mode, you can debug the source code of the block.
View filter response — Open plot to visualize magnitude response
button
Octave filters are best understood when viewed on a logarithmic scale, which models how the human ear weights the spectrum. The block uses a 2048point FFT to calculate the magnitude response. The filter bank's response is displayed on a logfrequency scale with a legend to indicate the center frequency of each filter.
Variable name — Variable name of exported filter bank
myFilt
(default)  valid variable name
Name of the variable in the base workspace to contain the filter bank when it is exported. The name must be a valid MATLAB variable name.
Overwrite variable if it already exists — Overwrite variable if it already exists
on
(default)  off
When you select this parameter, exporting the filter bank overwrites the variable
specified by the Variable name parameter if it already exists in
the base workspace. If you do not select this parameter and the specified variable
already exists in the workspace, exporting the filter bank creates a new variable with
an underscore and a number appended to the variable name. For example, if the variable
name is var
and it already exists, the exported variable will be
named var_1
.
Export filter to workspace — Export filter bank to workspace
button
Export the filter bank to the base workspace in the variable specified by the Variable name parameter.
Tips
You cannot export the filter bank if you have enabled the Inherit sample rate from input parameter and the model is not running.
Block Characteristics
Data Types 

Direct Feedthrough 

Multidimensional Signals 

VariableSize Signals 

ZeroCrossing Detection 

More About
Band Edge
A band edge frequency refers to the lower or upper edge of the passband of a bandpass filter.
Center Frequency of Octave Filter
The center frequency of an octave filter is the geometric mean of the lower and upperband edge frequencies.
Algorithms
The Octave Filter Bank block is implemented as a parallel structure of
octave filters. Individual octave filters are designed as described by octaveFilter
. By default, the octave filter bank center frequencies are placed as
specified by the ANSI S1.112004
standard. You can modify the filter
placements using the Bandwidth (octaves), Frequency range
(Hz), Reference frequency (Hz), and Octave
ratio parameters.
Octave Bandwidth to Band Edge Conversion
The Octave Filter Bank block uses the specified Frequency range (Hz) and Bandwidth (octaves) to determine the normalized band edges [2].
First the block computes the upper and lower band edge frequencies:
$${f}_{\text{pa}}={f}_{\text{c}}\times {G}^{\raisebox{1ex}{$1$}\!\left/ \!\raisebox{1ex}{$2b$}\right.}$$
$${f}_{\text{pb}}={f}_{\text{c}}\times {G}^{\raisebox{1ex}{$1$}\!\left/ \!\raisebox{1ex}{$2b$}\right.}$$
f_{c} is the normalized center frequency specified by the Bandwidth (octaves) and Frequency range (Hz) parameters.
b is the octave bandwidth specified by the Bandwidth (octaves) parameter. For example, if Bandwidth (octaves) is specified as
1/3 octave
, the value of b is 3.G is a conversion constant:
$$G={10}^{\raisebox{1ex}{$3$}\!\left/ \!\raisebox{1ex}{$10$}\right.}.$$
Digital Filter Design
The Octave Filter Bank block implements a higherorder digital bandpass filter design method as specified in [1].
In this design method, a desired digital bandpass filter maps to a Butterworth lowpass analog prototype, which is then mapped back to a digital bandpass filter:
The analog Butterworth filter is expressed as a cascade of secondorder sections:
$$H(s)={H}_{1}(s){H}_{2}(s)\cdots {H}_{2N}(s)\text{\hspace{0.17em}},\text{\hspace{0.17em}}\text{where:}$$
$$\text{\hspace{1em}}\text{\hspace{1em}}\u2022\text{\hspace{1em}}{H}_{i}(s)=\frac{1}{12\frac{s}{{\Omega}_{0}}\mathrm{cos}{\theta}_{i}+\frac{{s}^{2}}{{\Omega}_{0}^{2}}},\text{\hspace{1em}}i=1,2,\mathrm{...},2N$$
$$\text{\hspace{1em}}\text{\hspace{1em}}\u2022\text{\hspace{1em}}{\theta}_{i}=\frac{\pi}{2N}\left(N1+2i\right),\text{\hspace{1em}}i=1,2,\mathrm{...},N,\mathrm{...},2N$$
N is the filter order specified by the Filter order parameter.
The analog Butterworth filter is mapped to a digital filter using a bandpass version of the bilinear transformation:
$$s=\frac{1c{z}^{1}+{z}^{2}}{1{z}^{2}},$$
where
$$c=\frac{\mathrm{sin}\left({\omega}_{\text{pa}}+{\omega}_{\text{pb}}\right)}{\mathrm{sin}{\omega}_{\text{pa}}+\mathrm{sin}{\omega}_{\text{pb}}}.$$
This mapping results in the following substitution:
$${\Omega}_{0}=\frac{c\mathrm{cos}{\omega}_{\text{pb}}}{\mathrm{sin}{\omega}_{\text{pb}}}$$
The analog prototype is evaluated:
$${H}_{\text{i}}(z)={\frac{1}{12\frac{s}{{\Omega}_{0}}\mathrm{cos}{\theta}_{\text{i}}+\frac{{s}^{2}}{{\Omega}_{0}^{2}}}}_{s=\frac{12c{z}^{1}+{z}^{2}}{1{z}^{2}}}$$
Because s is secondorder in z, the bandpass version of the bilinear transformation is fourthorder in z.
References
[1] Orfanidis, Sophocles J. Introduction to Signal Processing. Englewood Cliffs, NJ: Prentice Hall, 2010.
[2] Acoustical Society of America. American National Standard Specification for OctaveBand and FractionalOctaveBand Analog and Digital Filters: ANSI S1.112004. Melville, NY: Acoustical Society of America, 2009.
Extended Capabilities
C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.
Version History
Introduced in R2021a
See Also
octaveFilterBank
 octaveFilter
 weightingFilter
 Weighting Filter  Octave Filter
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
 América Latina (Español)
 Canada (English)
 United States (English)
Europe
 Belgium (English)
 Denmark (English)
 Deutschland (Deutsch)
 España (Español)
 Finland (English)
 France (Français)
 Ireland (English)
 Italia (Italiano)
 Luxembourg (English)
 Netherlands (English)
 Norway (English)
 Österreich (Deutsch)
 Portugal (English)
 Sweden (English)
 Switzerland
 United Kingdom (English)