J 39 Mat Lab Program Crossover Design
J 39 Mat Lab Program Crossover Design
net/publication/269102647
CITATIONS READS
2 389
1 author:
SEE PROFILE
Some of the authors of this publication are also working on these related projects:
All content following this page was uploaded by Malcolm John Hawksford on 09 August 2016.
ENGINEERING
REPORTS
Centre for Audio Research and Engineering, University of Essex, UK C04 3SQ
A digital design filter program is presented written in the MATLAB environment. Impulse
response time editing is implemented together with various options for spectral domain
processing. The filter inputs time-domain impulse response data and outputs filter coefficients
for both FIR and ILR implementations. Comprehensive display options are incorporated,
including minimum-phase processing and CDS, and consideration is given to both specular
and diffuse loudspeakers. Applications include the design of digital equalization filters and
digital crossover filters for loudspeaker systems.
706 J.AudioEng.Soc.iVol.47,No.9,1999September
ENGINEERING REPORTS LOUDSPEAKER EQUALIZATION AND CROSSOVER DESIGN
o '_ 3 2 i o]
y(m+ 1) (m + 1)3 (m + 1)2 (m + 1) 1
y(m) m3 m2 m 1
y(1) 1 1 1 1]
/
y(1)- x
0 = 2a + b. mx(l:m2) = ml*(l:m2);
Two options now exist. Either the derivative at the ex- Here mi is the lowest frequency in the vector whereas
treme frequency range can be equated to zero, or the m2*ml = fs/2, where fs is the sampling rate.
function can be matched to the derivative of the signal The process commences by calculating an amplitude-
by again forcing a fit to two adjacent points at x = m frequency response based on a Butterworth magnitude
and x = m + 1. This gives rise to two matrix equations, filter template.
which can be solved for [a b c] by matrix inversion, The crossover frequency xof (scaled by ml to form a
that is, either for a zero first derivative at low-frequency, corresponding element number in the vector mx) and
the asymptotic attenuation slope of the filter N dB per
[ y(1)
0 ] Ii 1 01 ord = abs(N/(20*logl0(2)));
restrictions on the filter) are specified as input to the
octave (N need not be an integer as there are no "analog"
or for a matching first derivative of the actual fre- from which the 3-dB break frequencies xofl and xofh of
quency response, the low-pass and high-pass filters are calculated,
[yml[m
mil]II
xomxof
y(m)
y(1)ora / =
1
]
rn2
1
m
1
xofh = ml*xof*(.5 A( -- 2/ord) - 1) A .5;
In practice the quadratic fit with a forced zero first deriv- ail = aj./(1 + (mx/xofl). A2). A(orr/2);
ative at the frequency extremes was found to give the
best overall results and has been adopted in the current ajh = aj.*(((mx/xofh), n 2)./(1 + (mx/xofh). n 2)). ^ (orr/2);
version of the program.
However, the composite zero-phase summation (ail +
2.3 Pseudo-Butterworth Linear-Phase ajh) does not generally sum to the target response aj,
Crossover Alignment which itself may not be fiat due to other frequency shap-
The program includes a routine to embed either a low- ing characteristics selected in the program. Co^se-
pass or a high-pass filter in the target equalization quently a symmetrical (about the crossover frequency
Quadraticl-i
y(m+l)
disc on t/nu ous de_hvative _-_----_
quadratic curve _ / ',
first derivative zero / ._ .... '_-'-3'(m)
y(1)- x I
x= 1 x=m x=m +1
Fig. 2. Low-frequency quadratic substitution (discontinuous derivative at x = m).
xof) compensation to ajl and ajh must be made. The impulse response eit can form a digital filter di-
For ajl, the response is modified in the frequency rectly, although in general it represents an excessive
range 1 to xof, number of coefficients. In the present program the im-
pulse response is subdivided into two regions. The first
ajl(l:xof) = ajl(l:xof) + aj(l:xof)- ajl(l:xof region of length en forms the first-stage FIR filter di-
Now when the summation (ajl + ajh) is formed over such as the natural low-frequency rolloff of a loud-
{l:m2}, the composite amplitude response is aj, which speaker. As such it may be surmised to have a simpler
form more amenable to a low coefficient representation.
is the target response of the equalizer. However, because en can be user selected together with
2.4 Tilt Filter the second-stage filter numerator coefficients nx and de-
nominator coefficients nd required to represent the tail,
A simple frequency tilt filter is included where the
a wide range of filters can be chosen extending from
target equalization response aj can be tilted at a constant pure FIR to pure IIR. As the second-stage filter is an
slope of Nx dB per octave (as described in a logarithmic FIR-IIR form, the total number of numerator coeffi-
space). The response is normalized to unity gain at the cie^ts in the overall filter is (en + rix). However, it
geometric frequency mean fj and computed as
turns out that when the tail response is calculated, it is
ajj ajj - (ajj(m2) + min(ajj))/2; facilitate this process. However, if only an FIR filter is
required, then en remains fixed and a short raised-cosine
aJj = (10*ones(size(1 :m2))). n (ajj/20); window is applied to the end of the FIR filter.
After selecting the desired tail approximation using a However, in the program the practice reported earlier
normalized LMS error calculation, the FIR and IIR filter [3] of eliminating the noncausal distortion by minimum-
sections can be spliced to form a complete filter. In the phase processing is taken. That is, a vector is formed
program up to three vectors are outputted to describe representing the magnitude Fourier transform of et,
the overall filter. The first filter Nl(z) of length en repre-
sents the first-stage FIR filter while the second recursive fa = abs(fft(abs(et)));
filter has a numerator polynomial N2(z) of length nx and
a denominator polynomial D2(z) of length nd (the first from which a minimum-phase impulse response is corn-
coefficient being unity and not included in nd). The puted which has the same amplitude spectrum as fa,
complete z-domain equalizer response EQ(z) is then cal-
culated as ett = real(ifft(exp(conj(hilbert(log(fa))))));
EQ(z) = Nl(z) + N2(z)z -(eh+ ]) The option for displaying the ETC and the minimum-
D2(z) phase ETC is provided together with an excess-phase
where a tap delay of length {eh + 1} is included in the corrected ETC [3], where the magnitude of ett is con-
volved with the excess-phase impulse response f, that is,
second-stage filter to locate the approximated tail in its
correct position within the overall impulse response.
ere = abs(conv(abs(ett),f));
2.7 CDS Display
The generation of a CDS has been described [3] in The function ete then has a similar precursive response
to the envelope of the impulse response by including
MATLAB where either a linear or a logarithmic magni-
both minimum-phase and excess-phase attributes.
tude display can be formed. The option of applying a
two-dimensional Gaussian filter mask is also included
where fine detail may require smoothing for presenta- 3 FILTER DESIGN EXAMPLES FOR
tional reasons. In the program, options exist for in- LOUDSPEAKERS
eluding minimum-phase processing based on the algo-
rithm described in Section 2.1. This is a useful tool as This section presents example filter designs for two
classes of loudspeaker, the broad-band passive system
it gives often a better description of a loudspeaker's
and the digital and active loudspeaker system [5]. Dis-
performance stripped of the excess-phase distortion
cussion as to the advantages of digital and active loud-
which generally has lower subjective significance yet
may introduce dominant features in the impulse response speaker technology is also included.
displayed in the CDS. The CDS is described by a two- 3.1 Broad-Band Equalization Filters for FUll-
dimensional matrix cd, where Range Passive Loudspeakers
Times 10 1
0.2 0.8
0.6
0
0.4
-0.2 0.2
-0.4 0
-0.2 J ......
-0.8 -0.6
-1 -08
50 100 150 200 250 50 100 150 200
(a) (b)
Fig. 3. Time-edited impulse response derived using MLS measurement. (a) Two-way dynamic loudspeaker. (b) DML.
09 ............................................................................................................
°9 ........,.........._.........i..........!....................................................
0.8 ........................................................................................................... 0.8 ........i.........._.........i..........i .........i..........i ...................i........._..........L.
o,1.............................................................................................................
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .o'. .}.. .. .i. .. . .i . . . .: . . . .i.:.. .. _. . . . .i.. . . ._. . . . _. . . . J. . . . .i .
0.6 ......... _--......... ri T mes 0 ...... i.......... _......... _.......... ?......... i.......... i"'
...........................................................................................................
05 .........................
0_,,..,
_..........................
_.............
'
i......................................................
:
,............
0.4
_.............
_............
..............
_............. 0_ ._
°' ..
Fig. 4. Minimum-phase impulse response. (a) Two-way dynamic loudspeaker. (b) DML.
0.4
02 .........................................................................................................
08i.-,
i !
..........,
i
.........
,..........
i
_..........
,,
_
:
.........._..........
:
',
..........
i. ,
.........,...........
o6 ........ ¢..........¢.........i..........i..........;..........i ..........i..........i .........i...........
o ---_--_---:
.............
'.........: 0.4.......i..........
::......... (..........
4.......... {..........
i..........
?..........
F.........
!........
7
-0.2 ........................
-0.4 ....................................
,....................................................................
-04 .-4..........i.........i..........i..........i..........i..........i.........._.........i...........
-o.8 ................................................................................
i_........................... -o.8 .....i ..........i.........i..........:._.........i..........i..........i..........i .........i...........
_86..........................................................................................................
-1 m
80 100
m
150
_
200
_
250
m
300
m
350 400
-1[!!!t; _ i i ! i i i
200 400 600 800 1000 1200 1400 1600 1800
(a) (b)
Fig. 5. Excess-phase impulse response. (a) Two-way dynamic loudspeaker. (b) DML.
interfaced directly to the power amplifiers, resulting in rate drive unit equalization. Although analog crossover
a welcome reduction of analog signal processing. Using filters can be synthesized, a more precise strategy is to
digital signal processing (DSP) it is straightforward to define the low-pass filter AL(z) and the high-pass filter
integrate near-ideal crossover filters together with accu- Au(z) as delay derived, as this eliminates the nonlinear
l iiii
i
-'°
.......
_1_
-20
''...........
ii......
.......
101
.............
i
....
:.........
........
[....................................................... ii=''''''"'"=_'',
i ; i;;ill
102
i i ilJiiii
103
; ;
_ '_,,
'_;'.:il i iiii
,_'i
;ii;i;;
104
: : ::::
105 101
: : :::fill
102
i i iiiiiii
103
i :::;:iii
104
i i ;;;[
105
(a) (b)
Fig. 6. Target, loudspeaker, and equalized frequency responses. (a) Two-way dynamic loudspeaker. (b) DML.
-lO -lO
-2o 20
-3o -3o
-4o -4o
-5o -50
o o
SO 50
100 60 80 _
100 60 80
40 40
20 20
1500 1500
(a) (b)
Fig. 7. CDS. (a) Two-way dynamic loudspeaker. (b) DML.
0. 0_
-10. -10.
-20, -20.
-30. -30,
-40 -40,
-50 -50.
0 0
50 50
80 80
60 100 60
100 40 40
20 20
1500 1500
(a) (b)
I
HAWKSFORO ENGINEERING
REPORTS
-20. -20,
-40. -40.
-60. -80.
0 0
20 20
40 1O0 40 1O0
60 SO 60 50
80 80
lOO0 1000
(a) (b)
Fig. 9. CDR of equalization filter. (a) Two-way dynamic loudspeaker. (b) DML.
-10 -10_
-20. -20.
-30. -30..
-40.
-50. -50
0 0
50 50
80 80
60 100 60
100 40 40
20 20
1500 150 0
(a) (b)
Fig. 10. CDS, minimum-phasecorrectiononly. (a) EqualiZedtwo-way dynamicloudspeaker. (b) Equalized DML.
8) Use of current-drive technology or mixed current- ponding low-pass and high-pass filter responses, in-
drive-voltage-drive systems can enhance system per- cluding drive-unit response equalization. Each filter
formance, used a total of 285 coefficients.
9) Each DAC only handles a band-limited audio sig- Finally, the new class of interleave-crossover align-
nal, thus reducing intermodulation distortion and low- ment [3] is illustrated by way of example in Fig. 17,
ering the probability overload in drive-unit frequency- which is also incorporated in the program. The purpose
response correction processes, of this alignment is to distribute and randomize in fre-
10) Signals can be routed to an active loudspeaker quency the interference patterns that result in the off-
system via either an optical or an electrical digital inter- axis polar response [8]. Both low-pass and high-pass
face with central commands such as standby mode, vol- filters for a stochastic-interleave function are shown that
ume level, equalization programs being remotely down- includes a mild equalization tilt function. Fig. 18 shows
loaded from a central (or indeed distributed) control the resulting composite frequency response when there
center. There is the option here to define a local-area is a time offset between drive units. A complicated inter-
network for digital or video distribution systems, ference spectrum is formed in the crossover region that
In Fig. 14 an example crossover target filter design is in some respects analogous to the behavior of a DML
is presented based on the pseudo-Butterworth algorithm [6]. Also, by comparing the inverted connection com-
of Section 2.3, whereas Figs. 15 and 16 show the corres- posite responses shown in the top curves of Figs. 14 and
1 -- "-"-"'"-'"-_- ---- -
[3.5 Loudspeakerimpulseresponse
,
1.5 [_ I Minimum-phase
of loudspeakerETC
0.5 [ Loudspeakerimpulseresponse }
J. AudioEng.Soc.,Vol.47,No.9,1999September 715
HAWKSFORD ENGINEERING REPORTS
3
t
2.5
ETC of loudspeaker impulse response
2 _ '/_Wlx'x''_'_''_
t Minimum-phaseof loudspeakerETC
0.5 Loudspeakerimpulseresponse.
-0.5
'1
O 20 40
I
60
(a)
80
I
I00
I -- I
120
I
140
0 _
-0.5
-1 I I I I I I l
(b)
Fig. 12. Excess-phase corrected ETC. (a) Two-way dynamic loudspeaker. (b) DML.
Digital
input
Fig. 13. Two-way loudspeaker system using digital crossover filters with amplitude and phase correction.
i ..........
...........
-'°F
.......
JJ-'i .................
i............
\i .....
I........... :o _
-20 ...........
J
-40
Fig. 15. Low-pass filter response including drive-unit equal- Fig. 17. Example target response of stochastic interleave align-
ization, merit. (Compare with noninterleaved response of Fig. 14.)
o __.,,',_................ _,__,,
-5o................. :.,................. .,, ...........
_.................
-100
......... 15
............................
_ -10
Fig. 16. High-pass filter response including drive-unit equal- Fig. 18. Family of four composite responses time offsets be-
ization, tweed drive units.
equalization to a spatially averaged frequency response, ever, a much greater intersample variation in the pre-
In practice it is recommended that the spatial average and postresponse of the excess-phase impulse response
be performed using measurements taken over a sampled would be anticipated as the measured window encircles
hemisphere. Failing this a truncated impulse can be used the transducer. This is implied by the transducer being
together with a more limited number of coefficients in spatially diffuse. It is in these areas where fundamental
the equalization filter. It is important to appreciate that performance differences between specular radiators and
spatial averaging is an' intrinsic requirement of DML DMLs are observed, from which a number of attributes
measurement, especially when considering equalization, can be deduced, for example, those relating to imaging
as these transducers offer an almost omnidirectional po- when multiple arrays are employed.
larresponse together withdiffuseproperties. (One could The embedded crossover design function was also
argue that this new class of polar response is omnidif- demonstrated and a brief discussion given on the merits
fuse.) However, the contrary is true for most conven- of digital and active loudspeaker systems. This was used
tional loudspeakers, where these generally show much to illustrate the stochastic interleave-crossover align-
wider variations in frequency response over a measure- ment which, it is suggested, disperses the interference
ment sphere. Consequently any spatial averaging win- patterns in the off-axis frequency response, thus low-
dows have to be applied over a more restricted measure- ering polar-related coloration in the crossover region.
ment area with corresponding limitations on listening
postion and associated room interaction problems. Expe- 5 REFERENCES
rience suggests that the on-axis response forms the best
data in well-designed, conventional loudspeakers. [1] R: Greenfield and M. O. J. Hawksford, "Efficient
The method of filter design has proved efficient in Filter Design for Loudspeaker Equalization," J. Audio
terms of computational time, and using anIIRimplementa- Eng. Soc., vol. 39, pp. 739-751 (1991 Oct.).
tion to describe the impulse response tail would appear [2] M. O. J. Hawksford and R. G. Greenfield, "A
intuitively to offer advantage. However, in practice, Comparative Study of FIR and IIR Digital Equalization
comparing a pure FIR design with a pure HR design showed Techniques for Loudspeaker Systems," Proc. Inst.
little overall advantage where for an N-coefficient filter Acoust., vol. 12, pt. 8, pp. 77-86 (1990).
a good fit to the minimum-phase impulse response is [3] M. O. J. Hawksford, "Digital Signal Processing
achieved over about N samples in each case. It appears Tools for Loudspeaker Evaluation and Discrete-Time
that the total number of coefficients, irrespective of their Crossover Design," J. Audio Eng. Soc., vol. 45, pp.
distribution between the two filter sections, is the more 37-62 (1997 Jan./Feb.), Correction, ibid., vol. 45, p.
critical factor. As reported in earlier work [1], [2], the 497) (1997 June).
results demonstrate that by using a digital equalization [4] B. Stark, "Ein Fazit," in Das Lautsprecher Jahr-
filter, extremely accurate system performance is possi- buch 86/87, M. Gaedke, Ed. (Hifisound, Mfinster, Get-
hie, and that a wide range of target frequency responses many, 1986).
can be easily accommodated. [5] M. O. J. Hawksford, "Digital and Active Loud-
The two loudspeaker examples selected attempt to speaker Systems for High-Quality Monitoring," in Proc.
highlight some performance differences between a spec- Active 95 (1995 Int. Symp. on Active Control of Sound
ular radiator and a DML. In particular, the DML and Vibration, Newport Beach, CA, 1995 July 6-8),
minimum-phase impulse response showed good form, pp. 1247-1258.
although the excess-phase impulse response revealed an [6] "NXT," white paper, Huntingdon, UK.
extended noiselike structure in addition to a well- [7] T. W. Parks and C. S. Burrus, Digital FilterDe-
focused central response, confirming its temporally dif- sign (Wiley, New York, 1987), p. 226.
fuse nature. It is therefore suggested that DMLs probably [8] A. Rimell and M. O. J. Hawksford, "Reduction
exhibit low spatial variation in both the initial period of of Loudspeaker Polar Response Aberrations through the
the minimum-phase impulse response and the central Application of Psychoacoustic Error Concealment,"IEE
period of the excess-phase impulse response (where Proc. Vision Image Signal Process., vol. 145, pp.
these responses also show low noise structure). How- 11-18 (1998 Feb.).
THE AUTHOR
Malcolm Hawksford is director of the Centre for investigated delta modulation and delta-sigma modula-
Audio Research and Engineering, a professor in the De- tion (now commonly known as "bitstream" coding) for
partment of Electronic Systems Engineering at the Uni- color television and the development of a time-
versity of Essex, and Postgraduate Scheme director, compression/time-multiplex system for combining lumi-
where his interests encompass audio engineering, elec- nance and chrominance signals, a forerunner of the
tronic circuit design, and signal processing. Professor MAC/DMAC video system.
Hawksford studied electrical engineering at the Univer- While at Essex University, he has undertaken research
sity of Aston in Birmingham where he gained a First principally in the fields of analog amplifiers, digital sig-
Class Honours B.Sc. and Ph.D. His Ph.D. program, hal processing, and loudspeaker systems. Since 1982
which was sponsored by a BBC Research Scholarship, research on digital crossover networks and equalization