CN102543052A - Method and device for analyzing musical BPM - Google Patents
Method and device for analyzing musical BPM Download PDFInfo
- Publication number
- CN102543052A CN102543052A CN2011104153676A CN201110415367A CN102543052A CN 102543052 A CN102543052 A CN 102543052A CN 2011104153676 A CN2011104153676 A CN 2011104153676A CN 201110415367 A CN201110415367 A CN 201110415367A CN 102543052 A CN102543052 A CN 102543052A
- Authority
- CN
- China
- Prior art keywords
- bpm
- analyzed
- music piece
- music
- value
- 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.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 40
- 238000005311 autocorrelation function Methods 0.000 claims abstract description 61
- 238000001514 detection method Methods 0.000 claims description 11
- 239000012634 fragment Substances 0.000 claims description 7
- 238000004458 analytical method Methods 0.000 abstract description 6
- 230000003595 spectral effect Effects 0.000 description 5
- 238000001228 spectrum Methods 0.000 description 5
- 238000004364 calculation method Methods 0.000 description 4
- 238000005457 optimization Methods 0.000 description 3
- 230000008569 process Effects 0.000 description 3
- 238000005314 correlation function Methods 0.000 description 2
- 238000010586 diagram Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 238000009499 grossing Methods 0.000 description 2
- 239000002245 particle Substances 0.000 description 2
- 230000033764 rhythmic process Effects 0.000 description 2
- 238000005070 sampling Methods 0.000 description 2
- 238000007796 conventional method Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 230000001360 synchronised effect Effects 0.000 description 1
- 230000007704 transition Effects 0.000 description 1
Images
Landscapes
- Auxiliary Devices For Music (AREA)
Abstract
The invention provides a method and a device for analyzing musical BPM (Beat Per Minutes). The method comprises the following steps of: S1, executing peak search for an autocorrelation function of musical clips to be analyzed, and judging the musical beat series of the musical clips to be analyzed; S2, detecting halt points of the musical clips to be analyzed; S3, calculating the BPM according to the cycle value of the halt points and the judged result of the step 1, and taking the calculated BPM as the BPM of the musical clips to be analyzed. With the method and the device, the analysis accuracy for the BPM of the week accompaniment musical clips can be improved.
Description
[ technical field ] A method for producing a semiconductor device
The invention relates to a computer processing technology, in particular to a method and a device for analyzing the Beats Per Minute (BPM) of music.
[ background of the invention ]
BPM is one of the important attributes of music, identifies the number of beats per minute of music, and plays an important role in applications such as audio analysis, personalized music recommendation, music classification, and the like. For example, in Musical Instrument Digital Interface (MIDI) applications, the speed of a MIDI sequencer can be synchronized to an existing track by BPM; in a music database system, music can be classified and retrieved according to BPM. In a popular music announcer (DJ) application, BPM values of two music sources may be compared to seamlessly transition from one music source to another, and so on.
In the BPM analysis technology, some music pieces need to be selected from the music to be analyzed, and the BPM values of the music pieces are calculated and then fused to obtain the BPM value of the music to be analyzed. The existing method for calculating the BPM value of a music piece is as follows: calculating an autocorrelation function of the music piece, extracting a period value of the autocorrelation function as a time interval between two beats, and converting into the number of beats per minute as an output. However, the existing method for calculating the BPM value of a music clip is strong in music rhythm sense and very obvious in rhythm drumbeat, and can meet the accuracy requirement, but when the music accompaniment is weak and even has no accompaniment, the existing method is very difficult to find the accurate BPM value due to the fact that the periodicity is very unobvious.
[ summary of the invention ]
In view of the above, the present invention provides a method and apparatus for analyzing music BPM, so as to improve the accuracy of BPM analysis of weak accompaniment music clips.
The specific technical scheme is as follows:
a method of analyzing music Beats Per Minute (BPM), the method comprising:
s1, performing peak value search on the autocorrelation function of the music piece to be analyzed, and judging the music beat system to which the music piece to be analyzed belongs;
s2, detecting a stop point of the music segment to be analyzed;
s3, calculating the number of beats per minute as the BPM of the music piece to be analyzed according to the period value of the pause point and the decision result of the step S1.
According to a preferred embodiment of the present invention, the step S1 specifically includes:
s11, performing peak value search on the autocorrelation function of the music piece to be analyzed, and determining the frame number l contained in each beat;
and S12, respectively calculating the values of the autocorrelation function at the integer multiple frames of xl, judging whether the number of the frames with the local maximum value meets the preset requirement or not, wherein x is a preset positive integer, and if so, determining that the music piece to be analyzed belongs to an x shooting system.
According to a preferred embodiment of the present invention, before the step S11, the peak search is performed on the autocorrelation function of the music piece to be analyzed, the method further includes:
and superposing the window function on the autocorrelation function of the music segment to be analyzed.
According to a preferred embodiment of the present invention, the step S12 is: and respectively calculating the values of the autocorrelation function at integral multiple frames of 3l, judging whether the number of the frames with the local maximum value meets the preset requirement, if so, judging that the music piece to be analyzed belongs to a three-beat system, otherwise, judging that the music piece to be analyzed belongs to a two-beat system.
According to a preferred embodiment of the present invention, the step S2 specifically includes:
detecting the trough position of the energy amplitude curve of the music segment to be analyzed, and determining the trough position as a stop point; or,
and detecting the position of the signal energy amplitude of the music fragment lower than a preset amplitude low point, if the energy amplitude of the continuous multiframes is lower than the preset amplitude low point, taking the middle point of the continuous multiframes as a stop point, and otherwise, directly taking the detected position as the stop point.
According to a preferred embodiment of the present invention, the step S3 specifically includes:
determining the time length of each bar according to the period value of the stop points and the number of the bars between the stop points; determining the number of beats contained in each bar according to the judgment result of the step S1; calculating the number of beats per minute as the BPM of the music piece to be analyzed according to the number of beats contained in each bar and the time length of each bar; or,
determining the number of beats contained in each measure according to the judgment result of the step S1; determining the number of beats contained between the stop points according to the small number of the nodes between the stop points; and calculating the number of beats per minute as the BPM of the music piece to be analyzed by using the number of beats contained between the stop points and the period value of the stop points.
According to a preferred embodiment of the present invention, after the step S3, the method further includes:
judging whether the calculated BPM exceeds a preset reasonable value range, if so, continuing to execute the step S4;
s4, if the calculated BPM is lower than the lowest value of the reasonable value range, multiplying the calculated BPM value by 2 to be used as the optimized BPM of the music piece to be analyzed; and if the calculated BPM is higher than the highest value of the reasonable value range, dividing the value of the calculated BPM by 2 to be used as the optimized BPM of the music piece to be analyzed.
An apparatus for analyzing music Beats Per Minute (BPM), the apparatus comprising:
the system judgment unit is used for searching the peak value of the autocorrelation function of the music piece to be analyzed and judging the music system of the music piece to be analyzed;
a pause detection unit for detecting a pause point of the music piece to be analyzed;
and the BPM calculating unit is used for calculating the number of beats per minute as the BPM of the music piece to be analyzed according to the period value of the stop point and the judgment result of the beat system judging unit.
According to a preferred embodiment of the present invention, the beat decision unit specifically includes:
the peak value searching module is used for carrying out peak value searching on the autocorrelation function of the music piece to be analyzed and determining the frame number l contained in each beat;
the peak value judging module is used for respectively calculating the values of the autocorrelation function at the integer multiple frames of xl and judging whether the number of the frames which are the local maximum meets the preset requirement or not, wherein x is a preset positive integer;
and the system-taking determining module is used for determining that the music piece to be analyzed belongs to the system-taking x if the judgment result of the peak value judging module is positive.
According to a preferred embodiment of the present invention, the peak search module is further configured to superimpose a window function on the autocorrelation function of the music piece to be analyzed before performing peak search on the autocorrelation function of the music piece to be analyzed.
According to a preferred embodiment of the present invention, the peak value determining module specifically calculates a value of the autocorrelation function at an integer multiple frame of 3l, and determines whether the number of frames that is a local maximum value meets a preset requirement;
the beat system determining unit determines that the music piece to be analyzed belongs to a triple beat system if the judgment result of the peak value judging module is yes, or determines that the music piece to be analyzed belongs to a double beat system if the judgment result of the peak value judging module is not yes.
According to a preferred embodiment of the present invention, the pause detecting unit specifically detects a trough position of an energy amplitude curve of the music piece to be analyzed, and determines the trough position as a pause point; or,
and detecting the position of the signal energy amplitude of the music segment to be analyzed, which is lower than the preset amplitude low point, if the energy amplitude of the continuous multiframes is lower than the preset amplitude low point, taking the middle point of the continuous multiframes as a stop point, and otherwise, directly taking the detected position as the stop point.
According to a preferred embodiment of the present invention, the BPM calculating unit determines the time length of each bar based on the period value of the pause point and the number of bars between the pause points; determining the number of beats contained in each bar according to the judgment result of the beat system judgment unit; calculating the number of beats per minute as the BPM of the music piece to be analyzed according to the number of beats contained in each bar and the time length of each bar; or,
determining the beat number contained in each measure according to the judgment result of the beat judgment unit; determining the number of beats contained between the stop points according to the small number of the nodes between the stop points; and calculating the number of beats per minute as the BPM of the music piece to be analyzed by using the number of beats contained between the stop points and the period value of the stop points.
According to a preferred embodiment of the present invention, the apparatus further comprises:
the BPM optimizing unit is used for judging whether the BPM calculated by the BPM calculating unit exceeds a preset reasonable value range, if so, the BPM optimizing unit continues to execute the following steps: if the calculated BPM is lower than the lowest value of the reasonable value range, multiplying the calculated BPM value by 2 to be used as the optimized BPM of the music piece to be analyzed; and if the calculated BPM is higher than the highest value of the reasonable value range, dividing the value of the calculated BPM by 2 to be used as the optimized BPM of the music piece to be analyzed.
According to the technical scheme, the invention adopts a stop point detection mode to obtain the period value of the stop point, and then the BPM of the music fragment is determined according to the result of the shooting system judgment. The method for detecting the pause point acquisition period value has the obvious more accurate effect than the conventional method for acquiring the period value of the music fragment autocorrelation function no matter whether the accompaniment is strong accompaniment or weak accompaniment, and is easier to detect, so that the method has higher accuracy in the BPM analysis of the music fragment with the weak accompaniment compared with the prior art.
[ description of the drawings ]
FIG. 1 is a flowchart of a method for analyzing music BPM according to an embodiment of the present invention;
FIG. 2 is a flowchart of a method for determining a music tempo according to an embodiment of the present invention;
fig. 3 is a structural diagram of an apparatus for analyzing music BPM according to a second embodiment of the present invention.
[ detailed description ] embodiments
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be described in detail with reference to the accompanying drawings and specific embodiments.
The first embodiment,
Fig. 1 is a flowchart of a method for analyzing music BPM according to an embodiment of the present invention, as shown in fig. 1, the method may include the following steps:
step 101: and carrying out peak value search on the autocorrelation function of the music piece to be analyzed, and judging the music time series to which the music piece to be analyzed belongs.
Referring to fig. 2, a specific implementation method of this step may include the following steps 201 to 203:
step 201: and performing peak value search on the autocorrelation function of the music piece to be analyzed, and determining the frame number l contained in each beat.
In this step, the autocorrelation function of the music piece to be analyzed is first determined, and the autocorrelation function of the music signal is obtained in the prior art and will not be described in detail herein. After the autocorrelation function is determined, in order to determine the frame number l included in each beat, a peak search needs to be performed on the autocorrelation function, and the sampling frame number corresponding to the peak is the frame number l to be searched. For example, assuming that the range of the abscissa of the autocorrelation function of a music piece is 0 to 1000 frames, the peak value search is performed on the autocorrelation function, and it is determined that the autocorrelation function value is the largest when the abscissa takes 60, so that l is 60, that is, it is determined that the number of frames included in each beat is 60.
Due to the truncation of the music signal, spectral leakage, i.e. the presence of energy at frequency points where energy should not be present, inevitably occurs. The shorter the signal is truncated, the more the spectral leakage is, and in order to reduce the influence of the spectral leakage on the accuracy of peak search, a window function, such as a gaussian window function, may be further superimposed on the autocorrelation function of the musical piece, so as to suppress the leaked spectral components by using the side lobes of the window function, thereby playing a role in smoothing the spectrum.
When selecting the Gaussian window function, the mean value mu and the variance sigma of the Gaussian window function2Two parameter decisions, where the mean μ determines where the maximum of the Gaussian window function occurs and the variance σ2The main lobe width of the Gaussian window function is determined, and the BPM of most music is distributed in the range of 80-120 according to experience, so that the mean value mu of the Gaussian window function is selected to be 80-120. Variance σ2Is related to the width of the main lobe, when the variance σ is selected2The post BPM value falls within the interval [ mu-sigma, mu + sigma ]]The percentage of inner particles is more than 70%, falling in [ mu-2 sigma, mu +2 sigma ]]The percentage of (a) exceeds 95%, and therefore, the value range of sigma can be 40-60. The process of superimposing the window function is actually to multiply the autocorrelation function directly with the window function, and will not be described in detail herein.
Step 202: and respectively calculating the value of the autocorrelation function at xnl frames, and judging whether the number of frames which are local maximum values meets preset requirements, wherein n is 1, 2 and 3.
That is, the values of the autocorrelation function at xl integer-times frames are calculated, respectively, preferably, the beat of the popular music is a two-beat system or a three-beat system in general, and thus x may take 2 or 3.
Step 203: if the determination in step 202 is yes, it is determined that the piece of music belongs to the x-beat system.
Taking x as 2 and 3 as an example, first calculating values of the autocorrelation function at 2l, 4l, 6l.. frame, and determining whether the number of frames that are local maximum values in the frames meets a preset requirement, where the preset requirement may be that the number of frames exceeds a preset number threshold or that the ratio exceeds a preset ratio threshold, etc.; calculating the values of the autocorrelation function at 3l, 6l and 9l. If the number of frames which are the local maximum in the 2l, 4l and 6l. If the number of the frames which are the local maximum in the 3l, 6l and 9l. The local area is a preset area, the length of the area does not exceed x frames, and it is assumed that when x is 3, the area of the local area can be set to 2 frames, that is, when a certain frame is maximum in the range of the two frames, the autocorrelation function of the frame is considered to be a local maximum.
In addition, in practical application, because most of the beat systems of music belong to two beat systems or three beat systems, in order to reduce the amount of computation, only the value of the autocorrelation function at 3l of integer multiple frames can be calculated, and whether the number of frames in the frames which are the local maximum meets the preset requirement is judged, if yes, the music piece is judged to belong to three beat systems, otherwise, the music piece is judged to belong to two beat systems.
With continued reference to fig. 1.
Step 102: the detection of the stop point is performed for the piece of music to be analyzed.
In the step, the energy amplitude of the signal of the music fragment to be analyzed is detected, no matter the music is strong accompaniment or weak accompaniment, a short pause exists between each lyric, the energy amplitude at the pause point reaches a trough, the appearance positions of the pause points are periodical, and the length of the period is the duration of each lyric.
In this step, the method for detecting the stop point may include, but is not limited to, the following two methods:
firstly, detecting the trough position of an energy amplitude curve of a music segment to be analyzed, and determining the trough position as a stop point.
And secondly, detecting the position of the signal energy amplitude of the music fragment lower than a preset amplitude low point, if the continuous multiframes are lower than the preset amplitude low point, taking the middle point of the continuous multiframes as a stop point, and if not, directly taking the detected position as the stop point. The preset amplitude low point may be selected by empirical values.
After the stop points are detected, the period value of the stop points is extracted according to the time interval between the stop points. For example, the average value of the time intervals between the pause points can be used as the period value of the pause points.
Step 103: and calculating the number of beats per minute according to the period value of the stop point and the judgment result of the step 101.
The specific calculation method may include the following steps S1 to S3:
and S1, determining the time length of each bar according to the period value of the stop points and the number of the bars between the stop points.
Usually, the length of a lyric is between stop points, a lyric contains 4 bars, and the time length of each bar is obtained by dividing the period value of the stop points by the number of bars between the stop points.
S2, determining the number of beats contained in each bar according to the result of the determination in step 102, i.e. whether it is a three-beat system or a two-beat system.
Each bar contains 3 beats if it is determined that the piece of music belongs to the three-beat system, and 2 beats if it is determined that the piece of music belongs to the two-beat system.
It can be seen that although the embodiment of the present invention also utilizes the autocorrelation function of the music piece, the peak search is performed on the autocorrelation function to determine the music beat system to which the music piece belongs, i.e. to determine the number of beats included in each bar.
S3, the number of beats per minute, i.e. the BPM of the music piece to be analyzed, is calculated according to the number of beats contained in each bar and the time length of each bar.
It should be noted that the steps S1 to S3 are only one implementation method provided in the embodiment of the present invention, and other implementation manners may also be adopted, for example: and determining the number of beats contained in each bar according to the judgment result of the step 102, determining the number of beats contained in the pause points according to the number of bars between the pause points, and finally determining the number of beats per minute by combining the period value of the pause points.
Preferably, after step S3, the calculated BPM may be further optimized, that is, whether the BPM is beyond the preset reasonable value range is determined, and if so, the step S4 is continued.
S4, if the calculated BPM is lower than the lowest value of the reasonable range, multiplying the value of the BPM by 2 to be used as the optimized BPM; if the calculated BPM is higher than the highest value of the reasonable range, the value of the BPM is divided by 2 to be the optimized BPM. If the calculation result of step S3 is just within the preset reasonable value range, the optimization process is not necessary.
For example, assuming that the reasonable range is 40 to 120, if the BPM calculated in step S3 is 30, it is highly likely that there is one beat between two adjacent beats and detection is missed, and therefore, the value of the BPM should be multiplied by 2 to obtain 60 as the correct BPM. If the BPM calculated in step S3 is 180, it is highly likely that one more beat is detected between two adjacent beats, and therefore the value of the BPM should be divided by 2 to obtain 90 as the correct BPM. This optimization is done for the ambiguity that music has beats, and is named 2-fold optimization.
The above is a detailed description of the method provided by the present invention, and the following is a detailed description of the apparatus provided by the present invention with reference to the examples.
Example II,
Fig. 3 is a structural diagram of an apparatus for analyzing music BPM according to a second embodiment of the present invention, as shown in fig. 3, the apparatus specifically includes: a beat decision unit 300, a pause detection unit 310, and a BPM calculation unit 320.
The beat system determining unit 300 performs peak search on the autocorrelation function of the music piece to be analyzed, and determines the music beat system to which the music piece to be analyzed belongs. The prior art for obtaining the autocorrelation function of a music signal is not described in detail herein.
The beat decision unit 300 may specifically include: a peak search module 301, a peak determination module 302, and a beat rate determination module 303.
The peak search module 301 performs peak search on the autocorrelation function of the music piece to be analyzed, and determines the number of frames l contained in each beat. Specifically, after the autocorrelation function is determined, in order to determine the frame number l included in each beat, a peak search needs to be performed on the autocorrelation function, and the sampling frame number corresponding to the peak is the frame number l to be searched. For example, assuming that the range of the abscissa of the autocorrelation function of a music piece is 0 to 1000 frames, the peak value search is performed on the autocorrelation function, and it is determined that the autocorrelation function value is the largest when the abscissa takes 60, so that l is 60, that is, it is determined that the number of frames included in each beat is 60.
Due to the truncation of the music signal, spectral leakage, i.e. the presence of energy at frequency points where energy should not be present, inevitably occurs. The shorter the signal is truncated, the more the spectrum leakage is, and in order to reduce the influence of the spectrum leakage on the accuracy of peak search, a window function, such as a gaussian window function, may be further superimposed on the autocorrelation function of the music piece to be analyzed, so as to suppress the leaked spectrum component by using the side lobe of the window function, thereby playing a role in smoothing the spectrum.
When selecting the Gaussian window function, the mean value mu and the variance sigma of the Gaussian window function2Two parameter decisions, where the mean μ determines where the maximum of the Gaussian window function occurs and the variance σ2The main lobe width of the Gaussian window function is determined, and the BPM of most music is distributed in the range of 80-120 according to experience, so that the mean value mu of the Gaussian window function is selected to be 80-120. Variance σ2Is related to the width of the main lobe, when the variance σ is selected2The post BPM value falls within the interval [ mu-sigma, mu + sigma ]]The percentage of inner particles is more than 70%, falling in [ mu-2 sigma, mu +2 sigma ]]The percentage of (a) exceeds 95%, and therefore, the value range of sigma can be 40-60. The process of superimposing the window function is actually to multiply the autocorrelation function directly with the window function, and will not be described in detail herein.
The peak value determining module 302 respectively calculates values of the autocorrelation function at integer multiples of xl, and determines whether the number of frames that are local maximum values meets a preset requirement, where x is a preset positive integer.
Preferably, the beats of popular music are in a two-beat system or a three-beat system, so x may take 2 or 3.
If the judgment result of the peak value judgment module is yes, the beat system determination module 303 determines that the music piece to be analyzed belongs to the x beat system.
Taking x as 2 and 3 as an example, first calculating values of the autocorrelation function at 2l, 4l, 6l.. frame, and determining whether the number of frames that are local maximum values in the frames meets a preset requirement, where the preset requirement may be that the number of frames exceeds a preset number threshold or that the ratio exceeds a preset ratio threshold, etc.; calculating the values of the autocorrelation function at 3l, 6l and 9l. If the number of frames which are the local maximum in the 2l, 4l and 6l. If the number of the frames which are the local maximum in the 3l, 6l and 9l.
In addition, in practical applications, since most of the beat systems of music belong to two beat systems or three beat systems, in order to reduce the amount of computation, the peak value determining module 302 may only calculate the values of the autocorrelation function at 3l, 6l, and 9l.
The pause detection unit 310 performs detection of a pause point for the piece of music. Specifically, the following two detection methods may be adopted:
the method comprises the steps of firstly, detecting the trough position of an energy amplitude curve of a music segment to be analyzed, and determining the trough position as a stop point.
And secondly, detecting the position of the signal energy amplitude of the music segment to be analyzed, which is lower than the preset amplitude low point, if the energy amplitude of the continuous multiframes is lower than the preset amplitude low point, taking the middle point of the continuous multiframes as a stop point, and otherwise, directly taking the detected position as the stop point.
The BPM calculating unit 320 calculates the number of beats per minute as the BPM of the current music piece according to the period value of the pause point and the decision result of the beat decision unit 300.
Specifically, the BPM calculation unit 320 may adopt, but is not limited to, the following two ways:
determining the time length of each bar according to the period value of the stop points and the number of the bars between the stop points; determining the number of beats contained in each bar according to the judgment result of the beat system judgment unit 300; the number of beats per minute is calculated as the BPM of the music piece to be analyzed, based on the number of beats each bar contains and the time length of each bar.
Secondly, determining the beat number contained in each bar according to the judgment result of the beat judgment unit 300; determining the number of beats contained between the stop points according to the small number of the nodes between the stop points; and calculating the number of beats per minute as the BPM of the music piece to be analyzed by using the number of beats contained between the stop points and the period value of the stop points.
In addition, the apparatus may further include: the BPM optimizing unit 330 is configured to determine whether the BPM calculated by the BPM calculating unit 320 exceeds a preset reasonable value range, and if so, continue to perform: if the calculated BPM is lower than the lowest value of the reasonable value range, multiplying the calculated BPM value by 2 to be used as the optimized BPM of the music piece to be analyzed; and if the calculated BPM is higher than the highest value of the reasonable value range, dividing the value of the calculated BPM by 2 to be used as the optimized BPM of the music piece to be analyzed.
Although the peak search technique of the correlation function is used in the present invention, it is not used in the present invention to determine the period value of the correlation function to calculate the BPM, but is used to complete the beat decision, i.e., to determine the number of beats per bar. The key of the invention for calculating the BPM is to obtain the period value of the pause point by using pause detection and then determine the BPM of the music piece by combining the result of the shooting system judgment. This way, whether strong accompaniment or weak accompaniment can obtain accurate BPM analysis result.
The method and the device provided by the embodiment of the invention can calculate the BPM of each music piece selected from the music to be analyzed, and then can determine the BPM of the music to be analyzed after fusing the BPM of each music piece. The strategy in which music pieces are selected from music to be analyzed and the BPM of each music piece is fused is not limited by the present invention.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.
Claims (14)
1. A method of analyzing music Beats Per Minute (BPM), the method comprising:
s1, performing peak value search on the autocorrelation function of the music piece to be analyzed, and judging the music beat system to which the music piece to be analyzed belongs;
s2, detecting a stop point of the music segment to be analyzed;
s3, calculating the number of beats per minute as the BPM of the music piece to be analyzed according to the period value of the pause point and the decision result of the step S1.
2. The method according to claim 1, wherein the step S1 specifically includes:
s11, performing peak value search on the autocorrelation function of the music piece to be analyzed, and determining the frame number l contained in each beat;
and S12, respectively calculating the values of the autocorrelation function at the integer multiple frames of xl, judging whether the number of the frames with the local maximum value meets the preset requirement or not, wherein x is a preset positive integer, and if so, determining that the music piece to be analyzed belongs to an x shooting system.
3. The method according to claim 2, wherein before the step S11 of performing peak search on the autocorrelation function of the music piece to be analyzed, the method further comprises:
and superposing the window function on the autocorrelation function of the music segment to be analyzed.
4. The method according to claim 2, wherein the step S12 is: and respectively calculating the values of the autocorrelation function at integral multiple frames of 3l, judging whether the number of the frames with the local maximum value meets the preset requirement, if so, judging that the music piece to be analyzed belongs to a three-beat system, otherwise, judging that the music piece to be analyzed belongs to a two-beat system.
5. The method according to claim 1, wherein the step S2 specifically includes:
detecting the trough position of the energy amplitude curve of the music segment to be analyzed, and determining the trough position as a stop point; or,
and detecting the position of the signal energy amplitude of the music fragment lower than a preset amplitude low point, if the energy amplitude of the continuous multiframes is lower than the preset amplitude low point, taking the middle point of the continuous multiframes as a stop point, and otherwise, directly taking the detected position as the stop point.
6. The method according to claim 1, wherein the step S3 specifically includes:
determining the time length of each bar according to the period value of the stop points and the number of the bars between the stop points; determining the number of beats contained in each bar according to the judgment result of the step S1; calculating the number of beats per minute as the BPM of the music piece to be analyzed according to the number of beats contained in each bar and the time length of each bar; or,
determining the number of beats contained in each measure according to the judgment result of the step S1; determining the number of beats contained between the stop points according to the small number of the nodes between the stop points; and calculating the number of beats per minute as the BPM of the music piece to be analyzed by using the number of beats contained between the stop points and the period value of the stop points.
7. The method according to claim 1, further comprising, after the step S3:
judging whether the calculated BPM exceeds a preset reasonable value range, if so, continuing to execute the step S4;
s4, if the calculated BPM is lower than the lowest value of the reasonable value range, multiplying the calculated BPM value by 2 to be used as the optimized BPM of the music piece to be analyzed; and if the calculated BPM is higher than the highest value of the reasonable value range, dividing the value of the calculated BPM by 2 to be used as the optimized BPM of the music piece to be analyzed.
8. An apparatus for analyzing music Beats Per Minute (BPM), the apparatus comprising:
the system judgment unit is used for searching the peak value of the autocorrelation function of the music piece to be analyzed and judging the music system of the music piece to be analyzed;
a pause detection unit for detecting a pause point of the music piece to be analyzed;
and the BPM calculating unit is used for calculating the number of beats per minute as the BPM of the music piece to be analyzed according to the period value of the stop point and the judgment result of the beat system judging unit.
9. The apparatus according to claim 8, wherein the beat system determining unit specifically includes:
the peak value searching module is used for carrying out peak value searching on the autocorrelation function of the music piece to be analyzed and determining the frame number l contained in each beat;
the peak value judging module is used for respectively calculating the values of the autocorrelation function at the integer multiple frames of xl and judging whether the number of the frames which are the local maximum meets the preset requirement or not, wherein x is a preset positive integer;
and the system-taking determining module is used for determining that the music piece to be analyzed belongs to the system-taking x if the judgment result of the peak value judging module is positive.
10. The apparatus of claim 9, wherein the peak search module is further configured to superimpose a window function on the autocorrelation function of the music piece to be analyzed before performing the peak search on the autocorrelation function of the music piece to be analyzed.
11. The apparatus according to claim 9, wherein the peak determining module specifically calculates a value of the autocorrelation function at an integer multiple of 3l, and determines whether the number of frames that is a local maximum satisfies a preset requirement;
the beat system determining unit determines that the music piece to be analyzed belongs to a triple beat system if the judgment result of the peak value judging module is yes, or determines that the music piece to be analyzed belongs to a double beat system if the judgment result of the peak value judging module is not yes.
12. The apparatus according to claim 8, wherein the pause detection unit specifically detects a trough position of an energy amplitude curve of the music piece to be analyzed, and determines the trough position as a pause point; or,
and detecting the position of the signal energy amplitude of the music segment to be analyzed, which is lower than the preset amplitude low point, if the energy amplitude of the continuous multiframes is lower than the preset amplitude low point, taking the middle point of the continuous multiframes as a stop point, and otherwise, directly taking the detected position as the stop point.
13. The apparatus of claim 8, wherein the BPM calculating unit determines the time length of each bar based on the period value of the pause point and the number of bars between the pause points; determining the number of beats contained in each bar according to the judgment result of the beat system judgment unit; calculating the number of beats per minute as the BPM of the music piece to be analyzed according to the number of beats contained in each bar and the time length of each bar; or,
determining the beat number contained in each measure according to the judgment result of the beat judgment unit; determining the number of beats contained between the stop points according to the small number of the nodes between the stop points; and calculating the number of beats per minute as the BPM of the music piece to be analyzed by using the number of beats contained between the stop points and the period value of the stop points.
14. The apparatus of claim 8, further comprising:
the BPM optimizing unit is used for judging whether the BPM calculated by the BPM calculating unit exceeds a preset reasonable value range, if so, the BPM optimizing unit continues to execute the following steps: if the calculated BPM is lower than the lowest value of the reasonable value range, multiplying the calculated BPM value by 2 to be used as the optimized BPM of the music piece to be analyzed; and if the calculated BPM is higher than the highest value of the reasonable value range, dividing the value of the calculated BPM by 2 to be used as the optimized BPM of the music piece to be analyzed.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201110415367.6A CN102543052B (en) | 2011-12-13 | 2011-12-13 | A kind of method and apparatus analyzing music BPM |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201110415367.6A CN102543052B (en) | 2011-12-13 | 2011-12-13 | A kind of method and apparatus analyzing music BPM |
Publications (2)
Publication Number | Publication Date |
---|---|
CN102543052A true CN102543052A (en) | 2012-07-04 |
CN102543052B CN102543052B (en) | 2015-08-05 |
Family
ID=46349792
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201110415367.6A Active CN102543052B (en) | 2011-12-13 | 2011-12-13 | A kind of method and apparatus analyzing music BPM |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN102543052B (en) |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103839538A (en) * | 2012-11-22 | 2014-06-04 | 腾讯科技(深圳)有限公司 | Music rhythm detection method and music rhythm detection device |
CN106652981A (en) * | 2016-12-28 | 2017-05-10 | 广州酷狗计算机科技有限公司 | BPM detection method and device |
CN109922268A (en) * | 2019-04-03 | 2019-06-21 | 睿魔智能科技(深圳)有限公司 | Image pickup method, device, equipment and the storage medium of video |
CN111445923A (en) * | 2020-03-26 | 2020-07-24 | 腾讯音乐娱乐科技(深圳)有限公司 | Singing-turning recognition method and device and computer storage medium |
CN111630590A (en) * | 2018-02-14 | 2020-09-04 | 字节跳动有限公司 | Method for generating music data |
CN112908289A (en) * | 2021-03-10 | 2021-06-04 | 百果园技术(新加坡)有限公司 | Beat determining method, device, equipment and storage medium |
US11386876B2 (en) | 2017-12-28 | 2022-07-12 | Bigo Technology Pte. Ltd. | Method for extracting big beat information from music beat points, storage medium and terminal |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH0527751A (en) * | 1991-07-19 | 1993-02-05 | Brother Ind Ltd | Tempo extraction device used for automatic music transcription device or the like |
US6316712B1 (en) * | 1999-01-25 | 2001-11-13 | Creative Technology Ltd. | Method and apparatus for tempo and downbeat detection and alteration of rhythm in a musical segment |
JP2002116754A (en) * | 2000-07-31 | 2002-04-19 | Matsushita Electric Ind Co Ltd | Tempo extraction device, tempo extraction method, tempo extraction program and recording medium |
CN1764940A (en) * | 2003-03-31 | 2006-04-26 | 索尼株式会社 | Tempo analysis device and tempo analysis method |
CN101399035A (en) * | 2007-09-27 | 2009-04-01 | 三星电子株式会社 | Method and equipment for extracting beat from audio file |
-
2011
- 2011-12-13 CN CN201110415367.6A patent/CN102543052B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH0527751A (en) * | 1991-07-19 | 1993-02-05 | Brother Ind Ltd | Tempo extraction device used for automatic music transcription device or the like |
US6316712B1 (en) * | 1999-01-25 | 2001-11-13 | Creative Technology Ltd. | Method and apparatus for tempo and downbeat detection and alteration of rhythm in a musical segment |
JP2002116754A (en) * | 2000-07-31 | 2002-04-19 | Matsushita Electric Ind Co Ltd | Tempo extraction device, tempo extraction method, tempo extraction program and recording medium |
CN1764940A (en) * | 2003-03-31 | 2006-04-26 | 索尼株式会社 | Tempo analysis device and tempo analysis method |
CN101399035A (en) * | 2007-09-27 | 2009-04-01 | 三星电子株式会社 | Method and equipment for extracting beat from audio file |
Cited By (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103839538B (en) * | 2012-11-22 | 2016-01-20 | 腾讯科技(深圳)有限公司 | Music rhythm detection method and pick-up unit |
CN103839538A (en) * | 2012-11-22 | 2014-06-04 | 腾讯科技(深圳)有限公司 | Music rhythm detection method and music rhythm detection device |
CN106652981A (en) * | 2016-12-28 | 2017-05-10 | 广州酷狗计算机科技有限公司 | BPM detection method and device |
CN106652981B (en) * | 2016-12-28 | 2019-09-13 | 广州酷狗计算机科技有限公司 | BPM detection method and device |
US11386876B2 (en) | 2017-12-28 | 2022-07-12 | Bigo Technology Pte. Ltd. | Method for extracting big beat information from music beat points, storage medium and terminal |
CN111630590B (en) * | 2018-02-14 | 2024-05-14 | 字节跳动有限公司 | Method for generating music data |
CN111630590A (en) * | 2018-02-14 | 2020-09-04 | 字节跳动有限公司 | Method for generating music data |
US11887566B2 (en) | 2018-02-14 | 2024-01-30 | Bytedance Inc. | Method of generating music data |
CN109922268A (en) * | 2019-04-03 | 2019-06-21 | 睿魔智能科技(深圳)有限公司 | Image pickup method, device, equipment and the storage medium of video |
CN111445923B (en) * | 2020-03-26 | 2023-09-19 | 腾讯音乐娱乐科技(深圳)有限公司 | Method and device for identifying turnning and computer storage medium |
CN111445923A (en) * | 2020-03-26 | 2020-07-24 | 腾讯音乐娱乐科技(深圳)有限公司 | Singing-turning recognition method and device and computer storage medium |
CN112908289B (en) * | 2021-03-10 | 2023-11-07 | 百果园技术(新加坡)有限公司 | Beat determining method, device, equipment and storage medium |
CN112908289A (en) * | 2021-03-10 | 2021-06-04 | 百果园技术(新加坡)有限公司 | Beat determining method, device, equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN102543052B (en) | 2015-08-05 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102543052B (en) | A kind of method and apparatus analyzing music BPM | |
CN102568454B (en) | A kind of method and apparatus analyzing music BPM | |
Schreiber et al. | A Single-Step Approach to Musical Tempo Estimation Using a Convolutional Neural Network. | |
EP2845188B1 (en) | Evaluation of downbeats from a musical audio signal | |
EP2816550B1 (en) | Audio signal analysis | |
US9418643B2 (en) | Audio signal analysis | |
CN104978962B (en) | Singing search method and system | |
US8344234B2 (en) | Tempo detecting device and tempo detecting program | |
CN102903357A (en) | Method, device and system for extracting chorus of song | |
CN103578478B (en) | Obtain the method and system of musical tempo information in real time | |
RU2006129871A (en) | SELECTING AN ENCODING MODEL | |
JP3789326B2 (en) | Tempo extraction device, tempo extraction method, tempo extraction program, and recording medium | |
US8718803B2 (en) | Method for calculating measures of similarity between time signals | |
Stark et al. | Real-time beat-synchronous analysis of musical audio | |
CN105280196B (en) | Refrain detection method and system | |
CN111508457A (en) | Music beat detection method and system | |
CN101399035A (en) | Method and equipment for extracting beat from audio file | |
CN103794222A (en) | Method and apparatus for detecting voice fundamental tone frequency | |
US7276656B2 (en) | Method for music analysis | |
CN1971707B (en) | Method and apparatus for estimating fundamental tone period and adjudging unvoiced/voiced classification | |
JP5092876B2 (en) | Sound processing apparatus and program | |
JP5203404B2 (en) | Tempo value detection device and tempo value detection method | |
WO2007036846A2 (en) | Method and apparatus for automatic structure analysis of music | |
Gulati et al. | Rhythm pattern representations for tempo detection in music | |
Zapata et al. | Improving Beat Tracking in the presence of highly predominant vocals using source separation techniques: Preliminary study |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant |