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 said 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|;
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 said 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.
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 carried out reconstruct; 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 show as peak value usually, so, can improve accuracy and antijamming capability that fundamental frequency calculates through 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 through conversion disperses, through 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 through 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 object of the invention, technical scheme and advantage clearer, embodiment of the present invention is done to describe in detail further below in conjunction with accompanying drawing.
First embodiment of the present invention relates to a kind of method of computing voice fundamental frequency, and is 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 through 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 practical application, also can realize through other modes.Such as, can be through 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 practical application, also can in more point, (among as 5 or 6) choose maximal value.
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 after the FFT conversion, obtains 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|.Down in the face of continuous function S
jMake (ω) further specifies.
In this embodiment, through with the corresponding frequency-region signal absolute value of peak value 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 Y
iIn the pairing value of field of definition is ω
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 through 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 through the binomial interpolation method
j(ω) function, i.e. S
j(ω)=a
jω
2+ b
jω+c
j
Need to prove, because in this 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 that each peak value is corresponding 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 used arbitrary function S with these parts simply
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, get into 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 possibly 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 practical application, also can adopt other formula, as with square changing to 4 powers or 1 power etc. in the above-mentioned formula.Above-mentioned ω
pThe essence of correlation formula is when pitch search, to take all factors into consideration candidate's fundamental frequency and a plurality of frequency multiplication thereof, and concrete formula form can have other variation, can make Search Results more accurate like this
Because in this embodiment; Before calculating fundamental frequency, earlier used frequency-region signal is carried out reconstruct; 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 show as peak value usually, so, can improve accuracy and antijamming capability that fundamental frequency calculates through 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 through conversion disperses, through 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 this embodiment, 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 practical application, 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 this embodiment is roughly the same with first embodiment, and its difference is, in the first embodiment, is constructing continuous function S
jIn the time of (ω), be through with the corresponding frequency-region signal absolute value of peak value with and former and later two frequency-region signal absolute values carry out the binomial interpolation and realize; And in this embodiment, can be through 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 with 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; Abbreviation " PAL "), RAS (Random Access Memory; Abbreviation " RAM "), programmable read only memory (Programmable Read Only Memory is called for short " PROM "), ROM (read-only memory) (Read-Only Memory is called for short " ROM "), Electrically Erasable Read Only Memory (Electrically Erasable Programmable ROM; Abbreviation " 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, and is 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 possibly 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 can adopt one of following mode to realize S
jStructure (ω): with the corresponding frequency-region signal absolute value of peak value 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 this embodiment all is a logical block, and 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, this embodiment will not introduced with solving the not too close unit of technical matters relation proposed by the invention, and this does not show that there is not other unit in this equipment embodiment.
Though through 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 form with on the details, and without departing from the spirit and scope of the present invention.