CN108831509B - Method and device for determining pitch period, computer equipment and storage medium - Google Patents
Method and device for determining pitch period, computer equipment and storage medium Download PDFInfo
- Publication number
- CN108831509B CN108831509B CN201810607513.7A CN201810607513A CN108831509B CN 108831509 B CN108831509 B CN 108831509B CN 201810607513 A CN201810607513 A CN 201810607513A CN 108831509 B CN108831509 B CN 108831509B
- Authority
- CN
- China
- Prior art keywords
- pitch period
- frame
- audio signal
- detected
- target
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 51
- 230000005236 sound signal Effects 0.000 claims abstract description 193
- 230000006870 function Effects 0.000 claims description 90
- 238000004590 computer program Methods 0.000 claims description 27
- 238000009499 grossing Methods 0.000 claims description 19
- 230000008859 change Effects 0.000 description 5
- 238000010586 diagram Methods 0.000 description 4
- 230000008569 process Effects 0.000 description 4
- 238000000605 extraction Methods 0.000 description 3
- 238000004364 calculation method Methods 0.000 description 2
- 238000001514 detection method Methods 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 238000001914 filtration Methods 0.000 description 2
- 230000001360 synchronised effect Effects 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000035772 mutation Effects 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 210000001260 vocal cord Anatomy 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G10—MUSICAL INSTRUMENTS; ACOUSTICS
- G10L—SPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
- G10L25/00—Speech or voice analysis techniques not restricted to a single one of groups G10L15/00 - G10L21/00
- G10L25/90—Pitch determination of speech signals
Landscapes
- Engineering & Computer Science (AREA)
- Computational Linguistics (AREA)
- Signal Processing (AREA)
- Health & Medical Sciences (AREA)
- Audiology, Speech & Language Pathology (AREA)
- Human Computer Interaction (AREA)
- Physics & Mathematics (AREA)
- Acoustics & Sound (AREA)
- Multimedia (AREA)
- Electrophonic Musical Instruments (AREA)
- Display Devices Of Pinball Game Machines (AREA)
Abstract
The application relates to a pitch period determination method, a pitch period determination device, a computer device and a storage medium. The method comprises the following steps: when the audio signal to be detected is a voiced sound signal in the current frame, acquiring a target cost value of each first pitch period of the audio signal to be detected in the current frame according to a preset cost function; wherein the target cost value comprises: a cost value between each first pitch period of the audio signal to be measured and each second pitch period in an associated frame, the associated frame including: a history frame adjacent to the current frame and a leading frame set positioned after the current frame; and determining the target pitch period of the audio signal to be detected in the current frame from each first pitch period according to each target cost value. The method can improve the accuracy of the pitch period.
Description
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a method, an apparatus, a computer device, and a storage medium for determining a pitch period.
Background
The pitch period is the time when the vocal cords are opened and closed once, and the pitch period is widely applied in the fields of speech coding, recognition and the like as a characteristic of an audio signal.
In the process of extracting the pitch period, errors may occur due to various kinds of interference, for example, a double frequency or a half frequency of a real pitch period is determined as an individual pitch period, or an individual abrupt change point appears in a locus of the pitch period. In order to reduce the error rate in the pitch period extraction process, generally, after the pitch period extraction is completed, a trajectory formed by the extracted pitch period needs to be smoothed to remove a point where a mutation occurs in the pitch extraction process. Currently, a commonly used smoothing method is a median filtering method, and the principle of the method is to select the intermediate value of a plurality of consecutive candidate pitch periods in a sliding window section as the final output pitch period.
Then, the track of the pitch period is smoothed by adopting a median filtering method, and the accuracy of the obtained pitch period is lower.
Disclosure of Invention
In view of the above, it is necessary to provide a pitch period determination method, apparatus, computer device and storage medium capable of improving the accuracy of the pitch period.
A method of pitch period determination, the method comprising:
when the audio signal to be detected is a voiced sound signal in the current frame, acquiring a target cost value of each first pitch period of the audio signal to be detected in the current frame according to a preset cost function; wherein the target cost value comprises: a cost value between each first pitch period of the audio signal to be measured and each second pitch period in an associated frame, the associated frame including: a history frame adjacent to the current frame and a leading frame set positioned after the current frame;
and determining the target pitch period of the audio signal to be detected in the current frame from each first pitch period according to each target cost value.
In one embodiment, the obtaining, according to a preset cost function, a target cost value corresponding to each first pitch period of the audio signal to be detected in the current frame includes:
according to the cost function, acquiring a first generation value between each first pitch period of the audio signal to be detected and a second pitch period in the historical frame, and acquiring a second generation value between each first pitch period of the audio signal to be detected and a second pitch period in a target leading frame; the target leading frame is the leading frame which is positioned at the last in time sequence in the leading frame set;
and obtaining the target cost value according to the first cost value and the second cost value.
In one embodiment, the leading frame set comprises a first leading frame and a second leading frame, and the second leading frame is the target leading frame; the obtaining a second cost value between each first pitch period of the audio signal to be detected and a second pitch period in the target leading frame includes:
according to the cost function, acquiring a third cost value between each first pitch period of the audio signal to be detected and each second pitch period in the first leading frame, and acquiring a fourth cost value between each second pitch period of the audio signal to be detected in the first leading frame and each second pitch period of the audio signal to be detected in the second leading frame;
and obtaining the second generation value according to the third generation value and the fourth generation value.
In one embodiment, if the audio signal to be detected is an unvoiced signal in the associated frame, the cost function is a function constructed according to an error value between the audio signal to be detected and an offset audio signal in the first pitch period, and the offset audio signal is a signal obtained by offsetting the audio signal to be detected according to the first pitch period.
In one embodiment, the cost function is W (n, n ± 1) ═ α × En(kn) Wherein n is the identifier of the current frame, n + -1 is the identifier of the associated frame, α is the smoothing coefficient, En(kn) For an error function corresponding to said first pitch period, knIs the first pitch period.
In one embodiment, if the audio signal to be tested is a voiced signal in the associated frame, the cost function is a function constructed according to the first pitch period, the second pitch period, and an error value between the audio signal to be tested and an offset signal in the first pitch period, and the offset audio signal is a signal obtained by offsetting the audio signal to be tested according to the first pitch period.
In one embodiment, the cost function is W (n, n ± 1) ═ kn-kn±1|+α*En(kn) Wherein n is the identifier of the current frame, n + -1 is the identifier of the associated frame, α is the smoothing coefficient, En(kn) For an error function corresponding to said first pitch period, knFor said first pitch period, kn±1Is the second pitch period.
In one embodiment, the determining, according to each target cost value, a target pitch period of the audio signal to be detected in the current frame from each first pitch period includes:
and determining a first pitch period corresponding to the minimum cost value in each target cost value as the target pitch period.
An apparatus for pitch period determination, the apparatus comprising:
the acquisition module is used for acquiring the target cost value of each first pitch period of the audio signal to be detected in the current frame according to a preset cost function when the audio signal to be detected is a voiced signal in the current frame; wherein the target cost value comprises: a cost value between each first pitch period of the audio signal to be measured and each second pitch period in an associated frame, the associated frame including: a history frame adjacent to the current frame and a leading frame set positioned after the current frame;
and the determining module is used for determining the target pitch period of the audio signal to be detected in the current frame from each first pitch period according to each target cost value.
A computer device comprising a memory and a processor, the memory storing a computer program, the processor implementing the following steps when executing the computer program:
when the audio signal to be detected is a voiced sound signal in the current frame, acquiring a target cost value of each first pitch period of the audio signal to be detected in the current frame according to a preset cost function; wherein the target cost value comprises: a cost value between each first pitch period of the audio signal to be measured and each second pitch period in an associated frame, the associated frame including: a history frame adjacent to the current frame and a leading frame set positioned after the current frame;
and determining the target pitch period of the audio signal to be detected in the current frame from each first pitch period according to each target cost value.
A computer-readable storage medium, on which a computer program is stored which, when executed by a processor, carries out the steps of:
when the audio signal to be detected is a voiced sound signal in the current frame, acquiring a target cost value of each first pitch period of the audio signal to be detected in the current frame according to a preset cost function; wherein the target cost value comprises: a cost value between each first pitch period of the audio signal to be measured and each second pitch period in an associated frame, the associated frame including: a history frame adjacent to the current frame and a leading frame set positioned after the current frame;
and determining the target pitch period of the audio signal to be detected in the current frame from each first pitch period according to each target cost value.
According to the method, the device, the computer equipment and the storage medium for determining the pitch period, when the audio signal to be detected is a voiced signal in the current frame, the target cost value of each first pitch period of the audio signal to be detected in the current frame is obtained according to the preset cost function, and the target pitch period of the audio signal to be detected in the current frame is determined from each first pitch period according to each target cost value, wherein the target cost value comprises: a cost value between each first pitch period of the audio signal to be measured and each second pitch period in the associated frame, the associated frame comprising: the historical frame adjacent to the current frame and the leading frame set positioned behind the current frame can determine the target pitch period in the current frame by combining the pitch period change among the current frame, the historical frame and the leading frame, thereby effectively removing the mutated pitch period, achieving better smoothing effect and improving the accuracy of the pitch period.
Drawings
FIG. 1 is a flow diagram of a method for pitch period determination according to one embodiment;
FIG. 2 is a diagram of a frame structure according to an embodiment;
FIG. 3 is a flowchart of a possible implementation method of step 101 in FIG. 1;
FIG. 4 is a flowchart of a possible implementation method of step 201 in FIG. 3;
fig. 5 is a device for determining a pitch period according to an embodiment;
fig. 6 is a device for determining a pitch period according to another embodiment;
FIG. 7 is a schematic diagram of an architecture of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The pitch period determining method provided by the application can be applied to an acoustic detection environment and used for smoothing the pitch period of a voice signal so as to filter out a point with a sudden change in the pitch period. The execution subject of the method can be a terminal, a server and the like. The terminal can be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers and portable wearable devices, and the server can be implemented by an independent server or a server cluster formed by a plurality of servers.
Fig. 1 is a flowchart of a pitch period determining method according to an embodiment, as shown in fig. 1, the method includes the following steps:
Wherein the cost function is a function constructed according to the variation of pitch periods in adjacent time frames, and is used for calculating the cost value between the pitch periods in the adjacent time frames, and the cost value is used for representing the error between the pitch periods in the adjacent time frames. The larger the pitch period variation in adjacent time frames, the larger the cost value obtained from the cost function. The target cost value of the first pitch period includes a cost value between each first pitch period of the audio signal to be measured and each second pitch period in the history frame, and a cost value between each first pitch period of the audio signal to be measured and each second pitch period in the preamble frame. The first pitch period and the second pitch period are alternative pitch periods of the audio signal to be detected in each time frame, which are determined by adopting methods such as autocorrelation detection, amplitude difference and the like.
As shown in FIG. 2, the current frame is Frm(0)The history frame is Frm(-1)The preamble frame set comprises a preamble frame Frm(1)And a preamble frame Frm(2)Wherein the history frame Frm(-1)Including a second pitch period that has been smoothed, current frame Frm(0)Preamble frame Frm(1)And a preamble frame Frm(2)Each including 5 alternative pitch periods. It should be noted that the leading frame set may include one leading frame adjacent to the current frame, or may include a plurality of leading frames located after the current frame, for example, the leading frame set includes 3, 4, or even more leading frames located after the current frame, and the leading frames in the leading frame set are consecutive in time sequence. The number of candidate pitch periods in the current frame and each preceding frame is not limited in this application.
The cost value W1 between each first pitch period of the audio signal to be tested in the current frame and the second pitch period in the history frame can be calculated according to the cost function, then the cost value W2 between each first pitch period of the audio signal to be tested in the current frame and the second pitch period in the previous frame is calculated according to the cost function, and the target cost value is obtained by adding W1 and W2 corresponding to each first pitch period, or by performing weighted summation on W1 and W2. Since there are a plurality of second pitch periods in the preceding frame corresponding to each pitch period in the current frame, there are a plurality of W2 for each first pitch period in the current frame, and there are a plurality of target cost values for each first pitch period in the current frame.
And 102, determining a target pitch period of the audio signal to be detected in the current frame from each first pitch period according to each target cost value.
In this embodiment, since the larger the cost value is, the larger the variation between the pitch periods in the adjacent time frames is, the first pitch period corresponding to the smaller target cost value may be selected as the target pitch period of the audio signal to be measured in the current frame. For example, the target cost values are arranged in the order from small to large, and the first pitch period corresponding to one or more target cost values arranged in front is taken as the target pitch period of the audio signal to be measured in the current frame.
In the pitch period determining method provided in the embodiment of the present application, when the audio signal to be detected is a voiced signal in the current frame, the target cost value of each first pitch period of the audio signal to be detected in the current frame is obtained according to the preset cost function, and the target pitch period of the audio signal to be detected in the current frame is determined from each first pitch period according to each target cost value, where the target cost value includes: a cost value between each first pitch period of the audio signal to be measured and each second pitch period in the associated frame, the associated frame comprising: the historical frame adjacent to the current frame and the leading frame set positioned behind the current frame can determine the target pitch period in the current frame by combining the pitch period change among the current frame, the historical frame and the leading frame, thereby effectively removing the mutated pitch period, achieving better smoothing effect and improving the accuracy of the pitch period.
Optionally, the step 101 "determining a target pitch period of the audio signal to be measured in the current frame from each first pitch period according to each target cost value" includes: and determining a first pitch period corresponding to the minimum cost value in the target cost values as a target pitch period.
In this embodiment, since the larger the variation of the pitch period in the adjacent time is, the larger the cost value is, the first pitch period corresponding to the minimum and large value in each target cost value is determined as the target pitch period, which can effectively filter the mutated pitch period, so that the pitch period variation between each time frame is smaller, and the accuracy and reliability of the pitch period are ensured.
Optionally, on the basis of the embodiment shown in fig. 1, if the audio signal to be measured is an unvoiced signal in the associated frame, the cost function is a function constructed according to an error value between the audio signal to be measured and the offset audio signal in the first pitch period, and the offset audio signal is a signal of the audio signal to be measured after being offset according to the first pitch period.
In this embodiment, the cost function is used to calculate a cost value between two adjacent time frames, and the associated frame may be a historical frame or a leading frame. When the history frame or the leading frame is an unvoiced signal, a function may be constructed according to an error value between the audio signal to be measured and the offset audio signal in the first pitch period. The error value between the audio signal to be detected and the offset audio signal in the first pitch period may be an error value obtained by a method such as a single normalized autocorrelation error or a normalized energy difference.
Optionally, if the audio signal to be measured is an unvoiced signal in the associated frame, the cost function is W (n, n ± 1) ═ α × En(kn) Wherein n is the identifier of the current frame, n + -1 is the identifier of the associated frame, α is the smoothing coefficient, 0<α≤256,En(kn) For the error function corresponding to the first pitch period, knIs the first pitch period.
In this embodiment, when the audio signal to be measured is an unvoiced sound signal in the associated frame, the formula W (n, n ± 1) ═ α × E may be usedn(kn) And calculating the cost value, wherein n-1 is the identifier of the historical frame, and n +1 is the identifier of the leading frame. Taking FIG. 2 as an example, if the historical frame Frm(-1)For unvoiced signals, the formula W (0, -1) ═ α × E is used0(k0) Calculating current frame Frm(0)And history frame Frm(-1)A cost value therebetween; if the leading frame Frm(1)For unvoiced signals, the formula W (0,1) ═ α × E is used0(k0) Calculating current frame Frm(0)And a preamble frame Frm(1)The cost value in between.
Optionally, on the basis of the embodiment shown in fig. 1, if the audio signal to be measured is a voiced signal in the associated frame, the cost function is a function constructed according to the first pitch period, the second pitch period, and an error value between the audio signal to be measured and the offset signal in the first pitch period, and the offset audio signal is a signal obtained by offsetting the audio signal to be measured according to the first pitch period.
In this embodiment, when the history frame or the preceding frame is an unvoiced signal, a function may be constructed according to the first pitch period, a second pitch period, and an error value between the audio signal to be measured and the offset signal in the first pitch period, where the second pitch period is the second pitch period in the history frame or the second pitch period in the preceding frame.
Alternatively, on the basis of the embodiment shown in fig. 1, if the audio signal to be measured is a voiced signal in the associated frame, the cost function is W (n, n ± 1) ═ kn-kn±1|+α*En(kn) Wherein n is the identifier of the current frame, n + -1 is the identifier of the associated frame, α is the smoothing coefficient, En(kn) For the error function corresponding to the first pitch period, knIs the first pitch period, kn±1Is the second pitch period.
In this embodiment, if the audio signal to be measured is a voiced signal in the associated frame, the formula W (n, n ± 1) ═ k is adoptedn-kn±1|+α*En(kn) Calculating the cost value, n-1 is the mark of the history frame, n +1 is the mark of the leading frame, kn-1For the second pitch period, k, in the history framen+1Is the second pitch period in the leading frame. Taking FIG. 2 as an example, if the historical frame Frm(-1)For voiced signals, the formula W (0, -1) ═ k is used0-k-1|+α*E0(k0) Calculating current frame Frm(0)And history frame Frm(-1)A cost value therebetween; if the leading frame Frm: (1)For voiced signals, the formula W (0,1) ═ k is used0-k1|+α*E0(k0) Calculating current frame Frm(0)And a preamble frame Frm(1)The cost value in between.
Fig. 3 is a flowchart of a possible implementation method of step 101 in fig. 1, where on the basis of the embodiment shown in fig. 1, as shown in fig. 3, the step "obtaining a target cost value corresponding to each first pitch period of the audio signal to be detected in the current frame according to a preset cost function" includes:
Wherein, the target leading frame is the leading frame which is positioned at the last in time sequence in the leading frame set, as shown in fig. 2, if the leading frame set includes Frm(-1)The one leading frame, the target leading frame is Frm(-1)If Frm is included in the preamble frame set(1)And Frm(2)Then the target leading frame is Frm(2)Alternatively, Frm is included in the preamble frame set(1)、Frm(2)、Frm(3)Then the target leading frame is Frm(3)And so on.
In the present embodiment, according to the cost function, a first cost value between each first pitch period of the audio signal to be tested and the second pitch period in the history frame, and a second cost value between each first pitch period of the audio signal to be tested and the second pitch period in the target leading frame can be calculated. As shown in FIG. 2, for the first pitch period B1, the current frame Frm(0)The first pitch period B1 in the historical frame Frm(-1)Is marked as W (B1, a), the current frame Frm(0)With the first pitch period B1 in the target leading frame Frm(2)The second cost values between the second pitch periods D1 are respectively marked as W (B1, D1), W (B1, D2), W (B1, D3), W (B1, D4), W (B1, D5), wherein the paths corresponding to W (B1, D1) may include B1-C1-D1, B1-C2-D1, B1-C3-D1 … …, and so on, and are not described herein again.
Optionally, if the leading frame set includes a first leading frame and a second leading frame, and the second leading frame is a target leading frame; as shown in fig. 4, one possible implementation method of step 201 may include:
Taking fig. 2 as an example, the first preamble frame is Frm(1)The second leading frame is Frm(2)Taking the first pitch period B1 as an example, the first pitch period B1 and the first leading frame Frm are obtained according to the cost function(1)A third generation value W (B1, C1), W (B1, C2), W (B1, C3), W (B1, C4), W (B1, C5) between second pitch periods in (a); with a first leading frame Frm(1)Taking the second pitch period C1 as an example, the first leading frame Frm is obtained(1)Second pitch period C1 and the audio signal to be tested in the second leading frame Frm(2)W (C1, D1), W (C1, D2), W (C1, D3), W (C1, D4), W (C1, D5), and so on, among the second pitch periods, a plurality of third generation values and a plurality of fourth generation values are obtained.
When calculating the fourth cost value between each second pitch period of the audio signal to be measured in the first leading frame and each second pitch period of the audio signal to be measured in the second leading frame, the cost function W (n, n ± 1) ═ α × E may also be usedn(kn) Or W (n, n ± 1) ═ kn-kn±1|+α*En(kn). For example, if the second preamble frame is unvoiced, the formula W (1,2) ═ α × E is adopted1(k1) Calculating a fourth cost value, and if the second leading frame is voiced, adopting a formula W (1,2) ═ k1-k2|+α*E1(k1) A fourth cost value is calculated.
Optionally, the minimum cost value between each second pitch period of the audio signal to be detected in the first leading frame and the second pitch period of the audio signal to be detected in the second leading frame may also be obtained first, and the minimum cost value corresponding to each second pitch period of the audio signal to be detected in the first leading frame is taken as the fourth cost value; and then, the third generation value and the fourth cost value between each first pitch period of the audio signal to be detected and each second pitch period in the first leading frame are combined and added to obtain a second generation value. The method can reduce the calculation steps and improve the efficiency.
Taking fig. 2 as an example, 1) calculates the first preamble frame Frm(1)All second pitch periods to the second leading frame Frm(2)Over 25-clock conditions, to finally arrive at the first leading frame Frm(1)Of each second pitch period. 2) At calculation Frm(0)To Frm(1)To Frm(2)The cost value of (c) is not needed to be calculated Frm(1)To Frm(2)In other cases than the known minimum cost value, a recalculation Frm is made(0)To Frm(1)To Frm(2)The minimum cost value of (c) and recorded. 3) Due to Frm(-1)For the last smoothing of the found pitch period, it is only necessary to traverse Frm(-1)Calculating 5 decimal values by the step 2) to obtain Frm(0)The minimum cost value of the five first pitch periods as the target cost value. 4) Frm will be mixed(0)Updating to historical frame, using the first pitch period corresponding to the target cost value as the second pitch period in the historical frame, and Frm(1)Update to current frame Frm(2)As the first leading frame, smoothing processing of the next frame is started.
For example, in the first leading frame Frm(1)Taking the second pitch period C1 as an example, the first leading frame Frm is obtained(1)Second pitch period C1 and the audio signal to be tested in the second leading frame Frm(2)W (C1, D1), W (C1, D2), W (C1, D3), W (C1, D4), W (C1, D5) among the second pitch periods in (b), and if W (C1, D2) is the smallest, then W (C1, D2) is taken as the first leading frame Frm(1)The fourth cost value of the second pitch period C1, and so on, the first leading frame Frm is calculated(1)The fourth cost value of the other second pitch period C1.
And 302, obtaining a second generation value according to the third generation value and the fourth generation value.
In this embodiment, the plurality of third generation values and the plurality of fourth generation values are combined and added, or weighted values of the plurality of third generation values and the plurality of fourth generation values are combined and added, so as to obtain the second generation value.
According to the method, according to the cost function, a third generation value between each first pitch period of the audio signal to be detected and each second pitch period in the first leading frame is obtained, a fourth generation value between each second pitch period of the audio signal to be detected in the first leading frame and each second pitch period of the audio signal to be detected in the second leading frame is obtained, according to the third generation value and the fourth generation value, the target generation value of each first pitch period of the current frame is calculated by adopting at least the pitch periods of four adjacent time frames, the target generation value reflects pitch change between different time frames, and the smoothing process of the pitch periods is more reliable and accurate.
And 202, obtaining a target cost value according to the first cost value and the second cost value.
In this embodiment, the sum of the first generation value and the second generation value may be the target generation value, or different weights may be given to the first generation value and the second generation value, and then the first generation value and the second generation value are weighted and summed to obtain the target generation value. For example, as shown in fig. 2, the target cost values of the first pitch period B1 may be W (B1, a) + W (B1, D1), W (B1, a) + W (B1, D2), W (B1, a) + W (B1, D3), respectively.
Illustratively, in FIG. 2, a current frame Frm is shown(0)Of the first pitch period of the audio signal and in the historical frame Frm(-1)Is marked as W (0, -1), and each current frame Frm is marked as a value of the first pitch between the second pitch periods(0)At the first pitch period and in the first preceding frame Frm(1)Is marked as W (0,1), will be in the first leading frame Frm(1)Of the audio signal to be tested in the second preamble frame Frm(2)Each second group in (1)A fourth cost value between the pitch periods is denoted as W (1,2), and the target cost value W is W (0, -1) + W (0,1) + W (1,2), and theoretically there may be 5 × 5 — 125 target cost values, and the first pitch period corresponding to the target cost value with the smallest value among the 125 target cost values may be used as the target pitch period.
According to the pitch period determining method provided by the embodiment, according to the cost function, a first generation value between each first pitch period of the audio signal to be detected and a second pitch period in the historical frame is obtained, a second generation value between each first pitch period of the audio signal to be detected and a second pitch period in the target leading frame is obtained, a target generation value is obtained according to the first generation value and the second generation value, and the target generation value is determined according to the cost values between the pitch periods in at least three time frames, so that the target cost value of each pitch period in the current frame has a more accurate reference meaning, the prominent pitch period can be filtered out, and the accuracy of the pitch period is improved.
It should be understood that although the various steps in the flow charts of fig. 1-4 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 1-4 may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, and the order of performance of the sub-steps or stages is not necessarily sequential, but may be performed in turn or alternating with other steps or at least some of the sub-steps or stages of other steps.
Fig. 5 is a device for determining a pitch period according to an embodiment, as shown in fig. 5, the device includes: an acquisition module 11 and a determination module 12.
An obtaining module 11, configured to, when an audio signal to be detected is a voiced signal in a current frame, obtain a target cost value of each first pitch period of the audio signal to be detected in the current frame according to a preset cost function; wherein the target cost value comprises: a cost value between each first pitch period of the audio signal to be measured and each second pitch period in an associated frame, the associated frame including: a history frame adjacent to the current frame and a leading frame set positioned after the current frame;
and a determining module 12, configured to determine, according to each target cost value, a target pitch period of the audio signal to be detected in the current frame from each first pitch period.
In one embodiment, as shown in fig. 6, the obtaining module 11 includes a first obtaining submodule 111 and a second obtaining submodule 112; the first obtaining submodule 111 is configured to obtain, according to the cost function, a first generation value between each first pitch period of the audio signal to be detected and a second pitch period in the historical frame, and obtain a second generation value between each first pitch period of the audio signal to be detected and a second pitch period in the target leading frame; the target leading frame is the leading frame which is positioned at the last in time sequence in the leading frame set; the second obtaining sub-module 112 is configured to obtain the target cost value according to the first cost value and the second cost value.
In one embodiment, the leading frame set comprises a first leading frame and a second leading frame, and the second leading frame is the target leading frame; the first obtaining sub-module 111 obtains a second cost value between each first pitch period of the audio signal to be detected and a second pitch period in the target leading frame, including: the first obtaining sub-module 111 obtains, according to the cost function, a third cost value between each first pitch period of the audio signal to be detected and each second pitch period in the first leading frame, and obtains a fourth cost value between each second pitch period of the audio signal to be detected in the first leading frame and each second pitch period of the audio signal to be detected in the second leading frame; and obtaining the second generation value according to the third generation value and the fourth generation value.
In one embodiment, if the audio signal to be detected is an unvoiced signal in the associated frame, the cost function is a function constructed according to an error value between the audio signal to be detected and an offset audio signal in the first pitch period, and the offset audio signal is a signal obtained by offsetting the audio signal to be detected according to the first pitch period.
In one embodiment, the cost function is W (n, n ± 1) ═ α × En(kn) Wherein n is the identifier of the current frame, n + -1 is the identifier of the associated frame, α is the smoothing coefficient, En(kn) For an error function corresponding to said first pitch period, knIs the first pitch period.
In one embodiment, if the audio signal to be tested is a voiced signal in the associated frame, the cost function is a function constructed according to the first pitch period, the second pitch period, and an error value between the audio signal to be tested and an offset signal in the first pitch period, and the offset audio signal is a signal obtained by offsetting the audio signal to be tested according to the first pitch period.
In one embodiment, the cost function is W (n, n ± 1) ═ kn-kn±1|+α*En(kn) Wherein n is the identifier of the current frame, n + -1 is the identifier of the associated frame, α is the smoothing coefficient, En(kn) For an error function corresponding to said first pitch period, knFor said first pitch period, kn±1Is the second pitch period.
In one embodiment, the determining module 12 is specifically configured to determine that the first pitch period corresponding to the minimum cost value in each of the target cost values is the target pitch period.
For the specific definition of the pitch period determination device, reference may be made to the above definition of the pitch period determination method, and details are not described here. The modules in the above-described pitch period determining means may be implemented in whole or in part by software, hardware, and combinations thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a server, the internal structure of which may be as shown in fig. 7. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The database of the computer device is for storing cost value data. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a method of pitch period determination.
Those skilled in the art will appreciate that the architecture shown in fig. 7 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided, comprising a memory and a processor, the memory having a computer program stored therein, the processor implementing the following steps when executing the computer program:
when the audio signal to be detected is a voiced sound signal in the current frame, acquiring a target cost value of each first pitch period of the audio signal to be detected in the current frame according to a preset cost function; wherein the target cost value comprises: a cost value between each first pitch period of the audio signal to be measured and each second pitch period in an associated frame, the associated frame including: a history frame adjacent to the current frame and a leading frame set positioned after the current frame;
and determining the target pitch period of the audio signal to be detected in the current frame from each first pitch period according to each target cost value.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
according to the cost function, acquiring a first generation value between each first pitch period of the audio signal to be detected and a second pitch period in the historical frame, and acquiring a second generation value between each first pitch period of the audio signal to be detected and a second pitch period in a target leading frame; the target leading frame is the leading frame which is positioned at the last in time sequence in the leading frame set; and obtaining the target cost value according to the first cost value and the second cost value.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
according to the cost function, acquiring a third cost value between each first pitch period of the audio signal to be detected and each second pitch period in the first leading frame, and acquiring a fourth cost value between each second pitch period of the audio signal to be detected in the first leading frame and each second pitch period of the audio signal to be detected in the second leading frame; and obtaining the second generation value according to the third generation value and the fourth generation value.
In one embodiment, the processor, when executing the computer program, further performs the steps of: if the audio signal to be detected is an unvoiced signal in the associated frame, the cost function is a function constructed according to an error value between the audio signal to be detected and a shifted audio signal in the first pitch period, and the shifted audio signal is a signal of the audio signal to be detected after being shifted according to the first pitch period.
In one embodiment, the processor, when executing the computer program, further implements the method of:
the cost function is W (n, n +/-1) ═ alpha En(kn),Wherein n is the identifier of the current frame, n + -1 is the identifier of the associated frame, α is the smoothing coefficient, En(kn) For an error function corresponding to said first pitch period, knIs the first pitch period.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
if the audio signal to be detected is a voiced signal in the associated frame, the cost function is a function constructed according to the first pitch period, the second pitch period, and an error value between the audio signal to be detected and an offset signal in the first pitch period, and the offset audio signal is a signal after the audio signal to be detected is offset according to the first pitch period.
In one embodiment, the processor, when executing the computer program, further implements the method of:
the cost function is W (n, n + -1) ═ kn-kn±1|+α*En(kn) Wherein n is the identifier of the current frame, n + -1 is the identifier of the associated frame, α is the smoothing coefficient, En(kn) For an error function corresponding to said first pitch period, knFor said first pitch period, kn±1Is the second pitch period.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
and determining a first pitch period corresponding to the minimum cost value in each target cost value as the target pitch period.
In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of:
when the audio signal to be detected is a voiced sound signal in the current frame, acquiring a target cost value of each first pitch period of the audio signal to be detected in the current frame according to a preset cost function; wherein the target cost value comprises: a cost value between each first pitch period of the audio signal to be measured and each second pitch period in an associated frame, the associated frame including: a history frame adjacent to the current frame and a leading frame set positioned after the current frame;
and determining the target pitch period of the audio signal to be detected in the current frame from each first pitch period according to each target cost value.
In one embodiment, the computer program when executed by the processor further performs the steps of:
according to the cost function, acquiring a first generation value between each first pitch period of the audio signal to be detected and a second pitch period in the historical frame, and acquiring a second generation value between each first pitch period of the audio signal to be detected and a second pitch period in a target leading frame; the target leading frame is the leading frame which is positioned at the last in time sequence in the leading frame set;
and obtaining the target cost value according to the first cost value and the second cost value.
In one embodiment, the computer program when executed by the processor further performs the steps of:
according to the cost function, acquiring a third cost value between each first pitch period of the audio signal to be detected and each second pitch period in the first leading frame, and acquiring a fourth cost value between each second pitch period of the audio signal to be detected in the first leading frame and each second pitch period of the audio signal to be detected in the second leading frame; and obtaining the second generation value according to the third generation value and the fourth generation value.
In one embodiment, the computer program when executed by the processor further performs the steps of:
if the audio signal to be detected is an unvoiced signal in the associated frame, the cost function is a function constructed according to an error value between the audio signal to be detected and a shifted audio signal in the first pitch period, and the shifted audio signal is a signal of the audio signal to be detected after being shifted according to the first pitch period.
In one embodiment, the computer program when executed by the processor further implements the method of:
the cost function is W (n, n +/-1) ═ alpha En(kn) Wherein n is the identifier of the current frame, n + -1 is the identifier of the associated frame, α is the smoothing coefficient, En(kn) For an error function corresponding to said first pitch period, knIs the first pitch period.
In one embodiment, the computer program when executed by the processor further performs the steps of:
if the audio signal to be detected is a voiced signal in the associated frame, the cost function is a function constructed according to the first pitch period, the second pitch period, and an error value between the audio signal to be detected and an offset signal in the first pitch period, and the offset audio signal is a signal after the audio signal to be detected is offset according to the first pitch period.
In one embodiment, the computer program when executed by the processor further implements the method of:
the cost function is W (n, n + -1) ═ kn-kn±1|+α*En(kn) Wherein n is the identifier of the current frame, n + -1 is the identifier of the associated frame, α is the smoothing coefficient, En(kn) For an error function corresponding to said first pitch period, knFor said first pitch period, kn±1Is the second pitch period.
In one embodiment, the computer program when executed by the processor further performs the steps of:
and determining a first pitch period corresponding to the minimum cost value in each target cost value as the target pitch period.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
The technical features of the embodiments described above may be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the embodiments described above are not described, but should be considered as being within the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present invention, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the inventive concept, which falls within the scope of the present invention. Therefore, the protection scope of the present patent shall be subject to the appended claims.
Claims (10)
1. A method for pitch period determination, the method comprising:
when the audio signal to be detected is a voiced sound signal in the current frame, acquiring a target cost value of each first pitch period of the audio signal to be detected in the current frame according to a preset cost function; wherein the target cost value comprises: a cost value between each first pitch period of the audio signal to be measured and each second pitch period in an associated frame, the associated frame comprising: a history frame adjacent to the current frame and a leading frame set positioned after the current frame; if the audio signal to be detected is an unvoiced signal in the associated frame, the cost function is a function constructed according to an error value between the audio signal to be detected and a shifted audio signal in the first pitch period, and the shifted audio signal is a signal of the audio signal to be detected after being shifted according to the first pitch period;
and determining the target pitch period of the audio signal to be detected in the current frame from each first pitch period according to each target cost value.
2. The method according to claim 1, wherein the obtaining a target cost value corresponding to each first pitch period of the audio signal to be tested in the current frame according to a preset cost function includes:
according to the cost function, acquiring a first generation value between each first pitch period of the audio signal to be detected and a second pitch period in the historical frame, and acquiring a second generation value between each first pitch period of the audio signal to be detected and a second pitch period in a target leading frame; the target leading frame is the leading frame which is positioned at the last in time sequence in the leading frame set;
and obtaining the target cost value according to the first cost value and the second cost value.
3. The method of claim 2, wherein the set of leading frames comprises a first leading frame and a second leading frame, and the second leading frame is the target leading frame; the obtaining a second cost value between each first pitch period of the audio signal to be detected and a second pitch period in the target leading frame includes:
according to the cost function, acquiring a third cost value between each first pitch period of the audio signal to be detected and each second pitch period in the first leading frame, and acquiring a fourth cost value between each second pitch period of the audio signal to be detected in the first leading frame and each second pitch period of the audio signal to be detected in the second leading frame;
and obtaining the second generation value according to the third generation value and the fourth generation value.
4. The method according to claim 1, wherein the cost function is W (n, n ± 1) ═ α × En(kn) Wherein n is the identifier of the current frame, n + -1 is the identifier of the associated frame, α is the smoothing coefficient, En(kn) For an error function corresponding to said first pitch period, knIs the first pitch period.
5. The method according to any of claims 1-3, wherein if the audio signal under test is a voiced signal in the associated frame, the cost function is a function constructed according to the first pitch period, the second pitch period, and an error value between the audio signal under test and an offset signal in the first pitch period, and the offset audio signal is a signal after the audio signal under test is offset according to the first pitch period.
6. The method of claim 5, wherein the cost function is W (n, n ± 1) ═ kn-kn±1|+α*En(kn) Wherein n is the identifier of the current frame, n + -1 is the identifier of the associated frame, α is the smoothing coefficient, En(kn) For an error function corresponding to said first pitch period, knFor said first pitch period, kn±1Is the second pitch period.
7. A method according to any one of claims 1-3, wherein said determining a target pitch period of the audio signal under test in the current frame from each first pitch period according to each target cost value comprises:
and determining a first pitch period corresponding to the minimum cost value in each target cost value as the target pitch period.
8. An apparatus for pitch period determination, the apparatus comprising:
the acquisition module is used for acquiring the target cost value of each first pitch period of the audio signal to be detected in the current frame according to a preset cost function when the audio signal to be detected is a voiced signal in the current frame; wherein the target cost value comprises: a cost value between each first pitch period of the audio signal to be measured and each second pitch period in an associated frame, the associated frame including: a history frame adjacent to the current frame and a leading frame set positioned after the current frame; if the audio signal to be detected is an unvoiced signal in the associated frame, the cost function is a function constructed according to an error value between the audio signal to be detected and a shifted audio signal in the first pitch period, and the shifted audio signal is a signal of the audio signal to be detected after being shifted according to the first pitch period;
and the determining module is used for determining the target pitch period of the audio signal to be detected in the current frame from each first pitch period according to each target cost value.
9. A computer device comprising a memory and a processor, the memory storing a computer program, wherein the processor implements the steps of the method of any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810607513.7A CN108831509B (en) | 2018-06-13 | 2018-06-13 | Method and device for determining pitch period, computer equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810607513.7A CN108831509B (en) | 2018-06-13 | 2018-06-13 | Method and device for determining pitch period, computer equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108831509A CN108831509A (en) | 2018-11-16 |
CN108831509B true CN108831509B (en) | 2020-12-04 |
Family
ID=64144995
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810607513.7A Active CN108831509B (en) | 2018-06-13 | 2018-06-13 | Method and device for determining pitch period, computer equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108831509B (en) |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1412742A (en) * | 2002-12-19 | 2003-04-23 | 北京工业大学 | Speech signal base voice period detection method based on wave form correlation method |
CN1975861A (en) * | 2006-12-15 | 2007-06-06 | 清华大学 | Vocoder fundamental tone cycle parameter channel error code resisting method |
CN101030375A (en) * | 2007-04-13 | 2007-09-05 | 清华大学 | Method for extracting base-sound period based on dynamic plan |
KR20100022894A (en) * | 2008-08-20 | 2010-03-03 | 인하대학교 산학협력단 | A voiced/unvoiced decision method for the smv of 3gpp2 using gaussian mixture model |
CN101887723A (en) * | 2007-06-14 | 2010-11-17 | 华为终端有限公司 | Fine tuning method and device for pitch period |
CN103915099A (en) * | 2012-12-29 | 2014-07-09 | 北京百度网讯科技有限公司 | Speech pitch period detection method and device |
US9135923B1 (en) * | 2014-03-17 | 2015-09-15 | Chengjun Julian Chen | Pitch synchronous speech coding based on timbre vectors |
-
2018
- 2018-06-13 CN CN201810607513.7A patent/CN108831509B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1412742A (en) * | 2002-12-19 | 2003-04-23 | 北京工业大学 | Speech signal base voice period detection method based on wave form correlation method |
CN1975861A (en) * | 2006-12-15 | 2007-06-06 | 清华大学 | Vocoder fundamental tone cycle parameter channel error code resisting method |
CN101030375A (en) * | 2007-04-13 | 2007-09-05 | 清华大学 | Method for extracting base-sound period based on dynamic plan |
CN101887723A (en) * | 2007-06-14 | 2010-11-17 | 华为终端有限公司 | Fine tuning method and device for pitch period |
KR20100022894A (en) * | 2008-08-20 | 2010-03-03 | 인하대학교 산학협력단 | A voiced/unvoiced decision method for the smv of 3gpp2 using gaussian mixture model |
CN103915099A (en) * | 2012-12-29 | 2014-07-09 | 北京百度网讯科技有限公司 | Speech pitch period detection method and device |
US9135923B1 (en) * | 2014-03-17 | 2015-09-15 | Chengjun Julian Chen | Pitch synchronous speech coding based on timbre vectors |
Non-Patent Citations (1)
Title |
---|
基于动态规划的低延时基音提取算法;魏旋;《清华大学学报(自然科学版)》;20081015;第48卷(第10期);第1586-1588页 * |
Also Published As
Publication number | Publication date |
---|---|
CN108831509A (en) | 2018-11-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110008080B (en) | Business index anomaly detection method and device based on time sequence and electronic equipment | |
Robbins et al. | Mean shift testing in correlated data | |
CN111785288B (en) | Voice enhancement method, device, equipment and storage medium | |
CN108922544A (en) | General vector training method, voice clustering method, device, equipment and medium | |
JP6725186B2 (en) | Learning device, voice section detection device, and voice section detection method | |
CN106598822B (en) | A kind of abnormal deviation data examination method and device for Capacity Assessment | |
CN117373487B (en) | Audio-based equipment fault detection method and device and related equipment | |
CN108877783A (en) | The method and apparatus for determining the audio types of audio data | |
JP6930602B2 (en) | Abnormality judgment device, abnormality judgment method, and program | |
CN107331386A (en) | End-point detecting method, device, processing system and the computer equipment of audio signal | |
CN116611006B (en) | Fault identification method and device of electric kettle based on user feedback | |
CN110909826A (en) | Diagnosis monitoring method and device for energy equipment and electronic equipment | |
CN112712790A (en) | Voice extraction method, device, equipment and medium for target speaker | |
CN113555007B (en) | Voice splicing point detection method and storage medium | |
CN103646670A (en) | Method and device for evaluating performances of storage system | |
CN114582325A (en) | Audio detection method and device, computer equipment and storage medium | |
CN108831509B (en) | Method and device for determining pitch period, computer equipment and storage medium | |
CN110866682A (en) | Underground cable early warning method and device based on historical data | |
CN106910494B (en) | Audio identification method and device | |
CN110751400B (en) | Risk assessment method and device | |
CN108831504A (en) | Determination method, apparatus, computer equipment and the storage medium of pitch period | |
US20200237312A1 (en) | Method and apparatus for pre-processing ppg signal | |
CN110097893B (en) | Audio signal conversion method and device | |
CN114386980A (en) | Fraud identification method and device based on time sequence data driving | |
CN103390404A (en) | Information processing apparatus, information processing method and information processing program |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |