The present invention relates to a method, a corresponding device and a corresponding computer program for estimating a pattern, in particular a pitch and/or a fundamental frequency, in a signal having a periodic, a quasiperiodic or virtually periodic component.
Pitch detection can be used for different applications like voice modification, text-to-speech transformation, speech coding, music information retrieval, musical performance systems, biometric measurements, astrophysical measurements etc. For a pitch detection time domain and frequency domain approaches are well known. The time domain approaches can be implemented cheap and easily e.g. by measuring the zero-crossing rate as described by C. H. Chen, Signal Processing Handbook, New York: Dekker, p. 531, 1988 or by a variation of autocorrelation by exploiting the similarity of successive pitch periods as described by R. Bracewell, The Autocorrelation Function, in The Fourier Transform and Its Applications, New York: MacGraw-Hill, pp. 40-45, 1965. The frequency-domain approaches are usually more complex and include the steps of a Fast Fourier Transformation (FFT) to transform the time-domain signal to a frequency-domain signal, removing of the influence of the phase by only considering the power of the frequency components, compressing the values to reduce the influence of spectral envelope, producing pitch candidates by correlation of the underlying harmonics like subharmonic summation and finding the candidate by selecting the highest peak. Such methods are known e.g. from D. J. Hermes, Measurement of pitch by subharmonic summation, in Journal of the Acoustic Society of America, 83, pp. 257-264, 1988. Another possibility to get the pitch candidates is the transformation of the frequency-domain signal back to the time-domain by Inverse Fourier Transformation (IFFT). E.g. the pitch detection algorithm as known from B. E. Bongart et al., The Frequency Analysis of Time Series for Echos: Cepstrum, Pseudoautocovariants, Cross-Cepstrum and Saphe Cracking, in Proceedings of the Symposium on Time Series Analysis, Chapter 15 pp. 209-243, New York: Wiley, 1963 is based upon spectral analysis and uses a log function for compression. If the magnitude is used as a compression operation, the resulting backward transformation is a zero-phase signal. Autocorrelation can be used in this respect, if no compression to the power spectrum is applied.
A strong compression like a log function amplifies the influence of noise and forms wrong pitch candidates. A small compression like the magnitude operation is too low to suppress the influence of spectral envelopes and, therefore, producing wrong candidates from higher harmonics. A compromise is applying a square-root operation on magnitude values as used in a harmony speech coder which is known from R. Taori et al., Harmony-1: A Versatile Low Bit Rate Speech Coding System, Nat. Lab. Technical Note 157/97. The pitch detection methods are provided to determine the right candidate out of multiple candidates, however, if the candidates are close to each other, a wrong candidate may be chosen. Further, if higher and/or lower octaves of a pitch are strongly represented, false candidates may be selected by the pitch detection methods known from the prior art.
It is an object of the present invention to provide an improved method, device and computer program for estimating a pattern, in particular a pitch and/or a fundamental frequency, in a signal more reliably.
In a first aspect of the present invention a method for estimating a pattern, in particular a pitch and/or a fundamental frequency, in a signal having a periodic, quasiperiodic or virtually periodic component, comprising:
transforming the signal from a time-domain to a frequency-domain to obtain a spectrum of the signal,
processing the spectrum to obtain a zero-phase spectrum of the signal,
transforming the zero-phase spectrum of the signal to the time-domain to obtain a correlation signal,
combining the spectrum and the correlation signal to a combined spectrum, and
estimating the pattern on the basis of the combined spectrum.
In a further aspect of the present invention a corresponding device is presented, e.g. comprising a processing unit to perform the steps of the above-mentioned method.
In a further aspect of the present invention a corresponding computer program is presented comprising program code means for causing a computer to carry out the steps of the proposed method when said computer program is carried out on the computer.
Preferred embodiments of the invention are defined in the dependent claims. It shall be understood that the claimed device and the claimed computer program have similar and/or identical preferred embodiments as the claimed method and as defined in the dependent claims.
The present invention is based upon the idea that in an additional step the frequency domain spectrum is combined with its time-domain transformation such that the resulting spectrum has a distinct peak at the pitch location and strong attenuation at higher and lower octaves. This method can be used to estimate the pitch and/or the fundamental frequency of a signal. Since the resulting spectrum has just a distinct peak at the pitch location and/or the fundamental frequency, the pitch and/or the fundamental frequency can be detected easily with a high reliability.
According to a preferred embodiment the step of transforming the signal from a time-domain to a frequency-domain comprises a Fourier Transformation, in particular a Fast Fourier Transformation. This provides a possibility to implement a transformation from the time-domain to the frequency-domain with low effort.
According to a further embodiment, the signal is processed by means of a DC-notch filter. The DC-notch filter removes low frequency signals to prevent false detection.
The DC filtered signal is preferably multiplied by a window function. This window operation limits the spectrum to a region that contains at least two pitch periods.
According to a further embodiment, the spectrum of the signal is processed to obtain a magnitude spectrum of the signal. The magnitude calculation of the signal provides a compression operation, which is easily implementable and results in a zero-phase signal after backward transformation.
According to a further embodiment, the spectrum of the signal is compressed to a compressed spectrum, in particular by means of a square-root operation. Alternatively, the compression function may be a root—function in general using e.g. 0.6 as exponent. This operation emphasizes the harmonics of the pitch and attenuates the influence of the spectral envelopes.
According to a further embodiment the spectrum of the signal is windowed by means of a window function, in particular by using the right half of a Hanning window or other window functions, which have a similar effect. This window operation attenuates noisy high frequency components.
According to a further embodiment the transformation of the zero-phase spectrum, in particular of a compressed magnitude spectrum of the signal, to the time-domain comprises an Inverse Fourier Transformation. Since the phase of the spectrum, in particular of a compressed spectrum is zero, just the positive axis of the real part of the spectrum need to be computed. This provides a possibility to obtain a correlation signal having peaks at multiples of the pitch period.
According to a further preferred embodiment, the correlation signals is attenuated by means of a window function. This window operation attenuates the effect of the spectral envelope on the correlation signal.
According to a preferred embodiment the combination of the spectrum and the correlation signal comprises resampling of at least one of the spectrum or the correlation signal. The resampling provides a possibility to combine the spectrum and the correlation signal having inversely proportional axes. In particular, it is preferred to use a logarithmic scale. This provides a possibility to combine spectrum and signal having a large difference in resolution for high and low frequencies of the different domains.
According to a preferred embodiment the estimating of the pattern comprises searching for an absolute maximum of the combined signal. This provides a reliable and simple possibility to find the pitch and/or the fundamental frequency of the signal.
According to a preferred embodiment the signal is rectified, in particular by means of a full-wave rectification function. This provides a possibility to determine the pitch and/or the fundamental frequency of a signal when the fundamental frequency is missing without degrading the performance for non-filtered signals.
According to a preferred embodiment the zero-phase spectrum of the rectified signal is compared with the zero-phase spectrum of the non-rectified signal and wherein the maximum of these signals is selected and combined with the correlation signal to form the combined signal. The reason for taking the maximum of the spectra is that in case of pure sinusoidal signals, the rectification removes the fundamental frequency and produces only higher harmonics. To reduce the distortion, the spectra of the rectified and the non-rectified signal are combined by selecting the maximum of these spectra.
These and other aspects of the invention will be apparent from and elucidated with reference to the embodiment(s) described hereinafter. In the following drawings
The zero-phase spectrum Sm is transformed in step S3 from the frequency-domain to the time-domain preferably using an Inverse Fourier Transformation. The Transformation step S3 provides a correlation signal c, which comprises peaks at multiples of the pitch period.
The zero-phase spectrum Sm and the correlation signal c are combined in step S4 to a combined spectrum b. The combined spectrum b comprises a distinct peak at the pitch, wherein the higher harmonics in the frequency spectrum and the multiples of the pitch period are attenuated leaving the pitch and/or the fundamental frequency as a predominant peak. The combination S4 is performed by multiplying the zero-phase spectrum Sm with the correlation signal c.
On the basis of the combined spectrum b, a peak detection S5 is performed to estimate the pitch and/or the fundamental frequency of the signal. The peak detection S5 comprises searching for the maximum in the combined spectrum b and provides the output signal p, which corresponds to the pitch and/or the fundamental frequency of the source signal s.
The step S4 of combining the zero-phase spectrum Sm with its time-domain transformation c results in the combined spectrum b, which has a distinct peak at the pitch location and/or the fundamental frequency and strong attenuation and higher and lower octaves. Hence, the peak detection is reliable, since the pitch location and/or the fundamental frequency correspond to highest peak in the combined spectrum b.
The source signal s shown in
The frequency of the correlation signal c derived from the compressed spectrum Sc by means of the transformation step S3 is shown in
The frequency of the combined spectrum b derived from the combination of the compressed spectrum Sc and the correlation signal c by means of step S4 is shown in
The pitch p versus time derived from the combined spectrum b by means of the peak detection of step S5 is shown in
Hence,
The apparatus 20 comprises a signal input 22 and a signal output 24 to receive the source signal s and to provide the output signal p, respectively. The apparatus 20 comprises a processing unit 26 for processing the input signal s and to estimate the pitch and/or the fundamental frequency of the input signal s. The processing unit 26 provides the output signal p to the output 24 of the apparatus 20. The processing unit 26 comprises a memory 28 to store program codes for causing the processing unit 26 to carry out method steps to process the input signal s.
The processing unit 26 can be implemented by an integrated circuit or a computer or may be implemented by means of discrete elements and/or devices which perform the necessary processing steps.
The source signal s is preferably filtered by means of a DC-notch filter in a first step S6. Low frequencies of the input signal s can distort the pitch detection process due to the windowing step before the Fourier Transformation from the time-domain to the frequency-domain. The windowing step smears the energy of a dominant DC signal to higher frequencies, and can emphasize weak low frequencies of the source signal s. To prevent false detection, the low frequencies of the source signal s need to be removed before the following windowing process. The DC-notch filter of step S6 is used to remove the low-frequencies of the source signal s. The DC-notch filter according to S6 comprises the transfer function:
and fs is the sampling frequency and fc the cut-off frequency in Hz, at which an output power of the DC-notch filter is reduced to 50% of the input power (−3 dB).
The filter implementation in time-domain is:
sf[n]=s[n]−s[n−1]+α·sf[n−1]
including the source signal s, the DC-filtered signal sf as an output signal of step S6 and n as the nth input sample. For a speech signal, a sampling frequency of 8 kHz and a cut-off frequency of 500 Hz cc is approximately 0.94. The output signal of the DC-notch filter sf does not comprise low frequency components as shown in
The following step S7 is a window function. The DC filtered signal sf is multiplied by a window function 32. The window function 32 attenuates possible discontinuities at the edges and limits the signal to a region that contains at least two pitch periods. For example, if the lowest pitch is expected to be 40 Hz, the window duration needs to be at least 50 msec. Preferably, a Hanning window function is used:
Alternatively a Hamming window function or any other window function with similar characteristics can be used. L depends on the sampling frequency, wherein L is 400 for a sampling frequency of 8 kHz and 50 msec duration.
The windowing operation is defined by:
sw[n]=sf[n]·w[n], 0≦n<L
wherein sw is the output signal of the windowing function of step S7.
The signal sw is transformed from the time-domain to the frequency-domain in step S8. This transformation comprises a Discrete Fourier Transformation (DFT) to provide a spectrum S of the signal sw. The transformation function of the Discrete Fourier Transformation is given by:
For efficiency reasons preferably a radix-2 FFT is used. In that case the size M of the DFT has the power of 2 and is closest to, but not smaller than L. E.g. for L of 400, M is set to 512.
In step S9 the magnitude spectrum of the frequency spectrum S is calculated. Since sw is a real value signal and S is symmetric around zero, only the positive axis is used for the calculation of the magnitude. Thus, the formula of the Fourier Transformation mentioned above can be rewritten as:
wherein SR is the real part and SI is the imaginary part of the spectrum. The magnitude is calculated in step S9 by the formula:
wherein Sm is the output frequency spectrum of Step S9. In the following step S10, the magnitude spectrum Sm is compressed by a square-root operation:
The square-root operation emphasizes the harmonics of the pitch and attenuates the influence of the spectral envelope, e.g. like the formants in a speech signal. The output signal of the compression of S10 is a compressed magnitude spectrum Sc.
In step S11, the compressed magnitude spectrum Sc is windowed in the frequency-domain to attenuate noisy high frequency components preferably by using the right half of a Hanning window:
N determines the size of the pass-band. For a speech signal having a sampling frequency of 8 kHz and a pass band of 2 kHz N=M/4. The window function of S10 is shown at 34. The output signal of step S11 is the windowed compressed magnitude spectrum Sw as shown in
The windowed compressed magnitude spectrum Sw is transformed in step S12 to the time-domain using an Inverse Fourier Transformation (IFT). The FFT size remains as shown above:
Since the phase of the windowed compressed magnitude spectrum Sw is zero, only the positive axis of the real-part of the spectrum is needed for the inverse transformation:
This transformation to the time-domain is used to obtain the correlation signal c, that comprises peaks at multiples of the pitch period as shown in
In step S13 the correlation signal c is windowed to further attenuate the effect of spectral envelope. Preferably a simple window function 36 is used for this attenuation step:
The output signal of step S13 is a windowed correlation signal cw.
In step 14 a combined spectrum b is formed by multiplying the compressed magnitude spectrum Sc and the attenuated correlation signal cw. This combined spectrum b has a distinct peak at the fundamental frequency. By multiplying these spectra, the higher harmonics in the frequency spectra and the multiples of the pitch periods are attenuated, wherein the fundamental frequency and/or the pitch remains as a predominant peak. Prior to the combination of the spectra, resampling of at least one of the spectra may be used, since the axes are inversely proportional, wherein:
Because of the difference of the resolution for low and high frequencies between the different domains, the combination is preferably performed by using a logarithmic scale:
wherein kmin and kmax correspond to the valid pitch range. E.g. for speech, a pitch range between 40 and 600 Hz is usual. R determines the output array size. It is sufficient to use the input window length for R with L=R.
The resampling operation is preferably performed by using spline-interpolation:
wherein ni′=[ni], ni″=ni−ni′ and [ni] denotes the quantization operation that removes the fractional part. The same interpolation is also applied to Sw, wherein ki′ is the quantized index of ki.
The quantized indices as well as the spline coefficients can be pre-calculated and stored in an array to avoid lengthy calculations for the complex log- and exp-operations. The resampled spectra, which are combined in S14 are shown in
The peak position detection as the final step S15 comprises searching for the maximum of the combined spectrum b:
wherein ml is the maximum and pl the location of the maximum in the scaled logarithmic domain. The pitch in the linear domain in Hz is determined by:
In
The method 50 is preferably used to find the pitch of the source signal s when the fundamental frequency is missing. In cases when high-pass filters are applied to the signal prior to the pitch detection, e.g. like telephone speech, the fundamental frequency is lost. The method 50 is provided to bring back the fundamental frequency without degrading the performance for non-filtered signals.
The method 50 comprises a separate path 52 to provide a rectified spectrum of the DC-filtered signal sf.
The DC-filter signal sf is rectified in step S16 to provide the rectified signal r. Preferably the DC-filtered signal sf is full-wave rectified by means of a full-wave rectifier. The formula of the full-wave rectifier is given by:
r[n]=|sf[n]|.
The rectifying step S16 is followed by the steps S6′ to S10′ to provide a rectified compressed magnitude spectrum Rc of the rectified signal. The steps S6′ to S10′ are identical with steps S6 to S10 as described above. In step S17 the compressed magnitude spectrum Sc of the non-rectified signal sf and the rectified compressed magnitude spectrum Rc are combined. For reducing the distortion and for the case that the rectification removes the fundamental frequency and produces only higher harmonics, the rectified compressed magnitude spectrum Rc of the rectified signal r and the non-rectified signal s are combined, wherein the maximum of these spectra is selected according to the formula:
wherein d is a scaling factor and preferably set to 2. The output signal of S17 is Rc′, the maximum of the compressed magnitude spectrum of the rectified signal and the non-rectified signal.
The output signal of S17 is combined with the attenuated correlation signal cw in step S14 as described above.
The input 22 is connected to a DC-notch filter 54 performing step S6. The DC-notch filter 54 is connected to a windowing element 56 performing step S7. The windowing element 56 is connected to a Fourier Transformation element 58 performing step S8. The Fourier Transformation element 58 is connected to a magnitude element 60 provided to calculate the magnitude according to step S9. The magnitude element 60 is connected to a root operation element 62, which performs step S10. The root operation element 62 is connected to a windowing element 64, which is provided to perform step S11. The windowing element 64 is connected to an Inverse Fourier Transformation element 66, which is provided to perform S12. The Inverse Fourier Transformation element is connected to a windowing element 68, which is provided to perform S13. The windowing element 68 is connected to the combination element 70, which is provided to perform S14. The root operation element 62 is also connected to the combination element 70 to provide the compressed magnitude spectrum Sc to the combination element 70. The combination element 70 is connected to a peak position detector element 72, which is provided to perform step S15. The peak position detection element 72 is connected to the output of the processing unit 26 to provide the pitch p to the output 24.
According to this embodiment, the processing unit 26 of
The processing unit 26 comprises a first transformation unit 80 to perform step S1, a processing unit 82 to perform step S2, a second transformation unit 84 to perform step S3, a combination unit 86 to perform step S4 and an estimation unit 88 to perform step S5.
Thus, the steps of the methods 10, 30 and 50 can be carried out by discrete elements in the processing unit 26 as mentioned above. In an alternative embodiment, the steps of the methods 10, 30 and 50 can be carried out by the processing unit 26, which can be implemented by an integrated circuit, like a FPGA or an ASIC or the like or which can be implemented by software running on a computer or control unit.
While the invention has been illustrated and described in detail in the drawings and foregoing description, such illustration and description are to be considered illustrative or exemplary and not restrictive; the invention is not limited to the disclosed embodiments. Other variations to the disclosed embodiments can be understood and effected by those skilled in the art in practicing the claimed invention, from a study of the drawings, the disclosure, and the appended claims.
In the claims, the word “comprising” does not exclude other elements or steps, and the indefinite article “a” or “an” does not exclude a plurality. A single element or other unit may fulfill the functions of several items recited in the claims. The mere fact that certain measures are recited in mutually different dependent claims does not indicate that a combination of these measures cannot be used to advantage.
A computer program may be stored/distributed on a suitable medium, such as an optical storage medium or a solid-state medium supplied together with or as part of other hardware, but may also be distributed in other forms, such as via the Internet or other wired or wireless telecommunication systems.
Any reference signs in the claims should not be construed as limiting the scope.
Number | Date | Country | Kind |
---|---|---|---|
10190709 | Nov 2010 | EP | regional |
Filing Document | Filing Date | Country | Kind | 371c Date |
---|---|---|---|---|
PCT/IB2011/054951 | 11/7/2011 | WO | 00 | 5/6/2013 |
Publishing Document | Publishing Date | Country | Kind |
---|---|---|---|
WO2012/063185 | 5/18/2012 | WO | A |
Number | Name | Date | Kind |
---|---|---|---|
3617636 | Ogihara | Nov 1971 | A |
3622966 | George et al. | Nov 1971 | A |
4706290 | Lin | Nov 1987 | A |
4720802 | Damoulakis et al. | Jan 1988 | A |
4791671 | Willems | Dec 1988 | A |
5781880 | Su | Jul 1998 | A |
5864795 | Bartkowiak | Jan 1999 | A |
5946650 | Wei | Aug 1999 | A |
6018706 | Huang et al. | Jan 2000 | A |
6067511 | Grabb et al. | May 2000 | A |
6128591 | Taori et al. | Oct 2000 | A |
6208958 | Cho et al. | Mar 2001 | B1 |
6459914 | Gustafsson et al. | Oct 2002 | B1 |
6470311 | Moncur | Oct 2002 | B1 |
20040128130 | Rose et al. | Jul 2004 | A1 |
20040167775 | Sorin | Aug 2004 | A1 |
20070036360 | Breebaart | Feb 2007 | A1 |
20070198263 | Chen | Aug 2007 | A1 |
20090018824 | Teo | Jan 2009 | A1 |
20100017198 | Yamanashi et al. | Jan 2010 | A1 |
20100223061 | Ojanpera | Sep 2010 | A1 |
20100286981 | Krini et al. | Nov 2010 | A1 |
Number | Date | Country |
---|---|---|
101853240 | Oct 2010 | CN |
Entry |
---|
Stephen A. Zahorian and Hongbing Hu. A Spectral/temporal method for Robust Fundamental Frequency Tracking. The Journal of the Acoustical Society of America, 123 (6), 2008. doi:10.1121/1.2916590. |
H. K. Kim and H. S. Lee, “Use of spectral autocorrelation in spectral envelope linear prediction for speech recognition”, IEEE Transactions on Speech and Audio Processing, vol. 7, No. 5, Sep. 1999. |
Zhao et al, “A Processing Method for Pitch Smoothing Based on Autocorrelation and Cepstral F0 Detection Approaches”, IEEE, 2007, p. 59-62. |
Taori et al, “Harmony-1: A Versatile Low Bit Rate Speech Coding System”, Nat. Lab Technical Note 157, 1997, pp. 1-92. |
Hermes, “Measurement of Pitch by Subharmonic Summation”, Journal of the Acoustic Society of America, 83(1), Jan. 1988, pp. 257-264. |
Zhao et al, “A Processing Method for Pitch Smoothing Based on Autocorrelation and Cepstral F0 Detection Approaches”, IEEE, 2007, pp. 59-62. |
Chen, “Signal Processing Handbook”, Marcel Dekker, Inc., 1988, p. 531. |
Number | Date | Country | |
---|---|---|---|
20130231926 A1 | Sep 2013 | US |