13
ID 86 Optimized Implementation of an Innovative Digital Audio Equalizer Marco Virgulti 1 Stefania Cecchi 1 Andrea Primavera 1 Laura Romoli 1 Francesco Piazza 1 Ferruccio Bettarelli 2 Emanuele Ciavattini 2 1 A3LAB, DII, Universit ´ a Politecnica delle Marche,Via Brecce Bianche, 60131 Ancona, Italy 2 Leaff Engineering, Via Pastore 10, 60027 Ancona, Italy Correspondence should be addressed to Stefania Cecchi ([email protected]) Abstract Digital audio equalization is one of the most common operations in the acoustic field, but its perfor- mance depends on computational complexity and filter design techniques. Starting from a previous FIR implementation based on multirate systems and filterbanks theory, an optimized digital audio equalizer is derived. The proposed approach employs IIR filters to improve the filterbanks structure developed to avoid ripple between adjacent bands. The effectiveness of the optimized implementation is shown com- paring it with the previous approach. The solution presented here has several advantages increasing the equalization performance in terms of low computational complexity, low delay, and uniform frequency response.

Optimized implementation of an innovative digital audio equalizer

Embed Size (px)

DESCRIPTION

Digital audio equalization is one of the most common operations in the acoustic field, but its performance depends on computational complexity and filter design techniques. Starting from a previous FIR implementation based on multirate systems and filterbanks theory, an optimized digital audio equalizer is derived. The proposed approach employs IIR filters to improve the filterbanks structure developed to avoid ripple between adjacent bands. The effectiveness of the optimized implementation is shown comparing it with the previous approach. The solution presented here has several advantages increasing the equalization performance in terms of low computational complexity, low delay, and uniform frequency response.

Citation preview

Page 1: Optimized implementation of an innovative digital audio equalizer

ID 86

Optimized Implementation of anInnovative Digital Audio EqualizerMarco Virgulti1 Stefania Cecchi1 Andrea Primavera1 Laura Romoli1

Francesco Piazza1 Ferruccio Bettarelli2 Emanuele Ciavattini2

1A3LAB, DII, Universita Politecnica delle Marche,Via Brecce Bianche, 60131 Ancona, Italy

2Leaff Engineering, Via Pastore 10, 60027 Ancona, Italy

Correspondence should be addressed to Stefania Cecchi ([email protected])

AbstractDigital audio equalization is one of the most common operations in the acoustic field, but its perfor-mance depends on computational complexity and filter design techniques. Starting from a previous FIRimplementation based on multirate systems and filterbanks theory, an optimized digital audio equalizeris derived. The proposed approach employs IIR filters to improve the filterbanks structure developed toavoid ripple between adjacent bands. The effectiveness of the optimized implementation is shown com-paring it with the previous approach. The solution presented here has several advantages increasingthe equalization performance in terms of low computational complexity, low delay, and uniform frequencyresponse.

Page 2: Optimized implementation of an innovative digital audio equalizer

IntroductionDigital audio equalization is one of the most common operations in the acoustic field, but its performanceis strictly related to the adopted filter design techniques.

The equalization purpose is to enhance the listening experience, preserving a linear phase responsewith the lowest delay and the lowest computational complexity.In order to have linear phase response, FIR filters are usually employed both in time and frequencydomain.

State of the art

An efficient digital equalizer can be implemented using:a tree structured filter bank [1]: the analysis filter bank was built with equal stages splitting the inputsignal in two subbands while the synthesis filter bank has to recombine back the bands.☛

✠Drawbacks: too high delay that exponentially increases with the number of subbandsa frequency masking technique [2]; computationally efficient techniques for the design of sharplow-pass, high-pass, band-pass, and band-stop filters with arbitrary passband.☛

✠Drawbacks: the introduced delay dramatically increases with stricter constraints.Remez algorithm [3]: when the response of adjacent bands are added together, if the compositefrequency response shows an unacceptable error deviations, a new filter with a new stopband cutofffrequency has to be designed.☛

✠Drawbacks: This procedure is iterated until the deviation becomes acceptable resulting in a too highcomputational complexity.a frequency domain algorithm [4]: the equalization consists of a complex multiplication of the inputspectrum with the frequency equalization function that, when transformed in time domain, has all theproperties of a FIR filter. The computational complexity is very low.☛

✠Drawbacks: the algorithm efficiency is strictly bound to frequency resolution (e.g,large ripples atbands edges are easily observed).

Page 3: Optimized implementation of an innovative digital audio equalizer

IntroductionThe main disadvantages of these approaches are the too high delay and the ripples in the frequencyresponse, when adjacent bands are added.A possible solution could arise from the multirate techniques applied to adaptive systems.In this context, the problem of aliasing cancellation when an adaptive filtering is included in afilterbank with perfect reconstruction is well-known.Different approaches were presented such as cross terms between subbands [5] or extra terms takinginto account adjacent bands [6].

Starting from these approaches, an innovative digital audio equalizer has been introduced in [7, 8].Taking into consideration multirate systems and their property, the idea was to realize a linear phaseFIR equalizer that overcame the well-known drawbacks.

Therefore, an optimized version of this algorithm is here proposed:it is based on the use of IIR filters capable to reduce the required computational complexity preservingthe audio quality [9, 10].the overall scheme of the algorithm derives from two analysis and two synthesis cosine modulatedfilter banks properly combined in order to have flat response when all bands are added together,exploiting multirate properties (as for the FIR approach).

The new technique preserve all the characteristics of the previous implementation overcoming all thewell-known problems documented in the literature, furthermore reducing the computational complexityand improving the filters selectiveness.

Page 4: Optimized implementation of an innovative digital audio equalizer

Proposed Algorithms

Main idea

The main idea of the proposed approach is to realize an innovative equalizer using a particular filterbank structure, capable of reducing ripples in the frequency response, when adjacent bands are addedtogether.

is derived from the subband adaptive filtering structure presented in [11, 6],a double analysis/synthesis filter banks is combined employing multirate propertiesstarting from this, it is possible to obtain an innovative equalizer having all the advantages of thisparticular solution [8, 7].

The impulse responses of the analysis/synthesis filters are the following,

hk(n) = 2h0(n)cos(π

M(k + 0.5)(n − N

2) + θk)

fk(n) = 2h0(n)cos(π

M(k + 0.5)(n − N

2)− θk)

(1)

where θk = −(1)k π4 , k is the subband index defined between 0 and M −1, M is the number of subband,and N is the order of the prototype filter h0(n).

Using this particular structure,it is possible to significantly reduce the ripple amounts difference in the transition band betweenadjacent filters[8, 7];it is easily extended to higher number of bands.increasing the number of subbands, the FIR length has to be increased in order to have goodperformance at low frequency bands.

For this reason, a new solution has been proposed taking adva ntage of IIR filters.

Page 5: Optimized implementation of an innovative digital audio equalizer

FIR based equalizer

The FIR Equalizer has been designedusing Eq.(1)developing h0(n) has a FIR filter prototype.

A near perfect reconstruction proto-type realized by Kaiser Windows method[12], with very low computational cost.This technique modifies the 6-dB cut-off frequencyof the filter in order to obtain the 3-dB cut-off fre-quency placed approximately at π/2M.

The function minimized is the following:

ξ = ||H(ejπ/2M)| − 1√2|. (2)

H is the frequency response of the following filter

h[n] =sin((n − N/2)ωc,6dB)

π(n − N/2)w [n], (3)

where w [n] is a Kaiser window and ωc,6−dB is thecut-off frequency.

Figure 1: Overall structure of the proposed equalizer

Page 6: Optimized implementation of an innovative digital audio equalizer

IIR-based equalizer

The IIR Equalizer has been designedusing Eq.(1)developing h0(n) has a IIR filter prototype.

Also in this case, a near perfect reconstruction pro-totype has been considered[9, 10].The IIR prototype filter is defined as

H(z) =2M−1∑

k=0

z−kPk(z2M), (4)

where Pk(z) is the k-th type-I polyphase compo-nents of H(z), assuming that

Pk(z) =Nk(z)D(z)

(5)

for k = 0, 1, · · · , 2M − 1.

The polyphase component can be obtained usingthe two channel cascaded lattice structure [10] asshown in Fig.2.

The following structure is obtained by replacing z−1

of the classical FIR lattice structure with a firstorder all-pass filter [9]

ck,m

-ck,m

sk,m

sk,m

+

+Am(Z)

P(m-1)(z)k

P(m-1)(z)M+k

P(m)(z)k

P(m)(z)M+k

Figure 2: IIR lattice structure for design of Pk(z)

The relation between each section is given by thefollowing equations:

Pmk (z) = ck ,mPm−1

k (z) + sk ,mAm(z)Pm−1M+k (z)

PmM+k(z) = sk ,mPm−1

k (z)− ck ,mAm(z)Pm−1M+k (z)

(6)where ck ,m = cos(θk ,m) and sk ,m = sin(θk ,m).

Page 7: Optimized implementation of an innovative digital audio equalizer

IIR-based equalizerTo satisfy the condition that all the polyphase com-ponents have the same denominator as shown inEq.(5), the same all-pass filters must be used in allthe lattice structures.

It is defined as follows:

Am(z) =am + z−1

1 + amz−1, (7)

for m ≥ 1, k = 0, 1, · · · ,M/2 − 1 and considering|ai | < 1 for i = 1, 2, · · · ,m to ensure the filter stabil-ity.

Then the optimization is performed considering theminimization of the stop-band energy using the fol-lowing objective function:

φ =

∫ π

π/(2M)+δ

∣H(ejω)

2dω (8)

where δ < π/(2M).The final length of the optimized filter is 2mM, wherem is the number of lattice section and M is the sub-bands number.

0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5−120

−100

−80

−60

−40

−20

0

20

Frequency (Normalized)

Mag

nitu

de (

dB)

Figure 3: Magnitude response of the 16-channel IIR filterbank.

Page 8: Optimized implementation of an innovative digital audio equalizer

Real Time implementation

The equalizer has been implemented as a PlugInof the NU-Tech software [7, 13].NU-Tech is a DSP platform to implement, test,and tune algorithms in real-time scenariosthrough a PC workbench.It is based on a plug-in architecture which tries toease the algorithm writing process.NU-Tech gives the developer the freedom to writehis own NUTSs (NU-Tech Satellites) in C++, plugthem into the GUI, and test the final result on acommon PC.A low-level ASIO 2.2 interface allows minimumand repeatable latencies fully exploiting hardwareresources.

Two PlugIn have been developed in order to bet-ter exploit the characteristics of the two struc-tures.

Figure 4: NU-Tech implementation of the FIR equalizer.

Figure 5: NU-Tech implementation of the IIR equalizer.

Page 9: Optimized implementation of an innovative digital audio equalizer

FIR based equalizerA FIR UFBEq (Uniform Filter Bank Equalizer) NUTshas been realized as a standard C++ dll file able towork within the NU-Tech framework.

FIR Filtering procedure

A Partitioned Convolution Overlap and Save algo-rithm has been implemented [7].This technique provides an efficient implementa-tion needed for real time applications, especiallywhen filters lengths are longer than the workingframesize of the platform.

Fig. 4 shows a uniform filter bank equalizer witheight bands.

To evaluate the performance, a white noise sig-nal with flat frequency response has been used:through the graphical interface it is possible to setthe gain of each individual band.

IIR based equalizerA IIR UFBEq (Uniform Filter Bank Equalizer) NUTshas been realized as a standard C++ dll file able towork within the NU-Tech framework.

IIR Filtering procedure

An optimized function of the IPP libraries [14] hasbeen considered.In particular, since the denominator is the same foreach band, this operation is performed separatelyin order to optmize the filtering operation.

In Fig. 5, a uniform filter bank equalizer with eightbands is shown.

As for the FIR equalizer, a white noise signal withflat frequency response has been used to evaluatethe performance: through the graphical interface itis possible to set the gain of each individual band.

Page 10: Optimized implementation of an innovative digital audio equalizer

Algorithm validation

Validation

Through a direct comparison between the FIR and the IIR Equalizer implementation [7, 8].4 cases have been considered with a different number of subbands (i.e.,M = 8, 16, 32, 64), and foreach case:

3 FIR filter prototypes of length N = 1024, 2048, 4096 [Plot (a),(b),(c)];3 IIR filter prototypes realized with m = 3, 4, 5 sections [Plot (d),(e),(f)].

0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.50

1

2

3

4

5

6

7

8

9

Frequency (Normalized)

Mag

nitu

de (

dB)

abcdef

i

0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.50

1

2

3

4

5

6

7

8

9

Frequency (Normalized)

Mag

nitu

de (

dB)

abcdef

ii

Figure 6: Equalizer for (i) M = 8, (ii) M = 16.

0.12 0.121 0.122 0.123 0.124 0.125 0.126 0.127 0.128 0.129 0.131.8

2

2.2

2.4

2.6

2.8

3

3.2

Frequency (Normalized)

Mag

nitu

de (

dB)

abcdef

i

0.12 0.121 0.122 0.123 0.124 0.125 0.126 0.127 0.128 0.129 0.133.8

4

4.2

4.4

4.6

4.8

5

5.2

Frequency (Normalized)

Mag

nitu

de (

dB)

abcdef

ii

Figure 7: Detail of Fig. 8 for (i) M = 8, (ii) M = 16.

Page 11: Optimized implementation of an innovative digital audio equalizer

Algorithm validationFIR prototype

good performance with a reduced number ofsubbandsincreasing the number of subbands, the length of1024 is no more sufficient to have a sharptransition band: longer FIR prototype arerequested.

IIR prototype

good performance also with a small number ofsections (i.e., m = 3),it preserve its behaviour increasing the number ofthe subbands.a computational saving with a good performancelevel.

0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.50

1

2

3

4

5

6

7

8

9

Frequency (Normalized)

Mag

nitu

de (

dB)

abcdef

i

0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.50

1

2

3

4

5

6

7

8

9

Frequency (Normalized)

Mag

nitu

de (

dB)

abcde

ii

Figure 8: Equalizer for (i) M = 32 and (ii) M = 64.

0.154 0.1545 0.155 0.1555 0.156 0.1565 0.157 0.1575 0.158 0.1585 0.1591.8

2

2.2

2.4

2.6

2.8

3

3.2

Frequency (Normalized)

Mag

nitu

de (

dB)

abcdef

i

0.155 0.1555 0.156 0.1565 0.157 0.15753.8

4

4.2

4.4

4.6

4.8

5

5.2

Frequency (Normalized)

Mag

nitu

de (

dB)

abcde

ii

Figure 9: Detail of Fig. 8 for (i) M = 32 and (ii) M = 64.

Page 12: Optimized implementation of an innovative digital audio equalizer

Algorithm validationObjective measurements

A distortion index to have a direct comparison be-tween different equalizer with different number ofbands:

DI =max

∣T (ejω)

∣+ min

∣T (ejω)

2. (9)

with the distortion transfer function [15], calculatedas follows

T (z) =1M

M∑

i=1

Hi(z)Fi(z) (10)

where Hi and Fi are the frequency responses of theanalysis and synthesis filter banks, respectively.

This index takes into account the amplitude distor-tion of each band: better performance is achievedwhen it is approximately 1.

FIR lengths (N)M 1024 2048 40968 0.997946 0.998508 0.99785916 0.997946 0.998508 0.99785932 0.997947 0.998508 0.99785964 0.997946 0.998508 0.997860

Table 1: Distortion index for uniform M band equalizer with aFIR prototype of length N.

IIR sections (m)M 3 4 58 0.989940 0.990390 0.99038816 0.997324 0.995717 0.99758832 0.999378 0.999398 0.99939764 0.999773 0.999849 0.999846

Table 2: Distortion index for uniform M band equalizer with aIIR prototype of length 2nM, where n is the number of latticesections.

Good performance for all the considered prototype (i.e., the obtained values are very close to 1).Better performance (in terms of DI) for the IIR equalizer increasing the subbands number.The validity of the proposed approach is confirmed in comparison with the first FIR implementation.

Page 13: Optimized implementation of an innovative digital audio equalizer

ConclusionsA new approach to M-band uniform IIR equalizer has been presentedEmployment of IIR filters to improve the filter banks structure avoiding ripple between adjacent bands.Several advantages: increasing the equalization performance in terms of low computationalcomplexity, low delay, and uniform frequency response.Objective results as comparison with FIR structure confirm the validity of the proposed approach.

Future works will be oriented to an improvement in the project of the IIR prototype and to theintroduction of polyphase components in the filtering structure, exploiting the lattice structure behaviour.

References[1] J. Vieira, “Digital Five Band Equalizer with Linear Phase,” in Proc. 100th Audio Engineering Society Convention, Copenhagen, Denmark, May 1996.

[2] Y. Lim, “A Digital Filter Bank for Digital Audio Systems,” IEEE Trans. Circuits Syst., vol. 33, no. 8, pp. 848–849, Aug. 1986.

[3] J. Henriquez, T. Riemer, and R. Trahan Jr., “A Phase Linear Audio Equalizer: Design and Implementation,” J. Audio Eng. Soc., vol. 38, no. 9, pp. 653–666, Sept. 1990.

[4] H. Schopp and H. Hetzel, “A Linear Phase 512 Band Graphic Equalizer using the Fast Fourier Transform,” in Proc. 96th Audio Engineering Society Convention, Amsterdam, The Netherlands, Feb. 1994.

[5] A. Gilloire and M. Vetterli, “Adaptive filtering in subbands with critical sampling: analysis, experiments and application to acoustic echo cancellation,” IEEE Trans. Signal Process., vol. 40, no. 8, pp. 1862–1875,Aug. 1992.

[6] M. Petraglia and P. Batalheiro, “Non uniform Subband Adaptive Filtering with Critical Sampling,” in Proc. IEEE International Symposium on Circuits and Systems, vol. 56, no. 2, Island of Kos, Greece, May 2006,pp. 565–575.

[7] S. Cecchi, P. Peretti, L. Palestini, F. Piazza, F. Bettarelli, and A. Lattanzi, “Real Time implementation of an Innovative Digital Audio Equalizer,” in Proc. 123rd Audio Engineering Society Convention, New York, NY,USA, Oct. 2007.

[8] S. Cecchi, L. Palestini, E. Moretti, and F. Piazza, “A New Approach to Digital Audio Equalization,” in Proc. Workshop on Applications of Signal Processing to Audio and Acoustics, New Paltz, NY, USA, October2007, pp. 62–65.

[9] R. Koilpillai and P. Vaidyanathan, “Cosine-modulated fir filter banks satisfying perfect reconstruction,” Signal Processing, IEEE Transactions on, vol. 40, no. 4, pp. 770 –783, apr 1992.

[10] S. Kim and C. Yoo, “Highly selective m-channel iir cosine-modulated filter banks,” Electronics Letters, vol. 39, no. 20, pp. 1478 – 1479, oct. 2003.

[11] M. Petraglia, R. Alves, and P. Diniz, “New Structures for Adaptive Filtering in Subbands with Critical Sampling,” IEEE Trans. Signal Process., vol. 48, no. 12, pp. 3316–3327, Dec. 2000.

[12] F. Cruz-Roldan, P. Amo-Lopez, S. Maldonado-Bascon, and S. S. Lawson, “An Efficient and Simple Method for Designing Prototype Filters for Cosine-Modulated Pseudo-QMF Banks,” IEEE Signal Process. Lett.,vol. 9, no. 1, pp. 29–31, Jan. 2002.

[13] A. Lattanzi, F. Bettarelli, and S. Cecchi, “NU-Tech: The Entry Tool of the hArtes Toolchain for Algorithms Design,” in Proc. 124th Audio Engineering Society Convention, Amsterdam, The Netherlands, May 2008,pp. 1–8.

[14] “IPP Libraries,” Intel Corporation, 2011. [Online]. Available: http://software.intel.com/en-us/intel-ipp/

[15] P. P. Vaidyanathan, Multirate Systems and Filterbanks. Prentice-Hall, Inc., 1993.