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
x — Input signal
matrix | 1-D vector
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
F1 — Crossover frequency (Hz)
real scalar in the range 20
to
20000
Dependencies
To enable this port, select Specify from input port for the Crossover frequency (Hz) parameter.
Data Types: single
| double
O1 — Crossover order
integer in the range 0
to
8
Dependencies
To enable this port, select Specify from input port for the Crossover order parameter.
Data Types: single
| double
F2 — Crossover frequency (Hz)
real scalar in the range 20
to
20000
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
O2 — Crossover order
integer in the range 0
to
8
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
F3 — Crossover frequency (Hz)
real scalar in the range 20
to
20000
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
O3 — Crossover order
integer in the range 0
to
8
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
F4 — Crossover frequency (Hz)
real scalar in the range 20
to
20000
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
O4 — Crossover order
integer in the range 0
to
8
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
Y1 — Output signal
matrix
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
Y2 — Output signal
matrix
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
Y3 — Output signal
matrix
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
Y4 — Output signal
matrix
Dependencies
Available if Number of crossovers is set to
3
or
4
.
Data Types: single
| double
Y5 — Output signal
matrix
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.
Number of crossovers — Number of magnitude response band crossings
1
(default) | 2
| 3
| 4
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 frequency (Hz) — Intersections of magnitude response bands
100
(default) | real scalar in the range 20
to
20000
Crossover frequencies are the intersections of magnitude response bands of the individual two-band crossover filters used in the multiband crossover filter.
Tunable: Yes
Crossover order — Order of individual crossover filters
2
(default) | integer in the range [0, 8]
The crossover filter order relates to the crossover filter slope in dB/octave: where N is the crossover order.
Tunable: Yes
View filter response — Open plot of magnitude response of each filter band
button
The plot is updated automatically when parameters of the Crossover Filter block change.
Tunable: Yes
Variable name — Variable name of exported filter
myFilt
(default) | valid variable name
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.
Overwrite variable if it already exists — Overwrite variable if it already exists
on
(default) | off
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 filter to workspace — Export filter to workspace
button
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.
Inherit sample rate from input — Specify source of input sample rate
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 Input sample rate (Hz).
Input sample rate (Hz) — Sample rate of input
44100
(default) | positive scalar
Tunable: Yes
Dependencies
To enable this parameter, clear the Inherit sample rate from input parameter.
Simulate using — Specify type of simulation to run
Interpreted execution
(default) | Code generation
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 Crossover Pair
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 Crossover Pair
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 Filter
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: .
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)