Crossover Filter
Audio crossover filter
Libraries:
Audio Toolbox /
Filters
Description
The Crossover Filter block implements an audio crossover filter, which is used to split an audio signal into two or more frequency bands. Crossover filters are multiband filters whose overall magnitude frequency response is flat.
Examples
Two-Band Crossover Filtering for a Stereo Speaker System
Divide a mono signal into a stereo signal with distinct frequency bands. To hear the full effect of this simulation, use a stereo speaker system, such as headphones.
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 Crossover frequency (Hz) parameter.
Data Types: single
| double
Dependencies
To enable this port, select Specify from input port for the Crossover order parameter.
Data Types: single
| double
Dependencies
To enable this port, you need to both:
Select Specify from input port for the Crossover frequency (Hz) parameter.
Set Number of crossovers to
2
,3
or4
.
Data Types: single
| double
Dependencies
To enable this port, you need to both:
Select Specify from input port for the Crossover order parameter.
Set Number of crossovers to
2
,3
or4
.
Data Types: single
| double
Dependencies
To enable this port, you need to both:
Select Specify from input port for the Crossover frequency (Hz) parameter.
Set Number of crossovers to
3
or4
.
Data Types: single
| double
Dependencies
To enable this port, you need to both:
Select Specify from input port for the Crossover order parameter.
Set Number of crossovers to
3
or4
.
Data Types: single
| double
Dependencies
To enable this port, you need to both:
Select Specify from input port for the Crossover frequency (Hz) parameter.
Set Number of crossovers to
4
.
Data Types: single
| double
Dependencies
To enable this port, you need to both:
Select Specify from input port for the Crossover order parameter.
Set Number of crossovers to
4
.
Data Types: single
| double
Output
Port Y1 always corresponds to a lowpass filter.
Dependencies
Available if Number of crossovers is set to
1
, 2
,
3
, or
4
.
Data Types: single
| double
Depending on the number of crossovers specified, port Y2 outputs the original audio signal passed through a bandpass or highpass filter.
Dependencies
Available if Number of crossovers is set to
1
, 2
,
3
, or
4
.
Data Types: single
| double
Depending on the number of crossovers specified, port Y3 corresponds to a bandpass or highpass filter of the original audio signal.
Dependencies
Available if Number of crossovers is set to
2
, 3
, or
4
.
Data Types: single
| double
Dependencies
Available if Number of crossovers is set to
3
or
4
.
Data Types: single
| double
Dependencies
Available if Number of crossovers is set to
4
.
Data Types: single
| double
Parameters
If a parameter is listed as tunable, then you can change its value during simulation.
If you specify multiple crossovers, the corresponding Crossover frequency (Hz) and Crossover order parameters populate in the dialog box automatically.
The number of bands output by the Crossover Filter block is one more than the Number of crossovers.
Number of Crossovers | Number of Bands in Output |
---|---|
1 | Two |
2 | Three |
3 | Four |
4 | Five |
Crossover frequencies are the intersections of magnitude response bands of the individual two-band crossover filters used in the multiband crossover filter.
Tunable: Yes
The crossover filter order relates to the crossover filter slope in dB/octave: where N is the crossover order.
Tunable: Yes
The plot is updated automatically when parameters of the Crossover Filter block change.
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.
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: Yes
Dependencies
To enable this parameter, clear the Inherit sample rate from input parameter.
Interpreted execution
– Simulate the model using the MATLAB interpreter. This option reduces startup time and the simulation speed is comparable toCode generation
. In this mode, you can debug the source code of the block.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
.
Tunable: No
Block Characteristics
Data Types |
|
Direct Feedthrough |
|
Multidimensional Signals |
|
Variable-Size Signals |
|
Zero-Crossing Detection |
|
Algorithms
The Crossover Filter block is implemented as a binary tree of crossover pairs with additional phase-compensating sections [1]. Odd-order crossovers are implemented with Butterworth filters, while even-order crossovers are implemented with cascaded Butterworth filters (Linkwitz-Riley filters).
Odd-order two-band (one crossover) filters are implemented as parallel complementary highpass and lowpass filters.
LP and HP are Butterworth filters of order N, implemented as direct-form II transposed second-order sections. The shared cutoff frequency used in their design corresponds to the crossover of the resulting bands.
Even-order two-band (one crossover) filters are implemented as parallel complementary highpass and lowpass filters.
LP and HP are Butterworth filters of order N/2, where N is the order of the overall filter. The filters are implemented as direct-form II transposed second-order sections.
For overall filters of orders 2 and 6, XHI is multiplied by –1 internally so that the branches of your crossover pair are in-phase.
Even-order three-band (two crossovers) filters are implemented as parallel complementary highpass and lowpass filters organized in a tree structure.
The phase-compensating section is equivalent to an allpass filter.
The design of four-band and five-band filters (three and four crossovers) are extensions of the pattern developed for even-order and odd-order crossovers and the tree structure specified for three-band (two crossover) filters.
References
[1] D’Appolito, Joseph A. "Active Realization of Multiway All-Pass Crossover Systems." Journal of Audio Engineering Society. Vol. 35, Issue 4, 1987, pp. 239–245.
Extended Capabilities
C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.
Version History
Introduced in R2016a
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: United States.
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)