Arbitrary group delay filter specification object
D = fdesign.arbgrpdelay(SPEC)
D = fdesign.arbgrpdelay(SPEC,SPEC1,SPEC2,...)
D = fdesign.arbgrpdelay(N,F,Gd)
D = fdesign.arbgrpdelay(...,Fs)
Arbitrary group delay filters are allpass filters you can use
for correcting phase distortion introduced by other filters.
an iterative least p-th norm optimization procedure
to minimize the phase response error .
the allpass arbitrary group delay filter specification object with
D = fdesign.arbgrpdelay(
SPEC1,SPEC2,.... See SPEC for a description of supported
an allpass arbitrary group delay filter. The filter order is equal
D = fdesign.arbgrpdelay(N,F,Gd)
N, frequency vector equal to
and group delay vector equal to
Gd. See SPEC for a description of the
filter order, frequency vector, and group delay vector inputs. See
the example Design an Allpass Filter With an Arbitrary Group Delay for an example using this syntax.
the sampling frequency in hertz as a trailing scalar. If you do not
specify a sampling frequency, all frequencies are normalized frequencies
and group delay values are in samples. If you specify a sampling frequency,
group delay values are in seconds.
D = fdesign.arbgrpdelay(...,
If your arbitrary group delay design produces the error
conditioned Hessian matrix, attempt one or more of the following:
MaxPoleRadius IIR lp norm
design option to some number less than 1. Set this option when you
design your filter with the syntax:
Reduce the order of your filter design.
The filter specifications are defined as follows:
Sampling frequency. Specify the sampling frequency as a trailing positive scalar after all other input arguments. Specifying a sampling frequency forces the group delay units to be in seconds. If you specify a sampling frequency, the first element of the frequency vector must be 0. The last element must be the Nyquist frequency, Fs/2.
Filter specification object. An allpass arbitrary group delay
filter specification object containing the following modifiable properties:
Construct a signal consisting of two discrete-time windowed sinusoids (wave packets) with disjoint time support to illustrate frequency dispersion. One discrete-time sinusoid has a frequency of pi/2 radians/sample and the other has a frequency of pi/4 radians/sample. There are 9 periods of the higher-frequency sinusoid that precede 5 periods of the lower-frequency signal.
Create the signal.
x = zeros(300,1); x(1:36) = cos(pi/2*(0:35)).*hamming(36)'; x(40:40+39) = cos(pi/4*(0:39)).*hamming(40)';
Create an arbitrary group delay filter that delays the higher-frequency wave packet by approximately 100 samples.
N = 18; f = 0:.1:1; gd = ones(size(f));
Delay pi/2 radians/sample by 100 samples
gd(6) = 100; d = fdesign.arbgrpdelay(N,f,gd); Hd = design(d,'iirlpnorm','MaxPoleRadius',0.9,'SystemObject',true);
Visualize the group delay
Filter the input signal with the arbitrary group delay filter and illustrate the frequency dispersion. The high-frequency wave packet, which initially preceded the low-frequency wave packet, now occurs later because of the nonconstant group delay.
y = Hd(x); subplot(211) plot(x); title('Input Signal'); grid on; ylabel('Amplitude'); subplot(212); plot(y); title('Output Signal'); grid on; xlabel('Samples'); ylabel('Amplitude');
N = 10; f = [0 0.02 0.04 0.06 0.08 0.1 0.25 0.5 0.75 1]; g = [5 5 5 5 5 5 4 3 2 1]; w = [2 2 2 2 2 2 1 1 1 1]; hgd = fdesign.arbgrpdelay(N,f,g); Hgd = design(hgd,'iirlpnorm','Weights',w,'MaxPoleRadius',0.95,... 'SystemObject',true); fvtool(Hgd,'Analysis','grpdelay') ;
Perform multiband delay equalization outside the stopband.
Fs = 1e3; Hcheby2 = design(fdesign.bandstop('N,Fst1,Fst2,Ast',10,150,400,60,Fs),'cheby2',... 'SystemObject',true); f1 = 0.0:0.5:150; % Hz g1 = grpdelay(Hcheby2,f1,Fs).'/Fs; % seconds f2 = 400:0.5:500; % Hz g2 = grpdelay(Hcheby2,f2,Fs).'/Fs; % seconds maxg = max([g1 g2]); % Design an arbitrary group delay allpass filter to equalize the group % delay of the bandstop filter. Use an order 18 multiband design and specify % two bands. hgd = fdesign.arbgrpdelay('N,B,F,Gd',18,2,f1,maxg-g1,f2,maxg-g2,Fs); Hgd = design(hgd,'iirlpnorm','MaxPoleRadius',0.95,'SystemObject',true); Hcascade = cascade(Hcheby2,Hgd); hft = fvtool(Hcheby2,Hgd,Hcascade,'Analysis','grpdelay','Fs',Fs); legend(hft,'Original Bandstop Filter','Allpass Arbitrary Group Delay Filter',... 'Delay Equalization', 'Location','North');
The frequency response of a rational discrete-time filter is:
The argument of the frequency response as a function of the angle, ω, is referred to as the phase response.
The negative of the first derivative of the argument with respect to ω is the group delay.
Systems with nonlinear phase responses have nonconstant group delay, which causes dispersion of the frequency components of the signal. You may not want this phase distortion even if the magnitude distortion introduced by the filter produces the desired effect. See Design an Arbitrary Group Delay Filter for an illustration of frequency dispersion resulting from nonconstant group delay.
In these cases, you can cascade the frequency-selective filter with an allpass filter that compensates for the group delay. This process is often referred to as delay equalization.
The general form of an allpass system function with a real-valued impulse response is:
where the dk denote the real-valued poles and the ck denote the complex-valued poles, which occur in conjugate pairs.
The preceding equation demonstrates that allpass systems with real-valued impulse responses have 2N+M zeros and poles. The poles and zeros occur in pairs with reciprocal magnitudes. The filter order is always the same for the numerator and denominator.
fdesign.arbgrpdelay uses robust
second-order section (biquad) filter structures to implement the allpass
arbitrary group delay filter, the filter order must be even.
fdesign.arbgrpdelay uses a least p-th
norm iterative optimization described in .
iirgrpdelay — Returns
an allpass arbitrary group delay filter. The
returns the numerator and denominator coefficients. This behavior
differs from that of
returns the filter in second-order sections.
only normalized frequencies.
 Antoniou, A. Digital Signal Processing: Signals, Systems, and Filters., New York:McGraw-Hill, 2006, pp. 719–771.