Package: dsp
Coupled allpass IIR filter
The CoupledAllpassFilter
object implements
a coupled allpass filter structure composed of two allpass filters
connected in parallel. Each allpass branch can contain multiple sections.
The overall filter output is computed by adding the output of the
two respective branches. An optional second output can also be returned,
which is power complementary to the to the first. For example, from
the frequency domain perspective, if the first output implements a
lowpass filter, the second output implements the power complementary
highpass filter. For real signals, the power complementary output
is computed by subtracting the output of the second branch from the
first. CoupledAllpassFilter
supports double and
singleprecision floating point and allows you to choose between different
realization structures. This System object™ also supports complex
coefficients, multichannel variable length input, and tunable filter
coefficient values.
To filter each channel of the input:
Define and set up your Coupled Allpass Filter. See Construction.
Call step
to filter each channel
of the input according to the properties of dsp.CoupledAllpassFilter
.
The behavior of step
is specific to each object in
the toolbox.
H = dsp.CoupledAllpassFilter
returns
a coupled allpass filter System object, H, that filters each channel
of the input signal independently. The coupled allpass filter uses
the default inner structures and coefficients.
H = dsp.CoupledAllpassFilter('
returns a Coupled allpass filter System object, PropertyName
',PropertyValue
,
...)H
,
with each property set to the specified value.
H = CoupledAllpassFilter(AllpassCoefficients1,AllpassCoefficients2)
returns
a coupled allpass filter System object, H, with Structure
set
to 'Minimum multiplier'
. The allpass coefficients
for each of the two branches are set to their two corresponding specified
values.
H = CoupledAllpassFilter(Structure,AllpassCoefficients1,AllpassCoefficients2)
returns
a coupled allpass filter System object, H, with Structure
set
to a specified value. This value can be 'Minimum multiplier'
 'Wave
Digital Filter'
 'Lattice'
. The coefficients
relevant to the specified structure are set to the values provided.

Internal structure of allpass branches Specify the internal structure of allpass branches as one of 

Allpass polynomial coefficients of branch 1 Specify the polynomial filter coefficients for the first allpass
branch. This property is applicable only if you set the 

Wave Digital Filter coefficients of branch 1 Specify the Wave Digital Filter coefficients for the first allpass
branch. This property is applicable only if you set the 

Lattice coefficients of branch 1 Specify the allpass lattice coefficients for the first allpass
branch. This property is applicable only if you set the 

length in samples for branch 1


Independent Branch 1 Phase Gain


Allpass polynomial coefficients of branch 2 Specify the polynomial filter coefficients for the second allpass
branch. This property is applicable only if you set the 

Wave Digital Filter coefficients of branch 2 This property is applicable only if you set the 

Lattice coefficients of branch 2 Specify the allpass lattice coefficients for the second allpass
branch. This property is applicable only if you set the 

Independent Branch 2 Phase Gain Specify the value of the independent phase gain applied to branch
2. This property can accept only values equal to 

Coupled phase gain Specify the value of the phasor gain in complex conjugate form,
in each of the two branches, and in complex coefficient configuration.
This property is applicable only when the selected 

Replace allpass filter in first branch with pure delay If you set 

Allow inferring coefficients of second allpass branch as complex conjugate of first When the input signal is real, this property triggers the use of an optimized structural realization. This property is only enabled if the currently selected structure supports complex coefficients. Use it only if the filter coefficients are actually complex. 
clone  Create Coupled Allpass Filter System object with same property values 
getBranches  Return internal allpass branches 
isLocked  Locked status for input attributes and nontunable properties 
release  Allow property value and input characteristics changes 
reset  Reset internal states of Coupled Allpass filter 
step  Filter input with CoupledAllpas filter object 
Allpass Realization of a Butterworth Lowpass Filter — Manual Design
Realize a Butterworth lowpass filter of order 3. Use a coupled allpass structure with inner minimum multiplier structure.
Fs = 48000; Fc = 12000; [b, a] = butter(3, 2*Fc/Fs); [c1, c2] = tf2ca(b, a); Hca = dsp.CoupledAllpassFilter(c1(2:end), c2(2:end)); Hsr = dsp.SignalSource(randn(4096, 1), 128); Hlog = dsp.SignalSink;
After creating the filter, generate a random signal, and set up a log of the output signal, step through the System objects.
while ~isDone(Hsr) in = step(Hsr); out = step(Hca, in); step(Hlog, [in, out]); end signalTraces = Hlog.Buffer; tfestimate(signalTraces(:,1), signalTraces(:,2)) hold on [A, w] = freqz(Hca); plot(w/pi, db(A), 'r') ylim([80, 10]) hold off
Allpass Realization of an Elliptic Highpass Filter — Automated Design
Remove a lowfrequency sinusoid using an elliptic highpass filter design implemented through a coupled allpass structure.
% Initialize Fs = 1000; f1 = 50; f2 = 100; Fpass = 70; Apass = 1; Fstop = 60; Astop = 80; filtSpecs = fdesign.highpass(Fstop,Fpass,Astop,Apass,Fs); hHP = design(filtSpecs,'ellip','FilterStructure','cascadeallpass',... 'SystemObject',true); frameLength = 1000; nFrames = 100; hSR = dsp.SineWave('Frequency',[f1,f2],'SampleRate',Fs,... 'SamplesPerFrame',frameLength); % Input composed of two sinusoids. hplot = dsp.SpectrumAnalyzer('SampleRate',Fs,'YLimits',[150 30],... 'PlotAsTwoSidedSpectrum',false,'ShowLegend',true,... 'FrequencyResolutionMethod', 'WindowLength','WindowLength',1000,... 'FFTLengthSource', 'Property','FFTLength', 1000,... 'Title','Original (Channel 1) Filtered (Channel 2)'); % Simulate for k = 1:nFrames original = sum(step(hSR),2); % Add the two sinusoids together filtered = step(hHP,original); step(hplot,[original,filtered]); end
The following three figures summarize the main structures supported
by dsp.CoupledAllpassFilter
.
Minimum Multiplier and WDF
Lattice
Lattice with Complex Conjugate Coefficients
[1] Regalia, Philip A., Mitra, Sanjit K., and P.P Vaidyanathan " The Digital AllPass Filter: A Versatile Signal Processing Building Block." Proceedings of the IEEE 1988, Vol. 76, No. 1, pp. 19–37.
[2] Mitra, Sanjit K., and James F. Kaiser, "Handbook for Digital Signal Processing" New York: John Wiley & Sons, 1993.