Adjusting the Loudness of an Audio Signal with Perceived Spectral Balance Preservation
The loudness of an audio signal is adjusted while reducing changes in its perceived spectral balance, using a dynamically-controllable filter having a high-frequency response characteristic and a low-frequency response characteristic, controlled by dynamically-changing information on the desired gain in each of a plurality of frequency bands of the audio signal.
Latest Dolby Labs Patents:
This application claims priority to U.S. Provisional Patent Application No. 61/176,084 filed 6 May 2009, hereby incorporated by reference in its entirety.
BACKGROUND OF THE INVENTIONThe invention relates to audio signal processing, namely, to a low-complexity method or apparatus for adjusting the loudness of an audio signal in such a way as to preserve the perceived spectral balance of the audio signal. The invention also relates to a computer program, stored on a computer-readable medium, for causing a computer to perform the method. It also relates to a computer-readable medium storing thereon a computer program performing the method.
SUMMARY OF THE INVENTIONIn accordance with aspects of the present invention, the loudness of an audio signal is adjusted while reducing changes in its perceived spectral balance, by applying the audio signal to a dynamically-controllable filter having a high-frequency response characteristic and a low-frequency response characteristic, receiving dynamically-changing information as to the desired gain in each of a plurality of frequency bands of the audio signal that, when applied to the audio signal, tends to preserve perceived spectral balance as the loudness of the audio signal is varied, the information being in response to the audio signal and a desired loudness, wherein there are three or more frequency bands in juxtaposition with one another including an anchor band generally between the lower end of the frequency range in which the high-frequency response characteristic varies and the upper end of the frequency range in which the low-frequency response characteristic varies, a top band at the upper end of the frequency range in which the filter's response varies, and at least one band between the anchor band and the top band, and dynamically controlling the filter in response to the information, wherein the high-frequency response characteristic may be a variable shelf filter response and the low-frequency response characteristic may be a variable-slope response that has a boost/attenuation in the logarithmic domain that reduces monotonically below the anchor band, the variable shelf filter response being controlled in response to the desired gain in each of the three or more frequency bands and the variable-slope response being controlled in response to the desired gain in the anchor band.
The number of bands in the frequency range that includes the anchor band and the top band may be fewer than the number of the human ear's critical bands in that frequency range.
The desired gain in each band may be obtained by analyzing the input signal over a frequency range wider than that of the respective band. The desired gain in the anchor band is obtained by analyzing the input signal over a frequency range that includes frequencies between 500 kHz and 2 kHz.
The cutoff frequency of the variable shelf filter response may be responsive to the level of the audio signal with respect to a threshold of hearing.
The anchor band may be about 700 Hz to about 2 kHz.
The Audio Input is applied to a signal path and to a control path. The signal path may include first and second series-connected filters or filter functions (“Low-Frequency Filter”) 2 and (“High-Frequency Filter”) 4. Preferably, one of the filters or filter functions operates at low frequencies (frequencies generally below an “Anchor Band”, as discussed below) and the other filter or function operates at high frequencies (frequencies generally above the Anchor Band). Although they may be arranged in either order, Low Frequency Filter 2 is shown first in the signal path. Further details of the filters or filter functions are discussed below. The signal path includes a variable gain element 6, shown as a multiplier element or function in the Low-Frequency Filter 2 of the
In the control path of the
Control signals for controlling the Low Frequency Filter 2 and the High-Frequency Filter 4 in such a way as to obtain the desired Band Gains to be applied to the Audio Input signal (so as to produce the Audio Output signal) may be obtained from the Band Gains outputs of Compute Gains per Band 8 by a low-frequency filter control or controller process (“LF Control”) 10 and a high-frequency filter control or controller process (“HF Control”) 12. The LF Control 10 derives three control variables, including a gain factor G, from the Anchor Band gain. The HF Control 12 derives five control variables from the Anchor Band gain and the respective gains of at least two high-frequency bands. The number of control variables used to control the LF and HF filters may differ in alternative embodiments, inasmuch as alternative filter structures may require a different number of variable coefficients.
Aspects of the present invention include the recognition that a variable-loudness spectral-balance-preserving Audio Output signal may be obtained by approximating a complex ideal filter response with the response of simple low frequency and high frequency filter characteristics and by employing as few as three Band Gains, one for the Anchor Band and two or more for frequency bands higher than the Anchor Band, for controlling the simple filter characteristics. For example,
In an exemplary embodiment employing five bands, the Band Gain values may correspond to the desired gain at the following frequencies:
BandFHz(1)=1 kHz (the Anchor Band)
BandFHz(2)=5 kHz
BandFHz(3)=9 kHz
BandFHz(4)=13 kHz
BandFHz(5)=17 kHz (the High Frequency Band)
The BandFHz(i) frequencies may refer to a substantially center frequency, or a representative frequency, for each band. For example, the Band Gain of the 2nd band (Band Gain(2)) may refer to the desired gain that ideally should be applied by the combination of the Low-Frequency Filter 2 and High-Frequency Filter 4 filter at 5 kHz. It will be appreciated that the gain of the low and high frequency filter combination in the frequency range from 3000 Hz to 7000 Hz may be approximately equal to Band Gain(2). The Band Gain value for the 2nd band may be derived from analysis of the input audio signal over a wider frequency range, with most weight given to frequencies between 1000 Hz and 9000 Hz, for example. In this analysis process, the signal power (in the 1000 to 9000 Hz band) may be used as an estimate of the Sound Pressure Level, and the desired loudness change may be applied according to the process described below in connection with
The Band Gain(1) value may have the following attributes:
-
- Band Gain(1) refers to the desired gain at 1 kHz. Band Gain(1) is the Anchor Gain because band 1 is the Anchor Band, and the Anchor Band frequency is 1 kHz in this example.
- The filter gain that is applied between 700 Hz to 2 kHz should be approximately equal to Band Gain(1).
- Below 700 Hz, the filter's response varies as a function of Band Gain(1), as shown in
FIG. 4 , namely, above the anchor band, the filter has a flat frequency response and below the anchor band it has a variable-slope response that has a boost/attenuation in the logarithmic domain that reduces monotonically below the anchor band. - The Band Gain(1) gain may be computed based on analysis of the input signal over a frequency range from approximately 300 Hz to 4 kHz. The lower limit of this frequency range may be determined by a high-pass filter with a cut-off frequency of 400 Hz, for example, but which may have a cut-off frequency in the range of 100 Hz to 1000 Hz. Alternatively, the high-pass filter may be omitted, so that the Band Gain(1) gain is computed based on analysis of the input signal over the frequency range from 0 Hz to 4 kHz.
The High Frequency Band is the band that corresponds to the highest frequency of interest in the filter. In the example bands listed above, BandFHz(5)=17 kHz, so that this band is intended to define the desired filter response over the range from 14 kHz to 20 kHz. This frequency is chosen so that the upper extremity of the band (20 kHz) is approximately equal to the upper limit of human audio perception (20 kHz), or the upper frequency limit of the audio system (which is generally limited by the sample-rate of the system). For example, the upper band center frequency of 17 kHz may be appropriate for audio systems operating at a sample rate of 44.1 kHz, 48 kHz, or 96 kHz, but an upper band frequency of 12 kHz may be appropriate in an audio system that is operating with a 32 kHz sample rate.
It will be appreciated that the frequency values relating to the various bands, including the Anchor Band and High Frequency Band are useful examples, but are not critical to the invention.
The behavior of the Low-Frequency Filter 2 is determined solely by the Band Gain value at the Anchor Band frequency, as shown in
In Equation 1.1, the Anchor Band gain and LFGain(f) values are both expressed on a logarithmic gain scale (such as dB). Although this equation represents a desired frequency response, a practical implementation may provide an approximation to this response. One possible method of implementation is shown in
In the example of
Equations 1.2 provide fixed values for the poles of the LF Filter 2. The gain, G, is computed by converting the Anchor Band gain (in dB) into a linear gain value. The f1 and f2 coefficients are computed by a pair of polynomials that have been derived by an optimization process, to provide a suitable match to the desired frequency response curves. These polynomials provide a reasonable match to the desired curves for Anchor Band gain values between −60 and +40 dB. The f1 and f2 polynomials are plotted in
In the high frequency range, the behavior of the High-Frequency Filter 4 may be determined by Band Gain values such as shown in
Unlike the Low-Frequency Filter 2 characteristics, the High-Frequency Filter 4 characteristics preferably are determined from a larger set of parameters. As previously described, the Low-Frequency Filter 2 characteristics are entirely determined by the gain at the Anchor Band frequency (see
-
- 1. The shelf filter's response at the Anchor Band ideally matches the desired Anchor Band gain.
- 2. At high frequencies (above the Anchor Band), the gain of the shelf response ideally is constrained between 0 dB and the Anchor Band gain.
- 3. The transition frequency of the shelf filter is higher than the Anchor Band frequency.
The process of determining the desired shelf-filter characteristics may operate as follows. One may define a 2nd order shelf filter in terms of its low-frequency gain (in dB), its high-frequency gain (in dB), and the shelf transition frequency (in Hz). These quantities may be referred to herein as ShelfGainLo, ShelfGainHi and ShelfFHz. The procedure may be expressed as follows:
1. Define a clip( ) function as follows:
2. Sort a set of Band Gain values in order of increasing frequency:
BandGain(i):i=1 . . . NoBands,
where Band Gain(1) is the Anchor Band gain (Anchor Band gain), and Band Gain(NoBands) is the gain of the Top Band (indicated by the circle with a cross in
Band Gain(i) represents the desired filter gain at frequency BandFHz(i), and one may rely on the simplifying assumption that these BandFHz(i) values form an arithmetic progression (i.e. they are evenly spaced on a linear frequency scale).
3. Compute:
ShelfGainLo=BandGain(1)
ShelfGainHi=clip(BandGain(NoBands),BandGain(1),0)
or, alternatively:
ShelfGainLo=BandGain(1)
ShelfGainHi=clip(BandGain(NoBands),BandGain(1),α×BandGain(1))
Where α is typically in the range [0 . . . ½]
4. Compute (for b=2 . . . NoBands-1):
5. And finally, compute:
In Step 3, one may use the Anchor Band gain and the TopBand gain as the low- and high-frequency shelf gains, respectively.
The constant, α, introduced in Step 3 is intended to provide a limit to the shelf filter's high frequency gain as shown in
In Step 4, one may normalize the gains of the intermediate bands (those bands between the Anchor Band and the Top Band), and clip them to lie in the range 0.1. Hence, NormBand(b)=1 indicates that this band has a gain equal to the Anchor Band gain, and NormBand(b)=0 indicates that this band has a gain equal to the TopGain.
When one sums all of the NormBand(b) values together, the end result is ShelfFrel which has a value between 0 and (NoBands-2), where ShelfFrel=0 indicates that the shelf filter should have a transition frequency at the low end of the frequency range, and ShelfFrel=(NoBands-2) indicates that the shelf filter should have a transition frequency at the high end of the frequency range.
Step 5 converts ShelfFrel to Hz.
Once one has computed ShelfGainLo, ShelfGainHi and ShelfFHz, the shelf filter may then be designed using any of various known techniques. For example, the High-Frequency Filter 4 may be implemented with biquad filter structure, constituting a 2nd order IIR filter, such as shown in
The coefficients for this biquad may be computed via MATLAB code shown below (MATLAB is a computer tool widely used in the audio arts and is a trademark of The MathWorks, Inc.):
The above script makes use some inbuilt Matlab functions, including bilinear( )) and zp2tp( ) These functions are documented by Mathworks, and are well known in the art.
Operating PrinciplesThe example of
In order to modify the perceived loudness of an audio signal (by a prescribed loudness ratio), one may represent this as a prescribed shift up or down on the log(Loudness) axis of
-
- 1. Measure the amplitude of the input signal (for example, rms amplitude) in one frequency band (for example, a band of frequencies centered around 1 kHz), and mark this amplitude on the horizontal axis (Input Signal Amplitude)
- 2. Using the amplitude-to-loudness curve of
FIG. 8 , convert this amplitude to a corresponding loudness value on the vertical axis. - 3. Add/subtract the desired loudness change (ΔL=log(0.5)) to compute the desired Output Loudness (for this frequency band).
- 4. Convert this Desired Output Loudness back to amplitude, to compute a desired Output Signal Amplitude.
- 5. The difference between the Input Signal Amplitude and the Output Signal Amplitude is the Gain that one needs to apply to this audio band in order to modify its loudness by the desired ΔL.
If the amplitude of the Audio Input and Audio Output signals are sufficiently loud (above the Linearity Threshold) in all frequency bands, then the linear nature of the amplitude-loudness curve means that:
Gain=αn×ΔL. (1.3)
The scale factor, an, is the Nominal Loudness to Gain scale factor and is generally equal to 1.7, for signals at or above 1 kHz. This is a ratio of logarithmic quantities (it converts log(Loudness) to log(Gain)). Thus, in order to multiply loudness by 2, one requires a gain of 21.7≈3.25 (about 10 dB).
For lower frequency signals, the Loudness to Gain scale factor is lower (because the slope of the amplitude-loudness curve is steeper for lower frequencies (see
The reduction in log(Gain) applied at low frequencies may be designated “LFGainFactor”. Thus, at frequencies below 1 kHz, one may use the following equation:
GainLF(f)=LFGainFactor(f)Δαn×ΔL (1.4)
One should also be aware of the non-linear fall-off of the amplitude-loudness curves at low amplitude levels (the region below the Linearity Threshold in
If one looks at the spectrum of a typical audio signal (with the spectrum plotted in terms of energy per octave), one typically sees very low signal levels in the high frequencies. As a result, the gain applied at these higher frequencies (where the amplitude has fallen below the Linearity Threshold) reduces to 1 (i.e., the log(Gain) reduces to zero).
As shown in the upper portion of
The invention may be implemented in hardware or software, or a combination of both (e.g., programmable logic arrays). Unless otherwise specified, the algorithms included as part of the invention are not inherently related to any particular computer or other apparatus. In particular, various general-purpose machines may be used with programs written in accordance with the teachings herein, or it may be more convenient to construct more specialized apparatus (e.g., integrated circuits) to perform the required method steps. Thus, the invention may be implemented in one or more computer programs executing on one or more programmable computer systems each comprising at least one processor, at least one data storage system (including volatile and non-volatile memory and/or storage elements), at least one input device or port, and at least one output device or port. Program code is applied to input data to perform the functions described herein and generate output information. The output information is applied to one or more output devices, in known fashion.
Each such program may be implemented in any desired computer language (including machine, assembly, or high level procedural, logical, or object oriented programming languages) to communicate with a computer system. In any case, the language may be a compiled or interpreted language.
Each such computer program is preferably stored on or downloaded to a storage media or device (e.g., solid state memory or media, or magnetic or optical media) readable by a general or special purpose programmable computer, for configuring and operating the computer when the storage media or device is read by the computer system to perform the procedures described herein. The inventive system may also be considered to be implemented as a computer-readable storage medium, configured with a computer program, where the storage medium so configured causes a computer system to operate in a specific and predefined manner to perform the functions described herein.
A number of embodiments of the invention have been described. Nevertheless, it will be understood that various modifications may be made without departing from the spirit and scope of the invention. For example, some of the steps described herein may be order independent, and thus can be performed in an order different from that described.
Claims
1. A method for adjusting the loudness of an audio signal while reducing changes in its perceived spectral balance, comprising
- applying the audio signal to a dynamically-controllable filter having a high-frequency response characteristic and a low-frequency response characteristic,
- receiving dynamically-changing information as to the desired gain in each of a plurality of frequency bands of the audio signal that, when applied to the audio signal, tends to preserve perceived spectral balance as the loudness of the audio signal is varied, the information being in response to the audio signal and a desired loudness, wherein there are three or more frequency bands in juxtaposition with one another including an anchor band generally between the lower end of the frequency range in which the high-frequency response characteristic varies and the upper end of the frequency range in which the low-frequency response characteristic varies, a top band at the upper end of the frequency range in which the filter's response varies, and at least one band between the anchor band and the top band, and
- dynamically controlling said filter in response to said information, wherein the high-frequency response characteristic is a variable shelf filter response and the low-frequency response characteristic is a variable-slope response that has a boost/attenuation in the logarithmic domain that reduces monotonically below the anchor band, the variable shelf filter response being controlled in response to the desired gain in each of said three or more frequency bands and the variable-slope response being controlled in response to the desired gain in said anchor band.
2. A method according to claim 1 wherein the number of bands in the frequency range that includes the anchor band and the top band is fewer than the number of the human ear's critical bands in that frequency range.
3. A method according to claim 1 or claim 2 wherein the desired gain in each band is obtained by analyzing the input signal over a frequency range wider than that of the respective band.
4. A method according to any one of claims 1-3 wherein the cutoff frequency of the variable shelf filter response is responsive to the level of the audio signal with respect to a threshold of hearing.
5. A method according to any one of claims 1-4 wherein said anchor band is about 700 Hz to about 2 kHz.
6. A method according to any one of claims 1-5 wherein the desired gain in the anchor band is obtained by analyzing the input signal over a frequency range that includes frequencies between 500 kHz and 2 kHz.
7. Apparatus comprising means adapted to perform the method of any one of claims 1 through 6.
8. A computer program, stored on a computer-readable medium, for causing a computer to perform the method of any one of claims 1 through 6.
9. A computer-readable medium storing thereon the computer program performing the method of any one of claims 1 through 6.
Type: Application
Filed: Apr 29, 2010
Publication Date: Jul 5, 2012
Patent Grant number: 8891789
Applicant: DOLBY LABORATORIES LICENSING CORPORATION (San Francisco, CA)
Inventor: David S. McGrath (Rose Bay)
Application Number: 13/265,693
International Classification: H03G 5/00 (20060101);