Abstract:
The invention relates to modifying the loudness of an audio signal by measuring the weighted broadband level of the audio signal and modifying that weighted broadband level as a function of a spectral localization estimate of the audio signal.

Description:
CROSS-REFERENCE TO RELATED APPLICATIONS 
       [0001]    This application claims priority to U.S. Provisional Patent Application No. 61/174,468, filed 30 Apr. 2009, hereby incorporated by reference in its entirety. 
     
    
     FIELD OF THE INVENTION 
       [0002]    This invention relates to audio signal processing. In particular, the invention relates to modifying the loudness of an audio signal by measuring the weighted broadband level of the audio signal and modifying that weighted broadband level as a function of a spectral localization estimate of the audio signal. 
       SUMMARY OF THE INVENTION 
       [0003]    According to aspects of the present invention, a method for controlling the loudness of an audio signal comprises receiving an audio signal, generating an estimate of the spectral localization of the audio signal, generating a broadband measure of loudness of the audio signal, modifying said broadband measure of loudness in response to an estimate of the spectral localization of the audio signal, and modifying the broadband level of the audio signal in response to the modified broadband measure of loudness. Generating an estimate of the spectral localization of the audio signal may include determining the degree to which a majority of the audio signal&#39;s energy is within half of the signal&#39;s total audio bandwidth when a perceptual frequency banding scale is employed, which may, in turn, include dividing the audio signal into a plurality of frequency bands and generating a scaling factor in response to the relative level in two frequency bands. The modified broadband measure of loudness may be temporally smoothed and the broadband level of the audio signal may be modified in response to the smoothed modified broadband measure of loudness. The temporal smoothing may have one or more time constants useful for syllabic speech processing. The two frequency bands may be the bands having the second largest and largest level power values. The two frequency bands may be the two lowest frequency bands. Generating a broadband measure of loudness of the audio signal may determine the broadband measure of loudness of the audio signal after its processing by a weighting filter. The broadband measure of loudness and the level in two or more of the frequency bands may each be based on short-term levels. 
         [0004]    Although in principle the invention may be practiced either in the analog or digital domain (or some combination of the two), in practical embodiments of the invention, audio signals are represented by samples in blocks of data and processing is done in the digital domain. 
         [0005]    In  FIGS. 1 and 2 , essentially identical devices and functions bear the same reference numeral when they appear in multiple figures. Modified devices and functions are distinguished by a prime (′) or double prime (″) symbol. 
         [0006]      FIG. 1  is a functional schematic block diagram of an arrangement for controlling the loudness of an audio signal according to aspects of the present invention. The arrangement receives the audio signal and applies it to two paths: a control path and a signal path. In the control path, the loudness of the audio signal is measured in a Measure Loudness device or function  2 . The resulting measure of loudness is applied to a Modify Loudness device or function  4  that uses the measure of loudness and one or more “Loudness Modification Parameters” to create a gain value that when multiplied with the original audio signal, as in multiplier  8 , produces a modified audio signal having a desired modified loudness. The audio signal in the signal path may be delayed by a delay  6  to match latency incurred in Measure Loudness  2  and Modify Loudness  4 . Although the arrangement may operate uninterruptedly, intermittently, or just once for a finite length audio signal, for the examples described herein, the audio signal may be processed intermittently in consecutive time interval blocks of approximately 5 to 20 milliseconds—however, such a block length is not critical to the invention. 
         [0007]    Modify Loudness  4  includes a loudness versus gain characteristic that outputs a gain value in response to the input loudness measure and one or more loudness modification parameters. The Loudness Modification Parameters may select and/or modify the loudness-versus-gain characteristic. The resulting gain value may, for example, impose a dynamic range modification on the audio signal by, for example, applying compression and/or expansion as the loudness measure changes dynamically. 
         [0008]    Measure Loudness  2  employs a weighted-level-based loudness measurement. The audio signal is passed through a weighting filter  10 , for example an A-, B-, or C-weighting filter, that emphasizes more perceptually relevant audio frequencies and de-emphasizes less perceptually relevant frequencies. At each time interval (a block, in this example), the broadband level (typically, broadband power) of the audio signal is calculated in Level Calculation device or function  12  and, optionally, temporally smoothed in Smoothing device or function  14  to produce a time-smoothed broadband power measurement, which is a measure of loudness. By “broadband” is meant the entire frequency band or spectrum of the audio signal (full bandwidth audio) or substantially the entire frequency band (in practical implementations, band limiting filtering at the ends of the spectrum is often employed). If the goal is to modify the loudness of the audio signal over time, smoothing in Smoothing  14  may be performed with time constants commensurate with perceptual temporal smoothing of loudness. For example, a temporal smoothing having an attack time of 15 ms and a release time of 50 ms may be employed. However, those time constants are not critical to the invention and other values may be used. 
         [0009]    The inventor has determined that weighted level (typically, power) measurements such as performed by Weighting Filter  10  and Level Calculation  12 , as described below, significantly overrate spectrally localized signals. In other words, when a short-term (a time commensurate with the block time interval, 5 to 20 ms, in the above example) loudness measurement based on weighted level is calibrated to match subjective loudness estimates for average and spectrally complex audio signals, spectrally localized signals are measured as being significantly louder than corresponding subjective loudness estimates and are treated disproportionately to other signals. For example, in the case of loudness-based dynamics processing, the result may be that more gain change is applied to spectrally localized signals than is necessary. 
         [0010]    Still referring to the example of  FIG. 1 , in parallel to the weighted broadband level measurement performed in Weighting Filter  10  and Level Calculation  12 , the audio signal is applied to a Filterbank device or function  16  that splits the audio signal into a multiplicity of frequency bands. A Spectral Localization device or function  18  determines how spectrally localized the audio signal is and calculates a loudness-reducing scale factor. The scale factor is multiplied by the broadband signal level estimate in order to lower the loudness estimate as the audio signal becomes more and more spectrally localized. The resulting lowered broadband level estimate is optionally smoothed in Smoothing  14  as described above. The optionally smoothed broadband level estimate, which is a measure of loudness, is applied to Modify Loudness  4  that produces a gain value for use in producing the loudness-adjusted modified audio signal. 
         [0011]    By “spectral localization” is meant a measure of narrowbandedness of the signal component distribution in the bandwidth of an audio signal undergoing processing. For the purposes of this invention, a signal may be considered narrowbanded or spectrally localized when the majority of its energy is within half of the human auditory bandwidth of 20 Hz to 20 kHz when a perceptual frequency banding scale such as ERB or critical band (Bark) scaling is employed. In an example of a practical embodiment found to be useful, the human auditory bandwidth may be divided into five bands, as shown in  FIG. 4 , and the audio signal considered to be narrowbanded or spectrally localized when a majority of the signal&#39;s energy is in one of the bands, which would be less than half of the signal&#39;s total audio bandwidth on a Bark scale. It is not critical to the invention to determine narrowbandedness or spectral localization in the manner of the example. Other ways of determining narrowbandedness or spectral localization may be usable. 
         [0012]      FIG. 2  is a functional schematic block diagram showing an example of a variation of the arrangement of  FIG. 1  in which Measure Loudness  2 ′ differs from Measure Loudness  2  of  FIG. 1 . In this  FIG. 2  example, the weighted audio signal rather than the unweighted audio signal provides the input to Filterbank  16 . This alternative arrangement has a few benefits. First, the Weighting Filter  10  acts as a DC blocking filter, reducing the effects of DC signals interfering with the Filterbank  16  and Spectral Localization  18  calculations. Second, it provides a more perceptually relevant audio signal to the Filterbank  16  and Spectral Localization  18 , which leads to a final scaling factor that has been found to work better when the loudness of the audio signal is subsequently modified by the gain value in multiplier  8 . 
     
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         [0013]      FIG. 1  is a functional schematic block diagram of an arrangement for controlling the loudness of an audio signal in accordance with aspects of the present invention. 
           [0014]      FIG. 2  is a functional schematic block diagram showing an example of a variation of the example of  FIG. 2  in which Measure Loudness  2 ′ differs from Measure Loudness  2  of  FIG. 1 . 
           [0015]      FIG. 3  is an idealized response characteristic (gain versus frequency) of a weighting filter that is suitable for use in the arrangements of  FIGS. 1 and 2 . 
           [0016]      FIG. 4  shows idealized filter response characteristics (power response versus frequency) of bands in a Filterbank  16 , the response characteristics being suitable for use in the arrangements of  FIGS. 1 and 2 . 
       
    
    
     DETAILED DESCRIPTION OF THE INVENTION 
       [0017]    Referring to the example of  FIG. 1 , the audio signal is filtered by a weighting filter  10  whose frequency response may, for example, be as shown in the idealized response of  FIG. 3 . The filter may have a first order highpass characteristic with a corner frequency at 300 Hz and a low frequency characteristic similar to other common A, B &amp; C weighting filters used in weighted power measures. The filter action may be represented as 
         [0000]        x ′( n )= H[x ( n )],  (1)
 
         [0000]    where the weighting filter input is x(n), the weighting filter output is x′(n) and the filter&#39;s transfer function is H. Although this weighting filter characteristic has been found to be useful, it is not critical to the invention and other weighting filter characteristics may be employed. 
         [0018]    Level Calculation  12  then computes the average sample (n) power over a block of N samples, where k is the block index. The Level Calculation may be represented as 
         [0000]    
       
         
           
             
               
                 
                   
                     P 
                      
                     
                       ( 
                       k 
                       ) 
                     
                   
                   = 
                   
                     
                       1 
                       N 
                     
                      
                     
                       
                         ∑ 
                         
                           n 
                           = 
                           0 
                         
                         
                           N 
                           - 
                           1 
                         
                       
                        
                       
                           
                       
                        
                       
                         
                           
                             
                               x 
                               ′ 
                             
                              
                             
                               ( 
                               n 
                               ) 
                             
                           
                           2 
                         
                         . 
                       
                     
                   
                 
               
               
                 
                   ( 
                   2 
                   ) 
                 
               
             
           
         
       
     
         [0019]    As explained further below, the Filterbank computes spectral band power values using the autocorrelation of the audio samples in the block k. More specifically, a sliding overlapping block of N+Q samples of the audio signal may be constructed, where Q samples overlap with the adjacent blocks, and are windowed by window function. The window function may be unity in the center and taper down toward zero at its edges to reduce edge related errors in the autocorrelation. A useful value for the overlap length Q may be 31 samples at 48 kHz, although this is not critical to the invention and other overlap lengths and sampling rates may be employed. The autocorrelation of the k windowed sample block may then be computed. This may be represented as 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       A 
                        
                       
                         ( 
                         
                           k 
                           , 
                           l 
                         
                         ) 
                       
                     
                     = 
                     
                       
                         1 
                         N 
                       
                        
                       
                         
                           ∑ 
                           
                             n 
                             = 
                             
                               0 
                               + 
                               1 
                             
                           
                           
                             N 
                             + 
                             Q 
                             - 
                             1 
                           
                         
                          
                         
                             
                         
                          
                         
                           
                             w 
                              
                             
                               ( 
                               n 
                               ) 
                             
                           
                           · 
                           
                             x 
                              
                             
                               ( 
                               n 
                               ) 
                             
                           
                           · 
                           
                             w 
                              
                             
                               ( 
                               
                                 n 
                                 - 
                                 1 
                               
                               ) 
                             
                           
                           · 
                           
                             x 
                              
                             
                               ( 
                               
                                 n 
                                 - 
                                 1 
                               
                               ) 
                             
                           
                         
                       
                     
                   
                    
                   
                     
 
                   
                    
                   
                     
                       
                         for 
                          
                         
                             
                         
                          
                         l 
                       
                       = 
                       0 
                     
                     , 
                     … 
                      
                     
                         
                     
                     , 
                     5 
                     , 
                   
                 
               
               
                 
                   ( 
                   3 
                   ) 
                 
               
             
           
         
       
     
         [0000]    where w(n) are windowed samples and where 1 is the autocorrelation lag index. 
         [0020]    The autocorrelation values A(k,l) may be transformed into band power values B using a matrix M, where b is the band index. Values for a sample rate of 48 kHz are suitable and may be rounded to 5 decimal places. 
         [0000]    
       
         
           
             
               
                 
                   
                     M 
                     = 
                     
                       [ 
                       
                           
                       
                        
                       
                         
                           
                             0.01051 
                           
                           
                             0.01889 
                           
                           
                             0.01447 
                           
                           
                             0.00920 
                           
                           
                             0.00454 
                           
                           
                             0.00143 
                           
                         
                         
                           
                             0.01640 
                           
                           
                             0.01262 
                           
                           
                             
                               - 
                               0.0111 
                             
                           
                           
                             
                               - 
                               0.01636 
                             
                           
                           
                             
                               - 
                               0.00528 
                             
                           
                           
                             0.00374 
                           
                         
                         
                           
                             0.02058 
                           
                           
                             0.01052 
                           
                           
                             
                               - 
                               0.02625 
                             
                           
                           
                             
                               - 
                               0.01667 
                             
                           
                           
                             0.00566 
                           
                           
                             0.00616 
                           
                         
                         
                           
                             0.02870 
                           
                           
                             
                               - 
                               0.0096 
                             
                           
                           
                             
                               - 
                               0.03827 
                             
                           
                           
                             0.01435 
                           
                           
                             0.00957 
                           
                           
                             
                               - 
                               0.00478 
                             
                           
                         
                         
                           
                             0.03576 
                           
                           
                             
                               - 
                               0.0358 
                             
                           
                           
                             
                               - 
                               0.02043 
                             
                           
                           
                             0.03320 
                           
                           
                             
                               - 
                               0.01532 
                             
                           
                           
                             0.00255 
                           
                         
                       
                        
                       
                           
                       
                       ] 
                     
                   
                    
                   
                     
 
                   
                    
                   
                     B 
                     = 
                     
                       
                         
                           M 
                           · 
                           A 
                         
                          
                         
                           
 
                         
                          
                         where 
                          
                         
                           
 
                         
                          
                         A 
                       
                       = 
                       
                         [ 
                         
                           
                             
                               
                                 A 
                                  
                                 
                                   ( 
                                   
                                     k 
                                     , 
                                     0 
                                   
                                   ) 
                                 
                               
                             
                           
                           
                             
                               … 
                             
                           
                           
                             
                               … 
                             
                           
                           
                             
                               
                                 A 
                                  
                                 
                                   ( 
                                   
                                     k 
                                     , 
                                     4 
                                   
                                   ) 
                                 
                               
                             
                           
                         
                         ] 
                       
                     
                   
                 
               
               
                 
                   ( 
                   4 
                   ) 
                 
               
             
           
         
       
     
         [0021]    A common method for calculating the power of an audio signal in a frequency band of interest is to filter the audio signal, and then calculate the autocorrelation of the filtered signal. The 0 lag of the autocorrelation is the band power. If the band filter is a FIR filter, the band power can be equivalently calculated as the dot product of the autocorrelation of the signal and the autocorrelation of the filter impulse response. Because both autocorrelation vectors are symmetrical, the dot product can be performed using one half of the each of the autocorrelation vectors—where the non-zero lag values are summed twice. Each row of the matrix M represents the one sided autocorrelation of a band filter. Non-zero lag values are doubled to effect the necessary double summation. Matrix M has one row for each band. In this example, five bands were found to produce useful results. The choice of the number of bands involves a tradeoff—although a small number of bands reduces complexity, when the number of bands is too small the arrangement may fail to detect narrowbandedness under common signal conditions. Suitable Filterbank  16  band filter power responses are shown in the idealized responses of  FIG. 4 . The matrix M implements these filters and also includes a scaling such that the “energy per ERB band” is the same from band to band. As is well known, the ERB scale is a psychoacoustic-based frequency mapping. In  FIG. 4 , the low “bump” at approximately 20 kHz is ripple from the 2 nd  band filter that is centered at approximately 8 kHz in this example. 
         [0022]    Because typical audio signals have more bass energy and less energy with rising frequency (similar to a pink noise signal), the first band nearly always has significantly more energy than all the other bands. To compensate for this situation, the band power of the first band preferably is reduced so as to be approximately similar to the others for commonly occurring signals by dropping its power by approximately 10 dB (×0.1). The result is the modified band power B′ that may be expressed as: 
         [0000]    
       
         
           
             
               
                 
                   
                     B 
                     ′ 
                   
                   = 
                   
                     { 
                     
                       
                         
                           
                             0.1 
                             · 
                             
                               B 
                                
                               
                                 [ 
                                 b 
                                 ] 
                               
                             
                           
                         
                         
                           
                             
                               where 
                                
                               
                                   
                               
                                
                               b 
                             
                             = 
                             0 
                           
                         
                       
                       
                         
                           
                             B 
                              
                             
                               [ 
                               b 
                               ] 
                             
                           
                         
                         
                           
                             
                               where 
                                
                               
                                   
                               
                                
                               b 
                             
                             &gt; 
                             0 
                           
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   5 
                   ) 
                 
               
             
           
         
       
     
         [0023]    After reducing band  1 , the Spectral Localization device or function  18  may then calculate the scaling factor as the ratio of the second largest and largest band power values, a simple calculation requiring low processing power and memory. The scaling factor may be constrained to be between approximately −7 dB (×0.2) and 0 dB. If the denominator of the ratio is zero, the division result is undefined and so the scaling factor D(k) is set to 1.0. 
         [0000]    
       
         
           
             
               
                 
                   
                     D 
                      
                     
                       ( 
                       k 
                       ) 
                     
                   
                   = 
                   
                     { 
                     
                       
                         
                           
                             max 
                              
                             
                               ( 
                               
                                 
                                   
                                     max 
                                      
                                     
                                       ( 
                                       
                                         B 
                                         ″ 
                                       
                                       ) 
                                     
                                   
                                   
                                     max 
                                      
                                     
                                       ( 
                                       
                                         B 
                                         ′ 
                                       
                                       ) 
                                     
                                   
                                 
                                 , 
                                 0.2 
                               
                               ) 
                             
                           
                         
                         
                           
                             
                               
                                 where 
                                  
                                 
                                     
                                 
                                  
                                 
                                   max 
                                    
                                   
                                     ( 
                                     
                                       B 
                                       ′ 
                                     
                                     ) 
                                   
                                 
                               
                               &gt; 
                               0 
                             
                              
                             
                                 
                             
                           
                         
                       
                       
                         
                           1.0 
                         
                         
                           
                             
                               where 
                                
                               
                                   
                               
                                
                               
                                 max 
                                  
                                 
                                   ( 
                                   
                                     B 
                                     ′ 
                                   
                                   ) 
                                 
                               
                             
                             = 
                             0 
                           
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   6 
                   ) 
                 
               
             
           
         
       
     
         [0000]    where B″=B′ not including max(B′). 
         [0024]    For typical audio signals that have roughly a pink-noise-shaped spectrum, the scaling factor D(k) is close to 1.0 and for spectrally localized signals is close to 0.2. 
         [0025]    Finally, a scaled weighted power measurement P D (k) may be calculated as the product of the weighted power measure the scaling factor: 
         [0000]        P   D ( k )= D ( k )· P ( k )  (7)
 
         [0026]    The scaled weighted power measure, optionally, may then be smoothed in Smoothing  14 . 
         [0027]    The calculation in Equation 6 may be further simplified by only considering the first (lowest in frequency) two bands (after reducing band  1 ). The scaling factor may be calculated as the ratio of the smaller to the larger of the first two band powers. As above, the scaling factor preferably is constrained to a range of between −7 dB and 0 dB. As above, if the denominator of the ratio is zero, the divide result is undefined and so the scaling factor is set to 1.0. 
         [0000]    
       
         
           
             
               
                 
                   
                     D 
                      
                     
                       ( 
                       k 
                       ) 
                     
                   
                   = 
                   
                     { 
                     
                       
                         
                           
                             max 
                              
                             
                               ( 
                               
                                 
                                   
                                     min 
                                      
                                     
                                       ( 
                                       
                                         
                                           
                                             B 
                                             ′ 
                                           
                                            
                                           
                                             ( 
                                             0 
                                             ) 
                                           
                                         
                                         , 
                                         
                                           
                                             B 
                                             ′ 
                                           
                                            
                                           
                                             ( 
                                             1 
                                             ) 
                                           
                                         
                                       
                                       ) 
                                     
                                   
                                   
                                     max 
                                      
                                     
                                       ( 
                                       
                                         
                                           
                                             B 
                                             ′ 
                                           
                                            
                                           
                                             ( 
                                             0 
                                             ) 
                                           
                                         
                                         , 
                                         
                                           
                                             B 
                                             ′ 
                                           
                                            
                                           
                                             ( 
                                             1 
                                             ) 
                                           
                                         
                                       
                                       ) 
                                     
                                   
                                 
                                 , 
                                 0.2 
                               
                               ) 
                             
                           
                         
                         
                           
                             
                               
                                 where 
                                  
                                 
                                     
                                 
                                  
                                 
                                   max 
                                    
                                   
                                     ( 
                                     
                                       
                                         
                                           B 
                                           ′ 
                                         
                                          
                                         
                                           ( 
                                           0 
                                           ) 
                                         
                                       
                                       , 
                                       
                                         
                                           B 
                                           ′ 
                                         
                                          
                                         
                                           ( 
                                           1 
                                           ) 
                                         
                                       
                                     
                                     ) 
                                   
                                 
                               
                               &gt; 
                               0 
                             
                              
                             
                                 
                             
                           
                         
                       
                       
                         
                           1.0 
                         
                         
                           
                             
                               where 
                                
                               
                                   
                               
                                
                               
                                 max 
                                  
                                 
                                   ( 
                                   
                                     
                                       
                                         B 
                                         ′ 
                                       
                                        
                                       
                                         ( 
                                         0 
                                         ) 
                                       
                                     
                                     , 
                                     
                                       
                                         B 
                                         ′ 
                                       
                                        
                                       
                                         ( 
                                         1 
                                         ) 
                                       
                                     
                                   
                                   ) 
                                 
                               
                             
                             = 
                             0 
                           
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   8 
                   ) 
                 
               
             
           
         
       
     
         [0028]    In addition to being slightly faster to compute, Equation 8 has been found to have sound quality benefits. One problem with Equation 6 is that during vocal singing, there can be instances of “ess” where not only the scaling factor rises toward 1.0, but the signal power also rises. The net effect is a dramatic increase in the power that can cause the downstream loudness processing to, in the case of dynamics processing, apply more gain reduction to the “ess” than is necessary. De-essing is a common tool of audio mixing but when over used, it can become perceptually annoying. Since Equation 8 only looks at the lower frequency bands, the scaling factor does not rise as quickly during the sibilance “ess” in vocal singing. 
       IMPLEMENTATION 
       [0029]    The invention may be implemented in hardware or software, or a combination of both (e.g., programmable logic arrays). Unless otherwise specified, algorithms and processes 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. 
         [0030]    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. 
         [0031]    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. 
         [0032]    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.