LinkwitzRileyFilter
Overview
Linkwitz-Riley filter
Discussion
The module provides Linkwitz-Riley low pass, high pass, or all pass filters, from 2nd order to 10th order. Linkwitz-Riley filters can only have an even order. The module operates on 32-bit floating-point data. The order of the filter is determined by the order argument when instantiated, and the filterType parameter is used to select which type of filter is designed. Once the order is set, it cannot be changed. The filterType parameter is able to be changed at run-time. filterType=0 designs a low pass filter. filterType=1 designs a high pass filter. filterType=2 designs an allpass filter.
Please note that if you are using the module as part of a crossover network (such as a lowpass & highpass combination) in order to achieve a flat unity output, if order/2 is an odd number you need to invert the output (multiply the data by -1) of one of the sections. Addtionally, allpass filters are only supported if order/2 is odd. If you try and build an allpass when order/2 is even, you will get a warning message.
Type Definition
typedef struct _ModuleLinkwitzRileyFilter
{
ModuleInstanceDescriptor instance; // Common Audio Weaver module instance structure
INT32 filterType; // Specifies what type of filter is designed (lowpass=0, highpass=1, allpass=2).
INT32 order; // Order of the filter.
FLOAT32 cutoff; // Cutoff frequency of the filter in Hz - range clamped to calc based on sample rate
awe_modButterworthFilterInstance *butter1; // Butterworth filter
awe_modButterworthFilterInstance *butter2; // Butterworth filter
} ModuleLinkwitzRileyFilterClass;
Variables
Properties
Name | Type | Usage | isHidden | Default value | Range | Units |
filterType | int | parameter | 0 | 0 | 0:2 | |
order | int | const | 0 | 2 | 2:10 | |
cutoff | float | parameter | 0 | 250 | 1:0.1:20000 | Hz |
Pins
Input Pins
Name: in
Description: Audio Input
Data type: float
Channel range: Unrestricted
Block size range: Unrestricted
Sample rate range: Unrestricted
Complex support: Real
Output Pins
Name: out
Description: Audio output
Data type: float
Scratch Pins
Channel count: 1
Block size: 32
Sample rate: 48000
MATLAB Usage
File Name: linkwitz_riley_filter_module.m
SYS=linkwitz_riley_filter_module(NAME, ORDER)
Creates a Linkwitz Riley high-pass, low-pass, or all-pass filter.
Arguments:
NAME - name of the module.
ORDER - filter order.cd