This invention pertains to the field of digital signal processing, and in particular to equalization and filtering, especially of audio signals.
In the recording, production and playback of audio, one important and widely used tool is equalization, the manipulation of signal level and phase as a function of frequency. Equalization may be used to correct problems in a recorded signal and for artistic purposes. Different genres of music can have characteristic power spectra, and equalization may be applied to program material so as to achieve the expected long-term power spectrum. In playback of audio, equalization may be used to compensate for resonances of a performance or listening space.
A common equalizer used for live sound and consumer playback is a so-called graphic equalizer, in which control is provided over the gain in each of a set of frequency bands. In a traditional graphic equalizer for audio shown in
This difficulty is well known, and in Justin Baird, Bruce Jackson and David McGrath, “Raised Cosine Equalization Utilizing Log Scale Filter Synthesis,” Audio Engineering Society 115th Convention, preprint 6257, San Francisco Calif., October 2004, Baird, et al. proposed making the band filters so-called mesa filters, rather than second-order sections, as is typical. Mesa filters have a prescribed band gain, crossfading to a gain of one outside the band. The crossfade approximates a raised cosine on a log-magnitude scale, and, as such, adjacent bands may be independently moved, with the system transfer function smoothly interpolating the band gains. The drawback is that the mesa filters are each made of seven parametric sections, and are costly to implement.
In another prior art approach proposed by Azizi (see Seyed-Ali Azizi, “A New Concept of Interference Compensation for Parametric and Graphic Equalizer Banks,” Audio Engineering Society 111th Convention, preprint 5482, New York N.Y., September 2001 and Seyed-Ali Azizi, “A New Concept of Interference Compensation for Parametric and Graphic Equalizer Banks,” Audio Engineering Society 111th Convention, preprint 5629, Munich Germany, May 2002), a correction filter 404 is added to the output of the equalizer, as shown in
Another prior art method proposed by Azizi in the cited references is a filter design method, where the parameters describing the center frequencies, bandwidths and gains are adjusted in an iterative constrained nonlinear optimization process so as to achieve the desired band gains. Drawbacks to this approach include the computational cost of the optimization which Azizi describes as not suitable for real-time use, and the more serious difficulty that the iteration might get stuck in a local minimum.
Other filter design methods, such as Prony or Hankel methods (see Julius O. Smith III, Techniques for Digital Filter Design and System Identification with Application to the Violin, Ph.D. thesis, Stanford University, 1983), can be used to closely match a given transfer function magnitude. They, however, are not easily adapted to psychoacoustically meaningful goodness-of-fit measures, which involve minimizing dB differences in transfer function magnitude over a Bark or ERB frequency scaling. Those methods that apply psychoacoustic measures in designing filters can be computationally cumbersome due to the nonlinear optimization involved.
In any event, these design approaches are generally not useful for applications such as HRTF filtering (see E. M. Wenzel, “Localization in virtual acoustic displays,” Presence, 1:80-107, 1992), where the resulting filter needs to be slewed or interpolated between tabulated designs. The reason is that the poles and zeros maximizing a goodness-of-fit rarely can be related to particular features in the desired transfer function magnitude. As a result, there is often no clear way to process sets of tabulated filter coefficients that leads to a meaningful filter intermediate between table entries.
There remains a need in the art, therefore, to develop a graphic equalizer which interpolates the prescribed band gains, is computationally efficient to implement, and is parameterized in such a way that it may be interpolated or slewed between tabulated designs.
A system and method according to the invention enables providing a graphic equalizer with desired attributes. According to one aspect, the present invention modifies the input gains so as to account for the interference between adjacent bands. By adjusting the filter gains, the equalizer transfer function can be made to interpolate the desired band gains. In one embodiment of the present invention, the band gains and transition frequencies are used to compute a set of filter gains. The filter gains are then used to design the peaking and shelving filters which are cascaded to equalize the input signal. In another embodiment of the present invention, a set of band frequencies is specified, and a matrix computed. The filter gains are then formed as the product of the pre-computed matrix and the input gains. In another embodiment of the present invention, a set of shelf filters pre-filters the input before being sent to a cascade of peak and shelf sections. The cascade simply accounts for any deviations of the shelf filter set from the desired transfer function magnitude. Yet another embodiment of the present invention filters an input signal by a cascade of peaking and shelving filters specified by interpolating tabulated transition frequencies and gains according to an input table index. Using second-order sections parameterized by transition frequency and gain, as described herein, tabulated filter designs may be slewed or interpolated simply by crossfading the corresponding gains and transition frequencies.
These and other aspects and features of the present invention will become apparent to those ordinarily skilled in the art upon review of the following description of specific embodiments of the invention in conjunction with the accompanying figures, wherein:
The present invention will now be described in detail with reference to the drawings, which are provided as illustrative examples of the invention so as to enable those skilled in the art to practice the invention. Notably, the figures and examples below are not meant to limit the scope of the present invention to a single embodiment, but other embodiments are possible by way of interchange of some or all of the described or illustrated elements. Moreover, where certain elements of the present invention can be partially or fully implemented using known components, only those portions of such known components that are necessary for an understanding of the present invention will be described, and detailed descriptions of other portions of such known components will be omitted so as not to obscure the invention. In the present specification, an embodiment showing a singular component should not be considered limiting; rather, the invention is intended to encompass other embodiments including a plurality of the same component, and vice-versa, unless explicitly stated otherwise herein. Moreover, applicants do not intend for any term in the specification or claims to be ascribed an uncommon or special meaning unless explicitly set forth as such. Further, the present invention encompasses present and future known equivalents to the known components referred to herein by way of illustration.
The inventive methods described herein will be discussed with respect to digital filters configured as a cascade of second-order sections. Such filters can be used in graphic equalizers that are well known in the art. For example, many home and car audio systems have graphic equalizers that allow users to adjust power levels in a plurality of frequency bands for a desired effect during audio playback. The invention is not limited to this example, however.
It is understood, moreover, that the techniques discussed herein apply, with modifications that should be clear to those skilled in the art, to other digital and analog filter structures, such as lattice and ladder filters, other filter orders, and to any number of implementation platforms, such as signal processing microprocessors and other discrete time systems, as well as analog systems.
In general, the present invention recognizes that the construction of second-order peaking and shelving filters can be parameterized so that that, as a function of section gain, they possess approximately self-similar dB transfer-function magnitudes. This property enables the use of linear least-squares techniques to optimize the gains in a cascade of filter sections to match a desired dB transfer-function magnitude.
The basic approach of the present invention, therefore, is to modify the input gains using filters determined in accordance with the above recognition so as to account for the interference between adjacent bands. By adjusting the filter gains, the equalizer transfer function can be made to interpolate the desired band gains. This results in substantial improvement over the traditional approach of setting the filter gains to the input band gains, and adjusting filter bandwidth to trade between overshoot and ripple. It also adds no computational cost to the filtering.
The inventive approach is based on the further observation that second-order peaking and shelving filters can be made nearly self-similar on a log magnitude scale with respect to peak and shelf gain changes. By cascading such second-order sections, filters are formed which may be fit to dB magnitude characteristics via linear least-squares techniques. In some embodiments of the present invention, the filter gains are adjusted to match one point in each band; in other embodiments the fit is over an entire range of frequencies.
The approach of the present invention will now be described in more detail by first identifying certain features of peaking and shelving filters parameterized in certain ways.
The peak filter p(ω; λ, φ±) used here is characterized by a maximum gain λ, achieved somewhere between two transition frequencies φ− and φ+, at which the gain is sqrt(λ). The filter takes on a gain of one at DC and the band edge. The second-order infinite impulse response (IIR) digital filter
with coefficients given by
implements a peak (or notch) filter with maximum (or minimum) gain λ at a center frequency φc between the specified transition frequencies φ±, at which the filter takes on magnitude sqrt(λ). The center frequency φc and the inverse bandwidth Q may be written in terms of the transition frequencies φ± and peak gain λ,
In the case that φ++φ−=π, we have
By parameterizing the peak filter in this way, note that it is approximately self similar on a log magnitude scale, as illustrated in
α·log|p(ω; λ, φ±)|≈log|p(ω; λα, φ±)| (11)
Similarly, the low shelf filter s(ω, λ, φ) takes on a gain λ at DC, a gain of one at the band edge, and a gain sqrt(λ) at the specified transition frequency φ, as shown in
α·log|s(ω; λ, φ)|≈log|s(ω; λα, φ)| (12)
A high shelf filter taking on a gain λ at the band edge, with a DC gain of one is easily generated, and shares the approximate self similarity with the peak filter described above.
The first-order digital filter
with coefficients given by
a1=(ρ+α)/α0, (14)
b0=β0+ρβ1, (15)
b1=β1+ρβ0, (16)
where a0=1+ρα, and ρ=sin(φ/2−π/4)/sin(φ/2+π/4), and
β0=(λ0+λπ+α(λ0−λπ))/2, (17)
β1=(λ0−λπ+α(λ0+λπ))/2, (18)
with α=0 if λ0=λπ, and
η=(λπ+λ0)/(λπ−λ0), (19)
otherwise, is a shelf filter with DC gain λ0 , band edge gain λπ, and gain sqrt (λ0 λπ) at the transition frequency φ.
A second-order shelf filter may be formed by cascading two first-order shelf filters, each with half the desired dB gains. Second-order shelf filters may also be formed according to David P. Berners and Jonathan S. Abel, “Discrete-time shelf filter design for analog modeling, ” Audio Engineering Society 115th Convention, preprint 5939, New York, October 2003, or any number of other methods well known to those skilled in the art.
Having identified the features above, various embodiments of the invention will now be described in more detail. In one embodiment of the present invention, shown in
Consider a cascade of K peak and shelf filters g(ω; θ) having dB gains λk, k=1, . . . , K and transition frequencies φk, k=1, . . . , K−1 stacked in the column θ,
Because of the self similarity property, the dB magnitude of the cascade, denoted
is approximately linear in the filter gains. Stacking instances of γ(ω, θ) evaluated at a set of frequencies ωi to form the column γ, we have
γ≈Bλ, (23)
B=[σ1 σK π2 . . . πK−1], (24)
where the shelf filter and peak filter transfer function log magnitudes σ(ω; 1.0 dB; φk) and π (ω; 1.0 dB; φk−1, φk) are evaluated using filter gains of 1.0 dB at frequencies ωi, and stacked to form the basis matrix B.
Therefore, given a set of shelf and peak filters having specified transition frequencies, and positive definite weighting matrix W, the gains
{circumflex over (λ)}=(BTWB)−1BTWη (25)
will approximately minimize the weighted mean square difference between a desired dB magnitude response η and the shelf and peak filter cascade dB magnitude at the set of frequencies ωi, γ.
In one embodiment of the inventive system, for a graphic equalizer with K−1 fixed band edges, the frequencies ωi can be chosen as the K band centers, and the gains λ simply computed as the control gains η scaled by the basis inverse,
{circumflex over (λ)}=B−1η (26)
Accordingly, as shown in
Such a gain computation was used to produce the equalizations shown in
In one embodiment of the present invention, the band filters are made wider than their corresponding graphic equalizer transition frequencies, for example by a factor of 1.2. Doing so in conjunction with the traditional approach of using the band gains directly to design the band filters will result in a smooth equalizer magnitude, but with excessive overshoot. Computing the band gains according to (26) with such wide filters gives a smooth transfer function which still interpolates the bands.
Note that the basis inverse B−1 depends only on the band filter transition frequencies 1601, and therefore may be pre-computed and provided to an optimization block, as shown in the alternative embodiment of
To account for any discrepancies in the self similarity property, (25) may be solved iteratively, forming B using the gains from the previous solution. The example of
{circumflex over (λ)}(i+1)={circumflex over (λ)}(i)⊙B({circumflex over (λ)}(i))−1η (27)
where the operator in (27) is an element-by-element product.
In another embodiment of the present invention shown in
The design method above can be extended to modeling of arbitrary transfer functions if coupled with a technique for determining the required number of filter sections, and a basis for fixing the transition frequencies of those sections.
To enable feature extraction from the transfer function to be modeled, critical-band smoothing can first be applied. See Julius O. Smith III, Techniques for Digital Filter Design and System Identification with Application to the Violin, Ph.D. thesis, Stanford University, 1983. If significant extrema of the smoothed magnitude transfer function are tabulated, transition frequencies for the shelf and peak filters can be computed as the geometric means of those extrema frequencies. Alternatively, the transition frequencies can be assigned at points where the smoothed magnitude transfer function has zeros in its second derivative, or points of inflection.
Once the transition frequencies are determined, the gains η can be computed using (25). Here, however, a dense sampling of frequencies ωi is suggested (for example, spaced according to a Bark or ERB frequency scale) to produce the desired dB magnitude γ so as to ensure a good match across the entire audio band. The dimension of γ will greatly exceed the number of filter sections, and we will have an overdetermined least-squares problem. Rather than the resulting transfer function magnitude interpolating the desired magnitudes at the sampled frequencies, the transfer function will approximate the desired magnitude, minimizing the mean square dB difference.
This approach is illustrated in
In certain applications, it is desired to interpolate and slew among tabulated equalizations. In HRTF filtering, for example, a continuous direction of arrival indexes a set of filters tabulated at a discrete set of directions.
Although the present invention has been particularly described with reference to the preferred embodiments thereof, it should be readily apparent to those of ordinary skill in the art that changes and modifications in the form and details may be made without departing from the spirit and scope of the invention. It is intended that the appended claims encompass such changes and modifications.
The present application is based on, and claims priority from, U.S. Provisional Appln. No. 60/617,343, filed Oct. 8, 2004, commonly owned by the present assignee, the contents of which are incorporated herein by reference. This application is also related to commonly-owned and concurrently-filed U.S. application Ser. No. 11/249,162, the contents thereof also being incorporated herein by reference.
Number | Name | Date | Kind |
---|---|---|---|
6236731 | Brennan et al. | May 2001 | B1 |
6581080 | Richards | Jun 2003 | B1 |
20020033995 | Shimojoh et al. | Mar 2002 | A1 |
20040136554 | Kirkeby | Jul 2004 | A1 |
20050254564 | Tsutsui | Nov 2005 | A1 |
Number | Date | Country | |
---|---|---|---|
60617343 | Oct 2004 | US |