Abstract:
This invention involves time-scale modification of audio signals. The invention describes overlap and add time scale modification with variable input and output buffer sizes. Seamless speed change is achieved by keeping track of previously processed data to avoid discontinuities during playback speed transitions.

Description:
TECHNICAL FIELD OF THE INVENTION  
       [0001]     The technical field of this invention is digital audio time scale modification.  
       BACKGROUND OF THE INVENTION  
       [0002]     Time-scale modification (TSM) is an emerging topic in audio digital signal processing due to the advance of low-cost, high-speed hardware that enables real-time processing by portable devices. Possible applications include intelligible sound in fast-forward play, real-time music manipulation, foreign language training, etc. Most time scale modification algorithms can be classified as either frequency-domain time scale modification or time-domain time scale modification. Frequency-domain time scale modification provides higher quality for polyphonic sounds, while time-domain time scale modification is more suitable for narrow-band signals such as voice. Time-domain time scale modification is the natural choice in resource-limited applications due to its lower computational cost.  
         [0003]     The basic operation of time domain time-scale modification is successively overlapping and adding audio frames, where time scaling is achieved by changing the spacing between them. It is known in the art to calculate the exact overlap point based on a measure of similarity between the signals to be overlapped. This measure of similarity is generally based on cross-correlation.  
         [0004]     Most time-domain time-scale modification algorithms are derived from the synchronous overlap-and-add method (SOLA). The synchronous overlap-and-add algorithm and its variations are based on successive overlap and addition of audio frames. For the overlap, the overlap point is adjusted by computing a measure of signal similarity between the overlapping regions for each possible overlap position, which is limited by a minimum and maximum overlap points. The position of maximum similarity is selected. The signal similarity measure can be represented as a full cross-correlation function or simplified versions. This similarity calculation represents about 80% or more of the total computation required by the algorithm.  
         [0005]     Even though SOLA based methods represent an attractive low-cost solution to the time-scale modification problem, their limitation stands out in the case of polyphonic music signals. Their intrinsic problem is that the audio signal is treated as a whole without consideration for its individual frequency components, so that the overlap point adjustment based on signal similarity cannot simultaneously generate smooth transitions for the multiple frequency components of the signal.  
         [0006]     A family of methods known as phase vocoder does time-scale modification in the frequency domain. The input signal is analyzed at equally spaced overlapping windowed frames using a short-time discrete Fourier transform. Next the phase difference for spectral peaks is calculated. This phase difference is the difference in phase between an input phase and a time scale modified signal phase. An intrinsic sinusoidal model is generally used. The frequency is represented by the sum Ω k +ω ik : where carrier Ω k  is 2Πk/N; and ω ik  is an instantaneous frequency modulator. This produces an estimate ω ik  for each spectral line by obtaining the phase difference between two consecutive analysis frames. Here, k is the spectral line and N is the size of the short-time discrete Fourier transform. The process reconstructs an output signal from the analyzed frames using a short-time inverse discrete Fourier transform. The frames are overlapped by a different overlap factor to achieve the desired time scaling. The instantaneous frequency ω ik  is used to calculate the phase corresponding to each spectral line in the time shifted instant.  
         [0007]     Even though phase vocoders can potentially achieve higher quality than time-domain methods, a severe limitation is the large amount of computation required in the forward and inverse discrete Fourier transforms and also in the spectrum manipulation process. Practical implementations on fixed-point processors result in a computational cost up to 10 times higher than time-domain time-scale modification methods. In addition, maintaining phase coherence between frames is not an easy task and can be the source of artifacts.  
       SUMMARY OF THE INVENTION  
       [0008]     This invention involves time-scale modification of audio signals. The invention describes overlap and add time scale modification with variable input and output buffer sizes, where the time scale is modified in a seamless manner by keeping track of previously processed data. 
     
    
     BRIEF DESCRIPTION OF THE DRAWINGS  
       [0009]     These and other aspects of this invention are illustrated in the drawings, in which:  
         [0010]      FIG. 1  is a block diagram of a digital audio system to which this invention is applicable;  
         [0011]      FIG. 2  is a flow chart illustrating the data processing operations involved in time-scale modification employing the digital audio system of  FIG. 1 ;  
         [0012]      FIG. 3   a  illustrates the analysis step in the overlap and add method of time scale modification according to the prior art;  
         [0013]      FIG. 3   b  illustrates the synthesis step in the overlap and add method of time-scale modification according to the prior art;  
         [0014]      FIG. 4   a  illustrates the analysis step in synchronous overlap and add method of time scale modification according to the prior art;  
         [0015]      FIG. 4   b  illustrates the synthesis step in the synchronous overlap and add method of time-scale modification according to the prior art;  
         [0016]      FIG. 5  is a flow chart illustrating the steps in the prior art phase vocoder time scale modification technique;  
         [0017]      FIG. 6  is a view of several waveforms used in explanation of this invention;  
         [0018]      FIG. 7  illustrates the analysis and synthesis steps for a constant output buffer size; and  
         [0019]      FIG. 8  illustrates the analysis and synthesis steps for a controllable output buffer size. 
     
    
     DETAILED DESCRIPTION OF PREFERRED EMBODIMENTS  
       [0020]      FIG. 1  is a block diagram illustrating a system to which this invention is applicable. The preferred embodiment is a DVD player or DVD player/recorder in which the time scale modification of this invention is employed with fast forward or slow motion video to provide audio synchronized with the video in these modes.  
         [0021]     System  100  received digital audio data on media  101  via media reader  103 . In the preferred embodiment media  101  is a DVD optical disk and media reader  103  is the corresponding disk reader. It is feasible to apply this technique to other media and corresponding reader such as audio CDs, removable magnetic disks (i.e. floppy disk), memory cards or similar devices. Media reader  103  delivers digital data corresponding to the desired audio to processor  120 .  
         [0022]     Processor  120  performs data processing operations required of system  100  including the time scale modification of this invention. Processor  120  may include two different processors, microprocessor  121  and digital signal processor  123 . Microprocessor  121  is preferably employed for control functions such as data movement, responding to user input and generating user output. Digital signal processor  123  is preferably employed in data filtering and manipulation functions such as the time scale modification of this invention. A Texas Instruments digital signal processor from the TMS320C5000 family is suitable for this invention.  
         [0023]     Processor  120  is connected to several peripheral devices. Processor  120  receives user inputs via input device  113 . Input device  113  can be a keypad device, a set of push buttons or a receiver for input signals from remote control  111 . Input device  113  receives user inputs which control the operation of system  100 . Processor  120  produces outputs via display  115 . Display  115  may be a set of LCD (liquid crystal display) or LED (light emitting diode) indicators or an LCD display screen. Display  115  provides user feedback regarding the current operating condition of system  100  and may also be used to produce prompts for operator inputs. As an alternative for the case where system  100  is a DVD player or player/recorder connectable to a video display, system  100  may generate a display output using the attached video display. Memory  117  preferably stores programs for control of microprocessor  121  and digital signal processor  123 , constants needed during operation and intermediate data being manipulated. Memory  117  can take many forms such as read only memory, volatile read/write memory, nonvolatile read/write memory or magnetic memory such as fixed or removable disks. Output  130  produces an output  131  of system  100 . In the case of a DVD player or player/recorder, this output would be in the form of an audio/video signal such as a composite video signal, separate audio signals and video component signals and the like.  
         [0024]      FIG. 2  is a flow chart illustrating process  200  including the major processing functions of system  100 . Flow chart  200  begins with data input at input block  201 . Data processing begins with an optional decryption function (block  202 ) to decode encrypted data delivered from media  101 . Data encryption would typically be used for control of copying for theatrical movies delivered on DVD, for example. System  100  in conjunction with the data on media  101  determines if this is an authorized use and permits decryption if the use is authorized.  
         [0025]     The next step is optional decompression (block  203 ). Data is often delivered in a compressed format to save memory space and transmit bandwidth. There are several motion picture data compression techniques proposed by the Motion Picture Experts Group (MPEG). These video compression standards typically include audio compression standards such as MPEG Layer 3 commonly known as MP3. There are other audio compression standards. The result of decompression for the purposes of this invention is a sampled data signal corresponding to the desired audio. Audio CDs typically directly store the sampled audio data and thus require no decompression.  
         [0026]     The next step is audio processing (block  204 ). System  100  will typically include audio data processing other than the time scale modification of this invention. This might include band equalization filtering, conversion between the various surround sound formats and the like. This other audio processing is not relevant to this invention and will not be discussed further.  
         [0027]     The next step is time scale modification (block  205 ). This time scale modification is the subject of this invention and various techniques of the prior art and of this invention will be described below in conjunction with FIGS.  3  to  6 . Flow chart  200  ends with data output (block  206 ).  
         [0028]      FIG. 3  illustrates this process. In  FIG. 3 ( a ), x(i) is the analysis signals represented as a sequence with index i. Similarly,  FIG. 3 ( b ) illustrates synthesis signal y(i) having a sequence index i. The quantity N is the frame size. S a  is the analysis frame interval between consecutive frames f j  (where j=1, 2 . . . ). S s  is the similar synthesis frame interval. The relationship between the analysis frame interval S a  and the synthesis frame interval S s  sets the time scale modification. The overlap-and-add time scale modification algorithm is simple and provides acceptable results for small time-scale factors. In general this method yields poor quality compared to other methods described below.  
         [0029]     The synchronous overlap-and-add time scale modification algorithm is an improvement over the previous overlap-and-add approach. Instead of using a fixed overlap interval for synthesis, the overlap point is adjusted by computing the normalized cross-correlation between the overlapping regions for each possible overlap position within minimum and maximum deviation values. The overlap position of maximum cross-correlation is selected. The cross-correlation is calculated using the following formula, where L k  is the length of the overlapping window:  
               R   ⁡     [   k   ]       =         ∑     i   =   0         L   k     -   1       ⁢           ⁢       y   ⁡     [       m   ⁢           ⁢     S   s       +   k   +   i     ]       ⁢     x   ⁡     [       m   ⁢           ⁢     S   a       +   1     ]               [       ∑     i   =   0         L   k     -   1       ⁢           ⁢         y   2     ⁡     [       m   ⁢           ⁢     S   s       +   k   +   i     ]       ⁢       ∑     i   =   0         L   k     -   1       ⁢           ⁢       x   2     ⁡     [       m   ⁢           ⁢     S   a       +   i     ]             ]       1   /   2                 (   1   )             
 
         [0030]      FIG. 4  illustrates the synchronous overlap-and-add time scale modification algorithm. The same variables are used in  FIG. 4 ( a ) for analysis as  FIG. 3 ( a ) and used in  FIG. 4 ( b ) for synthesis as in  3 ( b ). In  FIG. 4 , k is the deviation of the overlap position, with k limited to the range between k min  and k max . Note that k=0 is equivalent to the overlap-and-add time scale modification algorithm illustrated in FIGS.  3 ( a ) and  3 ( b ). The synchronous overlap-and-add time scale modification algorithm requires a large amount of computation to calculate the normalized cross-correlation used in equation 1. The similarity computation can be reduced using a more efficient normalized cross-correlation formula or another measure of signal similarity instead of equation 1. Even such a reduced computation will still be the most computation-expensive part of the algorithm. The following discussion applies to whatever normalized cross-correlation formula or measure of signal similarity is used. This computation enables better phase matching for each overlapping frame, thus improving the resulting sound quality.  
         [0031]      FIG. 5  is a flow chart illustrating process  500  including the basic phase vocoder as known in the art. At block  501  the input signal is analyzed at equally spaced overlapping windowed frames using a short-time discrete Fourier transform. The resulting data describes short time intervals of the audio data in the frequency domain. Next the phase difference for spectral peaks is calculated (block  502 ). This phase difference is the difference in phase between an input phase and a time scale modified signal phase. Block  502  uses an intrinsic sinusoidal model where the frequency is represented by the sum Ω k +ω ik : where carrier Ω k  is 2Πk/N; and ω ik  is an instantaneous frequency modulator. Block  502  estimates ω ik  for each spectral line by obtaining the phase difference between two consecutive analysis frames. Here, k is the spectral line and N is the size of the short-time discrete Fourier transform.  
         [0032]     Process  500  reconstructs an output signal from the analyzed frames using a short-time inverse discrete Fourier transform (block  503 ). The frames are overlapped by a different overlap factor to achieve the desired time scaling. The instantaneous frequency ω ik  is used to calculate the phase corresponding to each spectral line in the time shifted instant.  
         [0033]     Consider a simple signal consisting of non-harmonically related frequencies, such as f 1 =0.5 sin(x) and f 2 =0.25 sin(√{square root over (2)}x) and their sum f 3  illustrated in  FIG. 6 . Because the signals f 1  and f 2  are not harmonically related, any instantaneous relationship between their respective phases will never be repeated exactly because a perfect match would require an integer number of periods of both signals. Thus a time-domain time-scale modification technique would try to find a close match within signal f 3  but there will always be some phase disruption when jumping to a different location. This phase match problem causes artifacts for many time-domain time-scale modification techniques. Now consider separating these components and performing a similar operation on each signal individually. In this case, there is little problem finding a perfect phase match for each signal, though it will be at different locations. Combining the resulting time-scaled signals produces an artifact-free time-scaled whole. Unfortunately in the real world, even narrow band signals do not repeat perfectly due to changes in pitch and amplitude, and to interference among close frequencies. However analysis in separate frequency bands gives each band great flexibility in finding the best overlap point. This improves overall quality.  
         [0034]     TSM (time-scale modification) for audio and video equipment is becoming increasingly popular due to its wide range of applications: highly intelligible fast forward playback, audio “slow-motion” for foreign language training or the elderly, etc.  
         [0035]     In high-end audio and video equipment, the switching between speed modes should be as imperceptible as possible, since any abrupt change or silence can be easily perceived by the listener as annoying artifacts. Ideally, the user should not be able to perceive speed transitions that would otherwise destroy the sensation of continuity. Once implemented as a speed control function, such feature would enable an array of special effects unseen in current audio equipment, such as a karaoke accompaniment system that can chase the solo singer instead of the other way round, or a song being continuously accelerated or slowed down during playback.  
         [0036]     This invention shows a simple solution to the problem based on an improved time scale modification algorithm that keeps track of previously processed data to achieve continuity.  
         [0037]     A practical problem has to be solved when implementing the time scale modification algorithm in a real-time system. Usually the speed change ratio and thus the size of input and output buffers has to meet some restrictions related to audio/video synchronization. However, the overlap offset varies between k min  and k max  as previously explained, and the desired ratio would be attained exactly only for k=0. Additionally, the difference would accumulate along successive frames. The solution is to compensate the previous value of k before setting the initial target for the next overlap value. In that manner, the total accumulated error would never exceed max(|k min|, |k   max|). For applications that require exact input and output buffer sizes for every frame, a natural solution is to store one output chunk S   s  of delayed y[ ] and output the processed result of the previous frame. This is illustrated in  FIG. 7 . The figure describes the situation where the previous overlap offset k prev  was negative, so that the initial overlap target is positively compensated by −k prev . The figure also shows the delayed y[ ] ready for output.  
         [0038]     The system of  FIG. 7  can be generalized in order to enable controllable output buffer size. The initial overlap target for the overlap-and-add processing (corresponding to k=0) is S s −k prev , where S s  is the desired output buffer size and k prev  is the previous offset value. The generalization consists of using a generic output buffer size S s ′ instead of S s  that can be arbitrarily defined upon each frame. To ensure continuity of the processed data, the number of data to be actually output is no longer S s  but S s     —     prev , which is the value of S s ′ corresponding to the last-processed frame.  FIG. 8  illustrates the process.  
         [0039]     Using this algorithm, a system can be implemented where the client program requests an arbitrary number of output data, and the time scale modification system returns the number of data points corresponding to the last request.  
         [0040]     The method shown in this invention was implemented and tested using 13 speed multipliers ranging from 0.5× to 2.0× normal playback in steps of ⅛, as shown in Table 1. The speed transitions during playback were found to be imperceptible.  
                                     TABLE 1                       Speed   Input   Output       (vs. normal   buffer   buffer       playback)   size (S a )   size (S s )                                 4/8   512   1024        5/8   640   1024        6/8   768   1024        7/8   896   1024        8/8   1024   1024        9/8   1024   910       10/8   1024   820       11/8   1024   744       12/8   1024   682       13/8   1024   630       14/8   1024   586       15/8   1024   546       16/8   1024   512