The present invention relates generally to digital audio devices and, more particularly, to a method and apparatus for controlling processing load in a pitching audio device.
Pitch-shifting or pitch transposition is a technique for changing the pitch of an audio signal. Pitch may be described as the perceived frequency of a note. Changing the pitch up or down will be perceived as playing back the audio at a higher or lower frequency. Changing the pitch of an audio signal will also contract or expand the spectral content of the signal.
Pitch-shifting is a normal function of many audio processing systems. For example, in a karaoke system, pitch-shifting is used to adjust the pitch of the music to suit the person singing along to the music. In audio effects processing, pitch-shifting is used to create special audio effects, such as the Doppler Effect. In a wavetable synthesizer, pitch-shifting is required to create notes from a stored waveform.
Pitch-shifting is typically performed in a digital signal processor (DSP) that executes an interpolation algorithm. In devices with limited memory, fewer samples can be stored in memory and the interpolation algorithm may be computationally complex. For example, a wave table synthesizer for 128 voice polyphony would require the interpolation algorithm to be simultaneously executed on 128 synthesizer voices. The computational complexity is proportional to the sample rate. A higher sample rate implies more samples to be processed, while a lower sample rate implies fewer samples to process. In situations where central processing unit (CPU) resources are limited, pitch-shifting algorithms may consume a significant portion of those CPU resources. For example, a wavetable synthesizer may be used in mobile handheld devices to generate ring tones or other audible sounds. Such devices typically have limited CPU resources available for audio processing. It is desirable, therefore, to find ways to reduce demands on CPU resources while still maintaining high quality audio.
The present invention relates to a method and apparatus for changing the pitch of an audio signal. A control module receives a pitch parameter and directs a pitch-shifting module to change its playback rate depending on the pitch parameter. In one embodiment, the playback rate is changed at octave intervals of the pitch parameter and the pitch parameter is adjusted by a corresponding amount to account for the change in the playback rate. Reducing the playback rate of the audio signal at octave intervals of the pitch parameter reduces the computational load on the processor without loss of audio content. When the processing load becomes excessive, the control module can force an early change or late change in the sample rate responsive to the current processing load to reduce the processing load. The forced rate change can be implemented in a manner to maintain a high signal quality despite some loss in bandwidth.
a-2c illustrate the relationship between playback rate and frequency.
Referring now to the drawings,
The waveform generator 12 generates waveforms from stored waveform samples in memory 20. Memory 20 stores waveforms for a plurality of sounds or “voices,” which can be processed and combined to produce a musical composition. For example, memory 20 may store waveform samples corresponding to different instruments. The waveform generator 12 reads out samples of a stored waveform for selected sounds or synthesizer voices and generates a periodic audio signal from the stored waveform samples by repeatedly playing or looping the waveform samples. The waveform generator 12 may generate multiple simultaneous audio signals. In other embodiments, the audio source 12 may read out pulse code modulation (PCM) samples from memory or other stored audio files.
The pitch-shifting module 14 changes the pitch of the input audio signals from the waveform generator 12 responsive to control signals from the control module 16. The pitch-shifting module 14 may use any known time-domain interpolation algorithm to perform pitch-shifting. A time-domain interpolation algorithm consumes the audio samples faster or slower to change the pitch of the audio signal. This change in tempo is not a problem for a wavetable synthesizer where infinite looping of a stored waveform is used to create sounds. When applied to ordinary music files, however, the applied pitching will cause the music to be played back at an altered rate. Because the details of the interpolation algorithm are not material to the present invention and are well known to those skilled in the art, those details are omitted herein for the sake of brevity. When multiple simultaneous signals are provided, the pitch-shifting module 14 normally operates independently on each signal.
The control module 16 receives control information regarding desired pitch changes for each audio signal and generates the control signals to control the pitch-shifting module 14. More particularly, control module 16 generates a pitch parameter (Pch) and a rate parameter (R) for each input audio signal. Both of these parameters are provided to the pitch-shifting module 14. The rate parameter specifies the sample rate at which the supplied samples of the audio signal are processed and output by the pitch-shifting module 14, while the pitch parameter specifies the amount of pitch-shifting to be applied. It should be noted that the processing rate and output sample rate of the pitch-shifting module 14 are the same, but may be different than the input sample rate to the pitch-shifting module 14. In the following discussion, the processing rate and sample output rate are referred to as the playback rate.
Mixer 18 combines the output audio signals from the pitch-shifting module 14 to generate a combined audio signal. The combined audio signal may then be output to audio reproduction equipment.
Pitch-shifting alters the spectral content of an audio signal. When an audio signal is pitched down, the signal bandwidth is reduced. Conversely, when the audio signal is pitched up, the signal bandwidth is increased. This relationship between playback rate and frequency is illustrated in
The computational complexity of the interpolation algorithm used by the pitch-shifting module 14 depends on the playback rate and number of audio signals to be processed. The computational complexity increases proportionally with the playback rate and number of signals. Nyquist's sampling theorem states that the sample rate of an audio signal should be at least twice the highest frequency in a signal to prevent loss of information. Therefore, when pitching down, the playback rate may be reduced a corresponding amount without loss of audio bandwidth. When pitching up, it is necessary to increase the playback rate to avoid loss of high frequency audio content.
According to one aspect of the present invention, the demand on processing resources of the audio processing circuit 10 can be controlled by varying the playback rate as a function of a pitch parameter. During normal operation, the control module 16 maintains the playback rate as low as possible without loss of audio quality.
As shown in
Varying the sample rate at one octave intervals reduces the computational load without loss of audio bandwidth. However, those skilled in the art will appreciate rate changes do not have to be made at exactly one octave intervals.
According to another aspect of the invention, the control module 16 can monitor processing load and direct the pitch-shifting module 14 to change the playback rate at other than normal one octave rate change intervals depending upon processing load. For example, when the processing load is high, the control module 16 may command the phase shifting module 14 to increase the playback rate at +1000 rather than +1200. Similarly, the control module 16 may command the pitch-shifting module 14 to reduce the sample rate at −1100 rather than −1200. On the other hand, if processing load is light and there is no concern about battery life, the control module may force an early upward rate change or a late downward rate change.
Adjusted_Pitch_Parameter=Pitch_Parameter−k*1200
where k represents the number of rate change intervals and may be negative/positive depending on whether the change is down/up.
If the processing load is high, the control module 16 may elect to force an early downward rate change or a late upward rate change to reduce the processing load (blocks 114-120). When forcing a downward rate change to ease processing load, the forced rate change may be applied only to the audio signal being set up, to all audio signals, or to selected audio signals. Various criteria may be applied to select the audio signals to which the forced change will be applied. For example, the forced change may be applied to all audio signals whose current rate exceeds a predetermined level, e.g., 8 kHz. Also, selected ones of the audio signals may be exempted from the rate change. For example, some audio signals may be affected more than others by loss of higher frequencies, such as percussion voices. Those audio signals for which the higher frequencies are important may be exempted.
Changing the sample rate of the output audio signal at octave intervals of the pitch parameter reduces the computational load on the processor without loss of audio content. Nevertheless, there may be some situations where the processing load becomes excessive, e.g., when a large number of audio signals or synthesizer voices need to be processed. In these situations, the control module 16 can force an early change or late change in the playback rate responsive to the current load conditions to reduce the computational load. The forced rate change can be implemented in a manner to maintain a high signal quality despite some loss in bandwidth.
The present invention may, of course, be carried out in other specific ways than those herein set forth without departing from the scope and essential characteristics of the invention. The present embodiments are, therefore, to be considered in all respects as illustrative and not restrictive, and all changes coming within the meaning and equivalency range of the appended claims are intended to be embraced therein.
This application claims priority to Provisional U.S. Patent Application 60/689,826 filed on Jun. 13, 2005 and to Provisional U.S. Patent Application 60/690,417 filed on Jun. 14, 2005, which are incorporated herein by reference.
Number | Date | Country | |
---|---|---|---|
60689826 | Jun 2005 | US | |
60690417 | Jun 2005 | US |