Summary of the invention
The object of the present invention is to provide a kind of method and apparatus of computing voice fundamental frequency, can estimate fundamental frequency more exactly.
The invention discloses a kind of method of computing voice fundamental frequency, may further comprise the steps:
The voice signal of time domain is transformed to discrete frequency domain signal X
i, i=1 wherein, 2 ..., N;
| X
i| in find out each peak value M as local maximum
j, j=1 wherein, 2 ..., L, L are the number of peak value, || expression takes absolute value;
In the related field of definition of described discrete frequency-region signal, L nonoverlapping regional Z of structure
j, each Z
jSize be scheduled to each Z
jCover a D
j, D wherein
jBe M
jIn the pairing value of field of definition;
With each Z
jFor field of definition is constructed continuous function S respectively
j(ω), ω ∈ Z
j, satisfy | S
j(ω
i)-| X
i||<C1, wherein ω
iBe X
iIn the pairing value of field of definition, C1 is a positive constant;
At each Z
jIn the field of definition that does not have to cover, constructed fuction S
0(ω),
And
F wherein
sBe sampling rate, satisfy S
0(ω)<| X
i|;
Will be by each S
j(ω) and S
0The S that (ω) is combined into (ω) calculates fundamental frequency as frequency spectrum.
The invention also discloses a kind of equipment of computing voice fundamental frequency, comprising:
Converter unit is used for the voice signal of time domain is transformed to discrete frequency domain signal X
i, i=1 wherein, 2 ..., N;
The peak value computing unit is used for | X
i| in find out each peak value M as local maximum
j, j=1 wherein, 2 ..., L, L are the number of peak value, || expression takes absolute value;
Reconfiguration unit is used in the related field of definition of described discrete frequency-region signal, L nonoverlapping regional Z of structure
j, each Z
jSize be scheduled to each Z
jCover a D
j, D wherein
jBe M
jIn the pairing value of field of definition; With each Z
jFor field of definition is constructed continuous function S respectively
j(ω), ω ∈ Z
j, satisfy | S
j(ω
i)-| X
i||<C1, wherein ω
iBe X
iIn the pairing value of field of definition, C1 is a positive constant; At each Z
jIn the field of definition that does not have to cover, constructed fuction S
0(ω),
And
F wherein
sBe sampling rate, satisfy S
0(ω)<| X
i|;
The fundamental tone computing unit is used for by each S
j(ω) and S
0The S that (ω) is combined into (ω) calculates fundamental frequency as frequency spectrum.
Embodiment of the present invention compared with prior art, the key distinction and effect thereof are:
Before calculating fundamental frequency, earlier used frequency-region signal is reconstructed, generate the reconstruction of function that field of definition is continuous, carry out curve fitting by corresponding frequency-region signal near the field of definition of this function each frequency domain peak value, in other field of definition, corresponding frequency-region signal is effectively suppressed.Because candidate's fundamental frequency and multiple frequency thereof are usually expressed as peak value, so, can improve accuracy and antijamming capability that fundamental frequency calculates by keeping near the frequency-region signal in the field of definition each peak value, significantly weakening frequency-region signal in other field of definition.The frequency-region signal that obtains by conversion disperses, by can more accurately advancing in the frequency spectrum of reconstruction of function representative to search for fundamental frequency to the serialization of field of definition.
Further, when pitch search, take all factors into consideration candidate's fundamental frequency and a plurality of frequency multiplication thereof, can make Search Results more accurate.
Further, can be by the reconstruction of function value in other field of definition outside near the field of definition peak value be made as 0, thus weaken irrelevant frequency component to greatest extent, further improve accuracy and antijamming capability that fundamental frequency calculates.
Embodiment
For making the purpose, technical solutions and advantages of the present invention clearer, embodiments of the present invention are described in further detail below in conjunction with accompanying drawing.
First embodiment of the present invention relates to a kind of method of computing voice fundamental frequency, as shown in Figure 1.
In step 110, the voice signal of importing is transformed into frequency domain from time domain.Specifically, the time domain voice signal of supposing input is x
i, i=1,2 ..., N then can be converted into discrete frequency domain signal X by Fast Fourier Transform (FFT) (FastFourier Transform is called for short " FFT ")
i, i=1 wherein, 2 ..., N.
Need to prove that in this step, the conversion from the time-domain signal to the frequency-region signal is embodied as example with FFT and describes, but in actual applications, also can realize by other modes.Such as, can be by modes such as discrete cosine transform (Discrete Cosine Transform, be called for short " DCT ") or modified discrete cosine transforms, the voice signal of time domain is transformed to discrete frequency-region signal.
Then, in step 120, from each frequency domain signal X
iAbsolute value in, find out each peak value M as local maximum
j, j=1 wherein, 2 ..., L, L are the number of peak value.Such as, earlier according to X
1, X
2...., X
N, obtain the absolute value Y of each frequency-region signal
1, Y
2...., Y
N, Y wherein
i=| X
i|, i=1,2 ..., N.Then, search for local maximum Y again
i, as search for all and satisfy Y
i>max (Y
I+1, Y
I-1) Y
iAs peak value M
j, the choosing method of this local maximum is actually among 3 o'clock and chooses maximal value, certainly, in actual applications, also can (among as 5 or 6) choose maximal value in more point.
Then, in step 130, reconstruct the continuous frequency spectrum of voice signal according to the frequency domain peak value of electing.Because each frequency-region signal that obtains after the FFT conversion disperses, and the field of definition continuous functions of frequency spectrum promptly can't be provided, this calculating to fundamental tone has caused difficulty, therefore needs reconstruct and serialization frequency spectrum.Specific as follows:
At first, entire spectrum is divided into two types.One type frequency spectrum is corresponding with the frequency component of fundamental frequency or its certain multiple, and the frequency spectrum of another kind of type then is and the irrelevant pairing frequency spectrum of frequency component of fundamental frequency.Because the frequency component of fundamental frequency and its certain multiple all shows as a local maximum usually on frequency spectrum, can think that therefore in step 120 selected peak value represented the frequency component of fundamental frequency and its certain multiple.Then be considered to the frequency component that has nothing to do in other parts of whole frequency axis.
Secondly, respectively this frequency spectrum of two types is carried out function reconstruct.Specifically, in the related field of definition of discrete frequency-region signal, L of structure respectively with L the corresponding nonoverlapping regional Z of peak value
j, each Z
jSize be scheduled to each Z
jCover a D
j, D wherein
jBe M
jIn the pairing value of field of definition.With each Z
jFor field of definition is constructed continuous function S respectively
j(ω), ω ∈ Z
j, satisfy | S
j(ω
i)-| X
i||<C1, wherein ω
iBe X
iIn the pairing value of field of definition, C1 is a positive constant.At each Z
jIn the field of definition that does not have to cover, constructed fuction S
0(ω),
And
F wherein
sBe sampling rate, satisfy S
0(ω
i)<| X
i|.Below to continuous function S
jMake (ω) is described further.
In the present embodiment, by with the frequency-region signal absolute value of peak value correspondence with and former and later two frequency-region signal absolute values carry out the binomial interpolation, realize continuous function S
jStructure (ω).Such as, first peak value M
1Corresponding frequency-region signal absolute value Yi is ω in the pairing value of field of definition
i, its former and later two frequency-region signal absolute value (Y then
I-1, Y
I+1) be (ω in the pairing value of field of definition
I-1, ω
I+1).Suppose that this interpolation polynomial represented by following second degree trinomial expression:
f(x)=ax
2+bx+c
Then by Substitution method can solve corresponding coefficient a, b, c}:
Therefore, can obtain: S
1(ω)=a
1ω
2+ b
1ω+c
1
In like manner, can construct each S by the binomial interpolation method
j(ω) function, i.e. S
j(ω)=a
jω
2+ b
jω+c
j
Need to prove, because in the present embodiment, peak value M
jBe actually the maximal value of among 3 o'clock, choosing, if so first peak value M
1Corresponding frequency-region signal absolute value is Y
i, then regional Z
1Reference position be Y
I-1In the pairing value of field of definition, end position is Y
I+1In the pairing value of field of definition, promptly
In like manner, can obtain each Z
jThe zone.The field of definition of the matched curve of each peak value correspondence also can be taked other arbitrarily rational length
For each Z
jThe field of definition that does not have covering, because Pitch Information is not contained in these zones, therefore can be simply with these parts arbitrary function S
0(ω) replace,
And
Function S
0(ω) only need satisfy S
0(ω
i)<| X
i| this condition gets final product.Such as, adopt null function, that is: S
0(ω)=0.
Because in this step, respectively this frequency spectrum of two types has been carried out function reconstruct, so entire spectrum all to be reconstructed into be a field of definition continuous functions, that is:
Then, enter step 140, calculate fundamental frequency.Specifically, because in step 130, drawn a field of definition continuous functions S (ω), can directly derive fundamental frequency according to the function characteristics of this function S (ω).Such as, to search in the scope (as from 50 hertz to 500 hertz) that may exist of fundamental tone, the criterion of search is to find the frequency that satisfies following formula:
Wherein, N (ω) is to be the harmonic wave number of fundamental frequency with ω, ω
pBe fundamental frequency.Need to prove that above-mentioned formula is an object lesson as search criteria, in actual applications, also can adopt other formula, as will square changing to 4 powers or 1 power etc. in the above-mentioned formula.Above-mentioned ω
pThe essence of correlation formula is to take all factors into consideration candidate's fundamental frequency and a plurality of frequency multiplication thereof when pitch search, and concrete formula form can have other variation, can make Search Results more accurate like this
Because in the present embodiment, before calculating fundamental frequency, earlier used frequency-region signal is reconstructed, generate the reconstruction of function that field of definition is continuous, carry out curve fitting by corresponding frequency-region signal near the field of definition of this function each frequency domain peak value, in other field of definition, corresponding frequency-region signal is effectively suppressed.Because candidate's fundamental frequency and multiple frequency thereof are usually expressed as peak value, so, can improve accuracy and antijamming capability that fundamental frequency calculates by keeping near the frequency-region signal in the field of definition each peak value, significantly weakening frequency-region signal in other field of definition.The frequency-region signal that obtains by conversion disperses, by can more accurately advancing in the frequency spectrum of reconstruction of function representative to search for fundamental frequency to the serialization of field of definition.
What deserves to be mentioned is, in the present embodiment, to each Z
jThe function S that the field of definition that does not have to cover is constructed
0(ω) be: S
0(ω)=0, thereby weaken irrelevant frequency component to greatest extent, further improve accuracy and antijamming capability that fundamental frequency calculates.And in actual applications, also can be with function S
0(ω) be changed to a very little value, can search fundamental frequency comparatively exactly equally.
Second embodiment of the present invention relates to a kind of method of computing voice fundamental frequency, and the present embodiment and first embodiment are roughly the same, and its difference is, in the first embodiment, is constructing continuous function S
jIn the time of (ω), be by with the frequency-region signal absolute value of peak value correspondence with and former and later two frequency-region signal absolute values carry out the binomial interpolation and realize; And in the present embodiment, can be by fitting to the segmentation straight line, or come match with cubic polynomial, realize continuous function S
jStructure (ω).
Method embodiment of the present invention can be realized in software, hardware, firmware or the like mode.No matter the present invention be with software, hardware, or the firmware mode realize, instruction code can be stored in the storer of computer-accessible of any kind (for example permanent or revisable, volatibility or non-volatile, solid-state or non-solid-state, medium fixing or that change or the like).Equally, storer can for example be programmable logic array (Programmable Array Logic, be called for short " PAL "), random access memory (Random Access Memory, be called for short " RAM "), programmable read only memory (Programmable Read Only Memory, be called for short " PROM "), ROM (read-only memory) (Read-Only Memory, be called for short " ROM "), Electrically Erasable Read Only Memory (Electrically Erasable Programmable ROM, be called for short " EEPROM "), disk, CD, digital versatile disc (Digital Versatile Disc is called for short " DVD ") or the like.
The 3rd embodiment of the present invention relates to a kind of equipment of computing voice fundamental frequency, as shown in Figure 2, comprising: converter unit is used for the voice signal of time domain is transformed to discrete frequency domain signal X
i, i=1 wherein, 2 ..., N; The peak value computing unit is used for | X
i| in find out each peak value M as local maximum
j, j=1 wherein, 2 ..., L, L are the number of peak value, || expression takes absolute value; Reconfiguration unit is used in the related field of definition of discrete frequency-region signal, L nonoverlapping regional Z of structure
j, each Z
jSize be scheduled to each Z
jCover a D
j, D wherein
jBe M
jIn the pairing value of field of definition; With each Z
jFor field of definition is constructed continuous function S respectively
j(ω), ω ∈ Z
j, satisfy | S
j(ω
i)-| X
i||<C1, wherein ω
iBe X
iIn the pairing value of field of definition, C1 is a positive constant; At each Z
jIn the field of definition that does not have to cover, constructed fuction S
0(ω),
And
F wherein
sBe sampling rate, satisfy S
0(ω i)<| X
i|; The fundamental tone computing unit is used for by each S
j(ω) and S
0The S that (ω) is combined into (ω) calculates fundamental frequency as frequency spectrum.
The fundamental tone computing unit calculates fundamental frequency in the following manner: fundamental tone may have scope search, the criterion of search is to find the frequency that satisfies following formula:
Wherein, N (ω) is to be the harmonic wave number of fundamental frequency with ω, ω
pBe fundamental frequency.
Converter unit can adopt modes such as FFT, discrete cosine transform, modified discrete cosine transform, and the voice signal of time domain is transformed to discrete frequency-region signal.
Reconfiguration unit one of can be in the following ways realized S
jStructure (ω): with the frequency-region signal absolute value of peak value correspondence with and former and later two frequency-region signal absolute values carry out the binomial interpolation or fit to the segmentation straight line, or come match with cubic polynomial.
Need to prove, each unit of mentioning in the present embodiment all is a logical block, physically, a logical block can be a physical location, it also can be the part of a physical location, can also realize that the physics realization mode of these logical blocks itself is not most important with the combination of a plurality of physical locations, the combination of the function that these logical blocks realized is the key that just solves technical matters proposed by the invention.
In addition, for outstanding innovation part of the present invention, present embodiment will not introduced not too close unit with solving technical matters relation proposed by the invention, and this does not show that there is not other unit in this equipment embodiment.
Though by with reference to some preferred embodiment of the present invention, the present invention is illustrated and describes, those of ordinary skill in the art should be understood that and can do various changes to it in the form and details, and without departing from the spirit and scope of the present invention.