Octave Filter
Octave-band and fractional octave-band filter
Libraries:
Audio Toolbox /
Filters
Description
The Octave Filter block performs octave-band or fractional octave-band filtering independently across each input channel. An octave-band is a frequency band where the highest frequency is twice the lowest frequency. Octave-band and fractional octave-band filters are commonly used to mimic how humans perceive loudness. Octave filters are best understood when viewed on a logarithmic scale, which models how the human ear weights the spectrum.
Examples
Perform Octave Filtering
Examine the Octave Filter block in a Simulink® model and tune parameters.
Tune Center Frequency Using Input Port
Tune the center frequency of an Octave Filter block in Simulink® using the optional input port.
Ports
Input
Matrix input –– Each column of the input is treated as an independent channel.
1-D vector input –– The input is treated as a single channel.
This port is unnamed unless you specify additional input ports.
Data Types: single
| double
Dependencies
To enable this port, select Specify from input port for the Center frequency (Hz) parameter.
Data Types: single
| double
Output
The Octave Filter block outputs a signal with the same data type as the input signal. The size of the output depends on the size of the input:
Matrix input –– The block outputs a matrix the same size and data type as the input signal.
1-D vector input –– The block outputs an N-by-1 matrix (column vector), where N is the number of elements in the 1-D vector.
Data Types: single
| double
Parameters
If a parameter is listed as tunable, then you can change its value during simulation.
Tunable: No
The maximum center frequency is the value that causes the upper band edge to be equal to the Nyquist frequency, Fs/2. Frequencies above this value are saturated.
The minimum center frequency is the value that causes the lower band edge to be equal to 1 Hz. Frequencies below this value are quantized to 1 Hz.
To specify Center frequency (Hz) from an input port, select Specify from input port for the parameter.
Tunable: Yes
Tunable: Yes
off –– The Octave Filter block runs at the input sample rate.
on –– The Octave Filter block runs at two times the input sample rate. Oversampling minimizes the frequency warping effects introduced by the bilinear transformation. An FIR halfband interpolator implements oversampling before octave filtering. A halfband decimator reduces the sample rate back the input sampling rate after octave filtering.
Tunable: No
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 Input sample rate (Hz).
Tunable: No
Tunable: Yes
Dependencies
To enable this parameter, clear the Inherit sample rate from input parameter.
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, but the speed of the subsequent simulations is comparable toInterpreted execution
.Interpreted execution
–– Simulate the model using the MATLAB® interpreter. This option shortens startup time but has a slower simulation speed thanCode generation
. In this mode, you can debug the source code of the block.
Tunable: No
The mask attenuation limits are defined in the ANSI S1.11-2004 standard.
If the mask is green, the design is compliant.
If the mask is red, the design breaks compliance.
Tunable: Yes
A 2048-point FFT is used to calculate the magnitude response.
Tunable: Yes
Name of the variable in the base workspace to contain the filter when it is exported. The name must be a valid MATLAB variable name.
When you select this parameter, exporting the filter 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 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 the filter to the base workspace in the variable specified by the Variable name parameter.
Tips
You cannot export the filter if you have enabled the Inherit sample rate from input parameter and the model is not running.
You cannot export the filter if you are specifying filter characteristics from input ports.
Block Characteristics
Data Types |
|
Direct Feedthrough |
|
Multidimensional Signals |
|
Variable-Size Signals |
|
Zero-Crossing Detection |
|
More About
A band edge frequency refers to the lower or upper edge of the passband of a bandpass filter.
The center frequency of an octave filter is the geometric mean of the lower- and upper-band edge frequencies.
Algorithms
The Octave Filter block uses the specified center frequency and filter bandwidth in octaves to determine the band edges [2].
First the block computes the upper and lower band edge frequencies:
fc is the center frequency specified by the Center frequency (Hz) parameter.
b is the octave bandwidth specified by the Bandwidth parameter. For example, if Bandwidth is specified as
1/3 octave
, the value of b is 3.G is a conversion constant:
The Octave Filter block implements a higher-order 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 second-order sections:
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:
where
This mapping results in the following substitution:
The analog prototype is evaluated:
Because s is second-order in z, the bandpass version of the bilinear transformation is fourth-order 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 Octave-Band and Fractional-Octave-Band Analog and Digital Filters: ANSI S1.11-2004. 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 R2016b
See Also
octaveFilter
| weightingFilter
| Weighting Filter | Octave Filter
Bank
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.
Sélectionner un site web
Choisissez un site web pour accéder au contenu traduit dans votre langue (lorsqu'il est disponible) et voir les événements et les offres locales. D’après votre position, nous vous recommandons de sélectionner la région suivante : .
Vous pouvez également sélectionner un site web dans la liste suivante :
Comment optimiser les performances du site
Pour optimiser les performances du site, sélectionnez la région Chine (en chinois ou en anglais). Les sites de MathWorks pour les autres pays ne sont pas optimisés pour les visites provenant de votre région.
Amériques
- 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)