Summary of the invention
The present invention provides the method and system of a kind of real-time acquisition musical tempo information, to realize music signal
Real-time tracking and prediction, for various beats operation real time implementation provide accurate information.
To this end, the present invention provides following technical scheme:
A kind of method of real-time acquisition musical tempo information, including:
Real-time tracking receives music signal, and described music signal is carried out discrete sampling, obtains sample sequence;
The historical path set of the beat starting point of the music signal section of estimating is determined according to described sample sequence;
Predict the beat cycle of newly received music signal;
Historical path set according to described beat starting point and the beat cycle of prediction, determine that follow-up music is believed
Number beat starting point.
Preferably, the history of the described beat starting point determining the music signal section of estimating according to described sample sequence
Set of paths includes:
After the music signal receiving the first duration, obtain current demand signal waveform bag according to described sample sequence
Each effective peak point in network;
Select there are multiple effective peak points of amplitude peak as start beat starting point;
After the music signal receiving the second duration, the follow-up beat point of each start beat starting point is carried out
Prediction, and obtain the historical path set of beat starting point.
Preferably, described according to each effective peak point in described sample sequence acquisition current demand signal waveform envelope
Including:
To described sample sequence rarefaction, obtain resampling sequence;
Filter the high-frequency signal in described resampling sequence, and utilization is filled the acquisition of slow play envelope detector soon and filtered
The envelope signal of the resampling sequence after high-frequency signal;
The each effective peak point in current demand signal waveform envelope is obtained according to described envelope signal.
Preferably, described described sample sequence rarefaction is included:
Selecting the sampled point with amplitude peak successively from the sampled point of predetermined number is new sampled point;Or
As new sampled point after successively the sample amplitude of predetermined number being weighted averagely.
Preferably, described according to each effective peak point in described envelope signal acquisition current demand signal waveform envelope
Including:
Described envelope signal is carried out first-order difference and halfwave rectifier, and strengthened signal;
It is weighted averagely, being compensated signal to described envelope signal and described reinforcement signal;
Each effective peak point is obtained according to described compensation signal.
Preferably, the described follow-up beat point to each start beat starting point is predicted including:
Successively to each start beat starting point, in the time range set behind, search has amplitude peak
Multiple effective peak points, and using the plurality of effective peak point as the new beat of described start beat starting point
Point;
Each new beat point is continued extension, obtains follow-up new beat point.
Preferably, the beat cycle of the newly received music signal of described prediction includes:
According to the effective peak point sequence set in duration, generate candidate peak point sequence;
The candidate peak point under each possible beat cycle is calculated respectively according to described candidate peak point sequence
The accumulation amplitude of sequence;
Determine chronon areal and time that in the described possible beat cycle, the optimum beat cycle occurs
Subregion;
The chronon areal occurred according to the accumulation amplitude obtained, optimum beat cycle and chronon district
Territory, determines the beat cycle of newly received music signal.
Preferably, the described historical path set according to described beat starting point and the beat cycle of prediction, really
The beat starting point determining subsequent sound music signal includes:
Calculating the comprehensive score of every beat starting point historical path, described comprehensive score includes: described beat
In starting point historical path and the accumulation range value of beat point, described beat starting point historical path on each adjacent
The meansigma methods of time difference and described beat week between the variance of the time difference between beat starting point and each beat
The difference of phase;
According to have on the beat starting point historical path of maximum comprehensive score last beat starting point and
The beat cycle of prediction determines the beat starting point in subsequent sound music signal.
Preferably, described method also includes:
The beat cycle of the current music signal determined is optimized;
The described historical path set according to described beat starting point and the beat cycle of prediction, determine subsequent sound
The beat starting point of music signal includes:
In the beat cycle after historical path set according to described beat starting point and optimization, determine follow-up music
The beat starting point of signal.
Preferably, the beat cycle of the described current music signal to determining is optimized and includes:
Calculating the comprehensive score of every beat starting point historical path, described comprehensive score includes: described beat
In starting point historical path and the accumulation range value of beat point, described beat starting point historical path on each adjacent
The meansigma methods of time difference and described beat week between the variance of the time difference between beat starting point and each beat
The difference of phase;
The preferred follow-up investigation path of comprehensive score according to each preferred beat starting point historical path;
Beat cycle according to described current music signal and average tempo cycle corresponding to described investigation path
Determine the beat cycle that described investigation path is corresponding.
A kind of system of real-time acquisition musical tempo information, including:
Sampling module, receives music signal for real-time tracking, and described music signal is carried out discrete sampling,
Obtain sample sequence;
Historical path determines module, for determining that the beat of the music signal section of estimating rises according to described sample sequence
The historical path set of initial point;
Beat period forecasting module, for predicting the beat cycle of newly received music signal;
Beat starting point determines module, for according to the historical path set of described beat starting point and prediction
In the beat cycle, determine the beat starting point of subsequent sound music signal.
Preferably, described historical path determines that module includes:
Effective peak point acquisition module, for receiving the music signal of the first duration at described sampling module
After, obtain each effective peak point in current demand signal waveform envelope according to described sample sequence;
Select module, for selecting multiple effective peak points with amplitude peak to initiate as start beat
Point;
Beat point prediction module is for after described sampling module receives the music signal of the second duration, right
The follow-up beat point of each start beat starting point is predicted, and obtains the historical path collection of beat starting point
Close.
Preferably, described effective peak point acquisition module includes:
Resampling unit, has in described sample sequence rarefaction, obtains resampling sequence;
Filter unit, for filtering the high-frequency signal in described resampling sequence;
Envelope signal acquiring unit, for utilize fill soon slow play envelope detector obtain filter high-frequency signal after
The envelope signal of resampling sequence;
Effective peak point acquiring unit, for obtaining in current demand signal waveform envelope according to described envelope signal
Each effective peak point.
Preferably, described resampling unit, specifically for selecting successively to have from the sampled point of predetermined number
The sampled point of amplitude peak is new sampled point;Or it is weighted putting down by the sample amplitude of predetermined number successively
As new sampled point after all.
Preferably, described effective peak point acquiring unit includes:
Signal processing unit, for described envelope signal is carried out first-order difference and halfwave rectifier, is strengthened
Signal;
Compensating unit, for being weighted averagely, being compensated to described envelope signal and described reinforcement signal
Signal, and obtain each effective peak point according to described compensation signal.
Preferably, described beat point prediction module, specifically for successively to each start beat starting point, at it
Search has multiple effective peak points of amplitude peak in the time range of rear setting, and by the plurality of effectively
Peak point is as the new beat point of described start beat starting point;Each new beat point is continued extension, after acquisition
Continuous new beat point.
Preferably, described beat period forecasting module includes:
Candidate peak point sequence generation module, for according to the effective peak point sequence set in duration, generates
Candidate peak point sequence;
Computing module, for calculating respectively under each possible beat cycle according to described candidate peak point sequence
The accumulation amplitude of candidate peak point sequence;
First determines module, for determining the time that in the described possible beat cycle, the optimum beat cycle occurs
Subregion number and time subregion;
Second determines module, for the chronon district occurred according to the accumulation amplitude obtained, optimum beat cycle
Territory number and time subregion, determine the beat cycle of newly received music signal.
Preferably, described beat starting point determines module, specifically for calculating every beat starting point history road
The comprehensive score in footpath, described comprehensive score includes: in described beat starting point historical path and beat point tired
The side of time difference between each adjacent beat starting point on long-pending range value, described beat starting point historical path
The difference in the meansigma methods of time difference and described beat cycle between difference and each beat, and according to having maximum combining
The beat cycle of last beat starting point and prediction on the beat starting point historical path of score of closing determines
Beat starting point in subsequent sound music signal.
Preferably, described system also includes:
Optimize module, for the beat cycle of the current music signal determined is optimized;
Described beat starting point determines module, specifically for the historical path set according to described beat starting point
In the beat cycle with after optimization, determine the beat starting point of subsequent sound music signal.
Preferably, described optimization module includes:
Comprehensive score calculation unit, for calculating the comprehensive score of every beat starting point historical path, described
Comprehensive score includes: with the accumulation range value of beat point, described beat in described beat starting point historical path
Time between the variance of time difference between each adjacent beat starting point and each beat on starting point historical path
The meansigma methods of difference and the difference in described beat cycle;
Investigate unit, for the preferred follow-up investigation of comprehensive score according to each preferred beat starting point historical path
Path;
The beat cycle determines unit, for the beat cycle according to described current music signal and described investigation road
Average tempo cycle corresponding to footpath determines the beat cycle that described investigation path is corresponding.
The method and system obtaining musical tempo information in real time that the embodiment of the present invention provides, pass through real-time tracking
Receive music signal, and described music signal is carried out discrete sampling, obtain sample sequence, then according to institute
State the historical path set that sample sequence determines the beat starting point of the music signal section of estimating, it was predicted that newly received sound
The beat cycle of music signal, according to historical path set and the beat cycle of prediction of described beat starting point,
Determine the beat starting point of subsequent sound music signal.Thus can immediately determine the next one while music
Beat starting point, it is achieved that the look-ahead to follow-up beat starting point, for the reality of various beats response operation
Time provide condition.
Detailed description of the invention
In order to make those skilled in the art be more fully understood that the scheme of the embodiment of the present invention, below in conjunction with the accompanying drawings
With embodiment, the embodiment of the present invention is described in further detail.
The method and system obtaining musical tempo information in real time that the embodiment of the present invention provides, pass through real-time tracking
Receive music signal, and described music signal is carried out discrete sampling, obtain sample sequence, then according to institute
State sample sequence and obtain useful signal peak point sequence, and after utilizing described useful signal peak point sequence to determine
Continuous beat starting point.Thus can immediately determine next beat starting point while music, it is achieved
Look-ahead to follow-up beat starting point, the real time implementation for the response operation of various beats provides condition.
As it is shown in figure 1, be the embodiment of the present invention flow chart that obtains the method for musical tempo information in real time, bag
Include following steps:
Step 101, real-time tracking receives music signal, and described music signal is carried out discrete sampling,
To sample sequence.
Music beat is the number of music beat per minute, music beat value bpm and music beat cycle Tbpm
There is a following relation:
Bpm=60/Tbpm (1)
It is f in sample ratesTime,
Bpm=60*fs/Tn (2)
Wherein, Tn=Tbpm*fs=60*fs/bpm;
Generally, the value of bpm between 45~180, music beat frequency between 0.75Hz~3Hz,
The music beat cycle, bpm was the feature of a long period interior display between 0.33s~1.33s.
In order to avoid the missing inspection of bpm, to ensure that bpm each bpm value in the range of 45~180 is
Distinguishable, need to use higher sample rate, such as, fsCan be with value as fs>537。
Step 102, determines the history road of the beat starting point of the music signal section of estimating according to described sample sequence
Footpath is gathered.
Specifically, (for convenience, the first duration is designated as T receiving the first duration0) music
After signal, obtain each effective peak point in current demand signal waveform envelope according to described sample sequence, and select
Wherein there are multiple effective peak points of amplitude peak as start beat starting point, then receiving second
After the music signal of duration, the follow-up beat point of each start beat starting point is predicted, thus obtains joint
Clapping the historical path set of starting point, detailed process will be described hereinafter.
Step 103, it was predicted that the beat cycle of newly received music signal.
Concrete prediction process will be described in detail later.
Step 104, according to historical path set and the beat cycle of prediction of described beat starting point, determines
The beat starting point of subsequent sound music signal.
Specifically, can first calculate the comprehensive score of every beat starting point historical path, described comprehensive
Divide and include: with the accumulation range value of beat point, described beat starting point in described beat starting point historical path
Time difference flat between the variance of time difference between each adjacent beat starting point and each beat on historical path
Average and the difference in described beat cycle;Then according to the beat starting point history road with maximum comprehensive score
On footpath, the beat cycle of last beat starting point and prediction determines that the beat in subsequent sound music signal initiates
Point.
In order to reduce operand, some preferred beats can be selected to go through from described beat starting point historical path
History path (the preferably selection of beat historical path, with the comprehensive score of the every paths of subsequent calculations, if
Dividing on the low side, this path will be deleted), calculate in every preferred beat starting point historical path each the most respectively
On the accumulation range value of beat starting point, preferred beat starting point historical path between each adjacent beat starting point
The variance of time difference and each beat between the meansigma methods of time differenceAnd the difference estimated between beat cycle T
Value.
Then, considering each parameter obtained above, be such as weighted average, weighting system can root
Application needs in border set factually, and meeting coefficient summation is 1, obtain combining of every preferred beat historical path
Close score.
Further, in order to improve computational efficiency and effectiveness, the mode of forgetting factor also can be used only to calculate
Combining of the new route that on historical path, up-to-date M (such as can select M=5 etc.) individual beat starting point is constituted
Close score.
Then the beat starting point in subsequent sound music signal can be calculated by below equation:
Wherein,For having the moment position of last beat point on the beat point historical path of maximum score
Put,For the beat cycle.
Visible, that the embodiment of the present invention the provides method obtaining musical tempo information in real time, passes through real-time tracking
Receive music signal, and described music signal is carried out discrete sampling, obtain sample sequence, then according to institute
State the historical path set that sample sequence determines the beat starting point of the music signal section of estimating, it was predicted that newly received sound
The beat cycle of music signal, according to historical path set and the beat cycle of prediction of described beat starting point,
Determine the beat starting point of subsequent sound music signal.Thus can immediately determine the next one while music
Beat starting point, it is achieved that the look-ahead to follow-up beat starting point, for the reality of various beats response operation
Time provide condition.
As in figure 2 it is shown, be the beat determining the music signal section of estimating in the embodiment of the present invention according to sample sequence
The flow chart of the historical path set of starting point, comprises the following steps:
Step 201, after the music signal receiving the first duration, obtains current according to described sample sequence
Each effective peak point in signal waveform envelope.
Due in preceding step 101 in order to ensure the resolvability of each bpm value, need use higher
Sample rate the music signal of input is sampled so that the sampled point quantity processed can be a lot, this
Not only can consume substantial amounts of calculation resources, and operation time can be increased, be unfavorable for detecting in real time.
To this end, in the embodiment of the present invention, during each effective peak point in obtaining current demand signal waveform envelope,
First described sample sequence can be carried out rarefaction, the most down-sampled, obtain resampling sequence.Then root then,
According to the resampling retrieval useful signal peak point sequence obtained.
When audiometry actual to music signal and time-frequency characteristic analysis are it can be seen that music beat occurs, its signal
Amplitude is bigger than signal amplitude At All Other Times, therefore, it can to determine from N number of sampled point one
Significantly it is sampled as new sampled point, say, that to the first duration received (for convenience,
First duration is designated as T0) music signal, the N number of sampled point of every continuous print is one group, often selects in group
One new sampled point, is formed described resampling sequence by these new sampled points, thus reaches down-sampled purpose.
Specifically, the maximum sampled point of amplitude of directly can choosing from N number of sampled point as new sampled point,
The sampled point obtained after can also the amplitude of described N number of sampled point being weighted averagely is as new sampled point.
It is of course also possible to sample, other down-sampled method obtains described resampling sequence, to this embodiment of the present invention not
Limit.
It should be noted that above-mentioned parameter N can equalize consider sampling according to system carrying out practically environment
Frequency and system treatment effeciency determine.Such as, in sample rate fsIn the case of 8kHz, can arrange
N=10.
Further, utilize low pass filter to filter the high-frequency signal in described resampling sequence, such as, adopt
With butterworth filter, Chebyshev filter etc., and utilize and fill slow play envelope detector soon and obtain and filter
The envelope signal of the resampling sequence after high-frequency signal, thus obtain current demand signal ripple according to described envelope signal
Each effective peak point in shape envelope.The charge constant filling slow play envelope detector soon is the least, even
The narrowest pulse also can quickly be charged to stationary value, when after intermediate frequency blackout, due to the discharge time of circuit
Constant is very big, and the output voltage of detection can be maintained on peak value within a very long time, such that it is able to preferably
Ground detects its peak point.
In actual applications, can directly select in described envelope signal after obtaining described envelope signal
Locally peak is as candidate peak point, these candidate peak points form useful signal peak point sequence.
Further, it is contemplated that signal is easily subject to noise jamming and causes local (such as one frame signal or certain
The signal of duration) there is multiple peak point, the effectiveness that peak point selects can be affected, to this end, can also adopt
Obtain useful signal peak point sequence with the following methods, the most described envelope signal is carried out first-order difference and half
Ripple rectification, strengthened signal;Then described envelope signal and described reinforcement signal are weighted averagely,
Realize the compensation to differential signal, be compensated signal;Last logical in the waveform envelope of described compensation signal
Crossing selection local peak and obtain each effective peak point, these effective peak points define useful signal peak point
Sequence.Wherein described envelope signal and described reinforcement signal being weighted average weight coefficient can be by being
System presets.
Step 202, selects multiple effective peak point conducts with amplitude peak from described effective peak point
Start beat starting point.
In actual applications, the K with amplitude peak can be selected from above-mentioned useful signal peak point sequence
Individual peak point is as start beat starting point.
It should be noted that above-mentioned parameter T0Can preset with the value of K.T0At the beginning of controlling to estimate
The data volume of beginning beat starting point, needs to include at least one beat, thus can arrange it is one more than 0.3s
Numerical value (the normal beat cycle is generally in 0.3s~1.3s), T is such as set0=0.5s.Parameter K is used for
Balance accuracy rate and the operation efficiency of the prediction of follow-up beat starting point, could be arranged to a less integer, than
As arranged K=3.
Step 203, after the music signal receiving the second duration, follow-up to each start beat starting point
Beat point is predicted, and obtains the historical path set of beat starting point.
It is to say, (for convenience, T can be designated as the second duration receiving the second duration1)
Music signal after, complete the pre-of the follow-up beat starting point to the beat starting point in the current demand signal estimated
Survey.When prediction, need successively to search in each start beat starting point, the time range set behind
There are multiple effective peak points of amplitude peak, and using the plurality of effective peak point as described start beat
The new beat point of starting point;Each new beat point is continued extension, obtains follow-up new beat point.
Such as, each candidate's beat in K the candidate's beat starting point determined in step 202 is initiateed
Point, certain time territory (T behindmin,TmaxUtilize should the useful signal peak point sequence of period in)
Row continue search for K the peak point with amplitude peak, as the follow-up joint of current candidate beat starting point
Clap the candidate collection of starting point.The rest may be inferred, to each new search to beat starting point may continue to
Candidate collection to its follow-up beat starting point.
Wherein, parameter T1、Tmin,TmaxPre-set by system respectively.Wherein T1For determining that start beat rises
The expansion depth of initial point historical path, Tmin,TmaxFor controlling the time range that next beat occurs.Such as,
T can be set1=2s, Tmin=0.3s, Tmax=1.3s.
By said process, for each beat starting point, an all corresponding historical path, i.e. beat rises
Initial point historical path.
As it is shown on figure 3, be the flow process in the beat cycle predicting newly received music signal in the embodiment of the present invention
Figure, comprises the following steps:
Step 301, obtains the effective peak point sequence set in duration.
Specifically, it is assumed that the beat cycle is estimated by system at moment t, then first system is opened from moment t
Begin forward backstepping set duration (for convenience, setting duration is designated as T2), utilize T2In period
The useful signal peak point sequence that sample sequence is corresponding determines beat cycle Ty.Wherein, parameter T2For controlling
Estimate the data volume in beat cycle, T can be such as set by systemic presupposition2=2s.
Step 302, obtains the candidate peak point in described effective peak point sequence, generates candidate peak point sequence
Row.
First, according to the useful signal peak point sequence in described setting duration, calculate each effective peak point width
The average amplitude of degreeWith amplitude peak Mmax, it is later determined that selection decision threshold M of candidate peak pointt,
Finally select all amplitudes more than described decision threshold MtEffective peak point as candidate peak point.
Calculating decision threshold MtTime, average weighted method can be used, by described average amplitude and
Significantly weighted mean is as described decision threshold Mt, i.e.Wherein, parameter
A, b can be preset by system, for controlling the size of decision threshold, and meet a+b=1.Such as,
A=0.5, b=0.5 can be set.
Step 303, calculates the time under each possible beat cycle respectively according to described candidate peak point sequence
Select the accumulation amplitude of peak point sequence.
Specifically, can calculate as follows:
Wherein, the implication of each parameter is as follows:
PeakNo is total number of the candidate peak point in described candidate peak point sequence;
For describing candidate peak point Pi?
Beat cycle TjUnder the accumulation amplitude of peak value historical path;
Parameter Ki=(2fs-Pi)/Tj,
TjIt is the beat cycle,
Tj∈{60*fs/bpmmax,60*fs/bpmmax+1,...,60*fs/bpmmax+j,...,60*fs/bpmmin};
fsIt it is sample rate;
bpmmin,bpmmaxIt is minima and the maximum of the bpm of common-practice music beat respectively, is set to 45 Hes
180。
Step 304, determines the chronon region that in the described possible beat cycle, the optimum beat cycle occurs
Number and time subregion.
Specifically, the number in chronon region is
The sampled point number comprised in each chronon region is
Chronon region is as follows:
Step 305, the chronon areal occurred according to the accumulation amplitude obtained, optimum beat cycle and
Chronon region, determines the beat cycle of current music signal.
First, the beat cycle selecting cumulative maximum amplitude corresponding in described chronon region is saved as candidate
The bat cycle.Then, it is determined that 2 times of chronon regions fallen in candidate's beat cycle of very first time subregion,
And determine that whether candidate's beat cycle in this chronon region is candidate's beat cycle of very first time subregion
Integral multiple;The candidate the most then selecting very first time subregion is the optimum beat cycle in the beat cycle, no
Then, the candidate's beat cycle selecting this chronon region is the optimum beat cycle.The optimum beat week that will determine
Phase is as the beat cycle of current music signal.
In order to make the beat cycle utilizing above-mentioned flow process to obtain more accurate, in embodiments of the present invention, also can enter
The described beat cycle is optimized by one step.Correspondingly, when determining the beat starting point of subsequent sound music signal,
Just can determine according to the beat cycle after the historical path set of described beat starting point and optimization.
As shown in Figure 4, it is the flow chart in the embodiment of the present invention, the beat cycle being optimized, including following
Step:
Step 401, calculates the comprehensive score of each preferred beat starting point historical path.
First, the accumulation amplitude of each beat starting point in every preferred beat starting point historical path is calculated respectively
Value, on preferred beat starting point historical path time difference between each adjacent beat starting point variance and
The meansigma methods of time difference between each beat(flow process shown in the most above-mentioned Fig. 3 obtains with estimating beat cycle T
The beat cycle) between difference.
Then, considering each parameter obtained above, be such as weighted average, weighting system can root
Application needs in border set factually, and meeting coefficient summation is 1, obtains comprehensive score.
Further, in order to improve computational efficiency and effectiveness, the mode of forgetting factor also can be used only to calculate
Combining of the new route that on historical path, up-to-date M (such as can select M=5 etc.) individual beat starting point is constituted
Close score.
Step 402, according to the preferred follow-up investigation path of comprehensive score of each preferred beat starting point historical path.
Specifically, the comprehensive score of each preferred beat starting point historical path that can obtain according to step 401
Described preferred beat starting point historical path is ranked up, selects the K bar wherein with top score to go through
History path is as follow-up investigation path.Wherein, parameter K can pre-set, and such as, selects K=3.
Step 403, calculates the beat cycle that in described follow-up investigation path, every investigation path is corresponding respectively.
Specifically, every can be calculated as follows and investigate the new beat cycle that path is corresponding, and will calculate
The new beat cycle obtained is as the beat cycle after the corresponding optimization in this investigation path.
Wherein,Being i-th investigates the average tempo cycle that path is corresponding, and T is the beat cycle estimated.
Parameter a, b are weight coefficient, meet a+b=1, specifically can determine according to actual should being used for, than
As a=b=0.5 can be selected.
Optimization based on the above-mentioned beat cycle to estimating, the beat starting point in determining subsequent sound music signal
Time, it is possible to determine that follow-up music is believed according to the beat cycle after optimizing and described beat starting point historical path
Beat starting point in number, specifically, the beat starting point in subsequent sound music signal can be come as follows
Determine:
Wherein,For having last beat point on the beat starting point historical path of maximum comprehensive score
Moment,For the beat cycle after the optimization that this historical path is corresponding.
Correspondingly, the embodiment of the present invention additionally provides the system of a kind of real-time acquisition musical tempo information, such as figure
Shown in 5, it it is a kind of structural representation of this system.
In this embodiment, described system includes:
Sampling module 501, receives music signal for real-time tracking, and carries out discrete to described music signal
Sampling, obtains sample sequence;
Historical path determines module 502, for determining the joint of the music signal section of estimating according to described sample sequence
Clap the historical path set of starting point;
Beat period forecasting module 503, for predicting the beat cycle of newly received music signal;
Beat starting point determines module 504, for the historical path set according to described beat starting point with pre-
In the beat cycle surveyed, determine the beat starting point of subsequent sound music signal.Specifically can calculate every beat to initiate
Point historical path comprehensive score, described comprehensive score includes: in described beat starting point historical path and joint
Clap the time between each adjacent beat starting point on the accumulation range value of point, described beat starting point historical path
The difference in meansigma methods and the described beat cycle of time difference between the variance of difference and each beat, and according to having
Last beat starting point and the beat week of prediction on the beat starting point historical path of maximum comprehensive score
Phase determines the beat starting point in subsequent sound music signal.
Visible, that the embodiment of the present invention the provides system obtaining musical tempo information in real time, passes through real-time tracking
Receive music signal, and described music signal is carried out discrete sampling, obtain sample sequence, then according to institute
State the historical path set that sample sequence determines the beat starting point of the music signal section of estimating, it was predicted that newly received sound
The beat cycle of music signal, according to historical path set and the beat cycle of prediction of described beat starting point,
Determine the beat starting point of subsequent sound music signal.Thus can immediately determine the next one while music
Beat starting point, it is achieved that the look-ahead to follow-up beat starting point, for the reality of various beats response operation
Time provide condition.
As shown in Figure 6, it is that in the embodiment of the present invention, historical path determines that the one of module implements structure.
This historical path determines that module includes:
Effective peak point acquisition module 601, for receiving the sound of the first duration at above-mentioned sampling module 501
After music signal, obtain each effective peak point in current demand signal waveform envelope according to described sample sequence;
Select module 602, for selecting multiple effective peak points with amplitude peak to rise as start beat
Initial point;
Beat point prediction module 603, is used for after sampling module 501 receives the music signal of the second duration,
The follow-up beat point of each start beat starting point is predicted, and obtains the historical path collection of beat starting point
Close.When prediction, need successively to search in each start beat starting point, the time range set behind
There are multiple effective peak points of amplitude peak, and using the plurality of effective peak point as described start beat
The new beat point of starting point;Each new beat point is continued extension, obtains follow-up new beat point.
Above-mentioned effective peak point acquisition module 601 specifically can include following unit:
Resampling unit, for described sample sequence rarefaction, obtains resampling sequence.Specifically can depend on
It is secondary that to select have the sampled point of amplitude peak from the sampled point of predetermined number be new sampled point;Or successively will
The sample amplitude of predetermined number be weighted average after as new sampled point.
Filter unit, for filtering the high-frequency signal in described resampling sequence.
Envelope signal acquiring unit, for utilize fill soon slow play envelope detector obtain filter high-frequency signal after
The envelope signal of resampling sequence.
Effective peak point acquiring unit, for obtaining in current demand signal waveform envelope according to described envelope signal
Each effective peak point.
It should be noted that in actual applications, above-mentioned effective peak point acquiring unit can directly select institute
State the local peak in envelope signal as candidate peak point, these candidate peak points form useful signal
Peak point sequence.
Further, it is contemplated that signal is easily subject to noise jamming and causes local (such as one frame signal or certain
The signal of duration) there is multiple peak point, can affect peak point select effectiveness, to this end, above-mentioned effectively
The one of peak point acquiring unit implements structure can also include following unit:
Signal processing unit, for described envelope signal is carried out first-order difference and halfwave rectifier, is strengthened
Signal;
Compensating unit, for being weighted averagely, being compensated to described envelope signal and described reinforcement signal
Signal, and obtain each effective peak point according to described compensation signal.
As it is shown in fig. 7, be that in the embodiment of the present invention, the one of beat period forecasting module implements structure.
Candidate peak point sequence generation module 701, is used for according to the effective peak point sequence set in duration,
Generate candidate peak point sequence.Specifically, can be according to the useful signal peak point sequence in described setting duration
Row, calculate the average amplitude of each effective peak point amplitudeWith amplitude peak Mmax, it is later determined that candidate peak
Selection decision threshold M of value pointt, finally select all amplitudes more than described decision threshold MtEffective peak
Point is as candidate peak point.
Computing module 702, for calculating each possible beat week respectively according to described candidate peak point sequence
The accumulation amplitude of the candidate peak point sequence under the phase, concrete calculating process can refer to above the inventive method and implements
Description in example, does not repeats them here.
First determines module 703, for determining optimum beat cycle appearance in the described possible beat cycle
Chronon areal and time subregion, before the determination of chronon areal and time subregion can refer to
Description in the inventive method embodiment of face, does not repeats them here.
Second determines module 704, for the time occurred according to the accumulation amplitude obtained, optimum beat cycle
Subregion number and time subregion, determine the beat cycle of newly received music signal.Specifically, can be first
The beat cycle that first selection cumulative maximum amplitude is corresponding in described chronon region is as candidate's beat cycle.
Then, it is determined that 2 times of chronon regions fallen in candidate's beat cycle of very first time subregion, and determine
Whether candidate's beat cycle in this chronon region is the integer in candidate's beat cycle of very first time subregion
Times;The candidate the most then selecting very first time subregion is optimum beat cycle, otherwise, choosing in the beat cycle
The candidate's beat cycle selecting this chronon region is the optimum beat cycle.Using optimum beat cycle of determining as
The beat cycle of current music signal.
As shown in Figure 8, it is the present invention another kind of structural representation that obtains the system of musical tempo information in real time
Figure.
Difference with embodiment illustrated in fig. 5 is, in this embodiment, described system may further comprise:
Optimize module 801, for the beat cycle of the current music signal determined is optimized.
Correspondingly, in this embodiment, beat starting point determines that module 504 is according to described beat starting point
In the beat cycle after historical path set and optimization, determine the beat starting point of subsequent sound music signal.
The one of above-mentioned optimization module 801 implements structure and may include that
Comprehensive score calculation unit, for calculating the comprehensive score of every beat starting point historical path, described
Comprehensive score includes: with the accumulation range value of beat point, described beat in described beat starting point historical path
Time between the variance of time difference between each adjacent beat starting point and each beat on starting point historical path
The meansigma methods of difference and the difference in described beat cycle;
Investigate unit, for the preferred follow-up investigation of comprehensive score according to each preferred beat starting point historical path
Path;
The beat cycle determines unit, for the beat cycle according to described current music signal and described investigation road
Average tempo cycle corresponding to footpath determines the beat cycle that described investigation path is corresponding.
Each embodiment in this specification all uses the mode gone forward one by one to describe, phase homophase between each embodiment
As part see mutually, what each embodiment stressed is different from other embodiments it
Place.For system embodiment, owing to it is substantially similar to embodiment of the method, so describing
Fairly simple, relevant part sees the part of embodiment of the method and illustrates.System described above is implemented
Example is only that schematically the wherein said unit illustrated as separating component can be or may not be
Physically separate, the parts shown as unit can be or may not be physical location, the most permissible
It is positioned at a place, or can also be distributed on multiple NE.Can select according to the actual needs
Some or all of module therein realizes the purpose of the present embodiment scheme.Those of ordinary skill in the art exist
In the case of not paying creative work, i.e. it is appreciated that and implements.
Being described in detail the embodiment of the present invention above, detailed description of the invention used herein is to this
Bright being set forth, the explanation of above example is only intended to help to understand the method and apparatus of the present invention;With
Time, for one of ordinary skill in the art, according to the thought of the present invention, in detailed description of the invention and application
All will change in scope, in sum, this specification content should not be construed as limitation of the present invention.