CrossoverFilterFract32
Overview
General crossover designer
Discussion
This subsystem implements N-way crossover filters of either Linkwitz-Riley or Butterworth design. Internally, the crossovers are constructed out of two other subsystems: a 1in-2out crossover which divides the input into two separate frequency bands and an allpass phase compensation network. The 1in-2out crossover consists of lowpass (first output) and highpass (second output) filters. The lowpass and highpass filters are designed such that the sum of their responses equals an allpass filter with unity gain - and this allpass response equals the response of the allphase phase compensation network. An N-way crossover is constructed by cascading these subsystems.
The subsystem .className is generated using the crossover type, number of outputs, and order. For Linkwitz-Riley crossovers, the .className equals "LRXoverN%dOrder%d" where the first integer is the number of bands and the second integer is the order. Similarly, for Butterworth crossovers, the .className equals "ButterXoverN%dOrder%d" where the first integer is the number of bands and the second integer is the order.
The number of 1in-2out crossovers required to make an N-way crossover equals N-1. The number of allpass phase compensation filters grows as O(NxN), so beware, there may be quite a large number of filters! The table below shows the number of 1in-2out crossovers and the number of allpass filters as a function of N, the number of output channels.
N 1in-2out Allpass
2 1 0
3 2 1
4 3 3
5 4 6
6 5 10
See some of the example below for the topology of the crossover system.
In the Linkwitz-Rily design, the lowpass and highpass splitting filters are always 4th order. The splitting filters are each formed as a cascade of 2 second order Butterworth filters. The allpass compensating filter is 2nd order based on a Butterworth design.
In the Butterworth filter design, the lowpass and highpass filters are each standard Butterworth designs and the order must be odd. The odd order requirement ensures that the sum of the splitting filters is an allpass, and the allpass compensation filter equals the the sum of the splitting filters. The order of the allpass compensation filter matches the order of the splitting filters. Thus, 5th order splitting filters require a 5th order allpass network
Type Definition
-Not Shown-
Variables
Properties
Name | Type | Usage | isHidden | Default value | Range | Units |
cutoff | float* | parameter | 0 | [2 x 1] | 1:23997.6 | Hz |
N | int | const | 0 | 3 | Unrestricted |
Pins
Input Pins
Name: in
Description: audio input
Data type: fract32
Channel range: Unrestricted
Block size range: Unrestricted
Sample rate range: Unrestricted
Complex support: Real
Output Pins
Name: out1
Description: Audio output
Data type: fract32
Name: out2
Description: Audio output
Data type: fract32
Name: out3
Description: Audio output
Data type: fract32
Scratch Pins
Channel count: 1
Block size: 32
Sample rate: 48000
Channel count: 1
Block size: 32
Sample rate: 48000
Channel count: 1
Block size: 32
Sample rate: 48000
MATLAB Usage
File Name: xover_nway_fract32_subsystem.m
SYS=xover_nway_fract32_subsystem(NAME, TYPE, N, ORDER)
Creates a subsystem that implements N-way crossovers of various types.
The module has a single input pin and N output pins. Each pin can
be multichannel. The subsystem divides the input signal into N
distinct frequency bands. The first band extends from DC to
cutoff(1) Hz; the second band extends from cutoff(1) to cutoff(2) Hz;
the last band extends from cutoff(N-1) to Nyquist. Arguments:
NAME - name of the subsystem
TYPE - a string specifying what filter is used in the crossover.
Allowable values are:
'lr' - Linkwitz Riley design (default).
'butter' - Butterworth filters.
N - number of output bands. This should be in the range
2 to 10 (default=3).
ORDER - order of each of the crossover filters (default = 2).
The TYPE and ORDER are tied together. For Linkwitz-Riley designs, the
ORDER is always 4. (In fact, the ORDER argument is ignored for this
type of design). Each lowpass or highpass filter consists of two
second order Butterworth files yielding a net order of 4 per stage.
For Butterworth type crossovers, the ORDER must be odd: 1, 3, 5, etc.
The function returns a subsystem that implements the crossover. The
subsystem's input pin is named '.in' and the outputs are named
'.out1', '.out2', etc.