[go: up one dir, main page]

CN100478810C - Beat number detector - Google Patents

Beat number detector Download PDF

Info

Publication number
CN100478810C
CN100478810C CNB02142473XA CN02142473A CN100478810C CN 100478810 C CN100478810 C CN 100478810C CN B02142473X A CNB02142473X A CN B02142473XA CN 02142473 A CN02142473 A CN 02142473A CN 100478810 C CN100478810 C CN 100478810C
Authority
CN
China
Prior art keywords
bpm
value
detection device
values
output
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.)
Expired - Fee Related
Application number
CNB02142473XA
Other languages
Chinese (zh)
Other versions
CN1484116A (en
Inventor
乔戈·W·威斯弗洛格
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
MUSIC GROUP INTELLECTUAL PROPERTY CO., LTD.
Original Assignee
RED CORE CO Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by RED CORE CO Ltd filed Critical RED CORE CO Ltd
Priority to CNB02142473XA priority Critical patent/CN100478810C/en
Publication of CN1484116A publication Critical patent/CN1484116A/en
Application granted granted Critical
Publication of CN100478810C publication Critical patent/CN100478810C/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Measurement Of Mechanical Vibrations Or Ultrasonic Waves (AREA)

Abstract

The invention is a beat number detecting device, including: selecting device, to select special frequency form input audio signal; transient detecting device, to detect the transient from the output of the selecting device; timer, to determine integrator window length; period detecting device, to detect time interval and determine BPM mean; and display logic device, to determine the most credible BPM mean.

Description

节拍数检测装置 Beat count detection device

技术领域 technical field

本发明涉及一种检测乐曲中单位时间内的节拍数的装置。The invention relates to a device for detecting the number of beats per unit time in music.

背景技术 Background technique

每分钟节拍(BPM)检测器有各种各样的应用。BPM检测器是一种可以检测出一支乐曲中每分钟的节拍数的装置。Beats per minute (BPM) detectors have a variety of applications. A BPM detector is a device that detects the number of beats per minute in a piece of music.

在DJ(流行音乐播音员)的应用中,需要检测两种不同的音乐源的BPM值以将其进行比较,以便从一个音乐源无缝地过渡到另一个音乐源。在MIDI的应用中,BPM检测器可用于将MIDI音序器的速度与一个已有的音轨同步。在音乐数据库系统中,可根据BPM速度值对舞曲进行分类和检索。In the application of DJ (popular music announcer), it is necessary to detect the BPM values of two different music sources to compare them, so as to seamlessly transition from one music source to another. In MIDI applications, the BPM detector can be used to synchronize the tempo of a MIDI sequencer to an existing track. In the music database system, dance music can be classified and retrieved according to the BPM speed value.

检测一首乐曲的节拍数的常用方法是,首先从音频信号中选取一个节拍位置。在这样的系统中,使用者通过人工的操作在一个节拍的位置上输入数据。这就要求使用者边听音频信号,边完成敲击的动作,并且从音频信号开始至结束不能出现错误,因此要求使用者聚精会神,并能坚持到底。使用者被迫进行长时间的操作,其操作的时间由乐曲的长短决定。该系统总是要受到使用者操作的影响。A common way to detect the number of beats in a piece of music is to first pick a beat position from the audio signal. In such a system, the user manually inputs data at the position of a beat. This just requires the user to listen to the audio signal while completing the knocking action, and no mistakes can occur from the beginning to the end of the audio signal, so the user is required to concentrate and stick to the end. The user is forced to operate for a long time, and the operation time is determined by the length of the music. The system is always subject to user actions.

最近,在检测乐曲节拍数的装置和处理方法方面进行了大量的研究和开发。Recently, a great deal of research and development has been conducted on devices and processing methods for detecting the number of beats of a musical piece.

例如,美国第5614687号专利公开了一种检测节拍数的装置,在此作为参考。为了检测乐曲中的节拍数,这种已有的装置使用了可变的阈值。该可变阈值是在假定某一段时间间隔中无瞬变事件发生的情况下得到的。在此时间中,音频信号的最大值被检测出来,然后,将其与一个常数因子相乘,乘积的结果将作为阈值,在后面的时间间隔中,如果信号超过这一阈值就会被检测出来,这就表明产生了一个突发事件。两个相邻的突发事件之间的时间间隔就被测量出来。这一步骤在输入信号的三个不同频带中进行。For example, US Patent No. 5,614,687 discloses a device for detecting the number of beats, which is hereby incorporated by reference. In order to detect the number of beats in a musical piece, such known devices use a variable threshold. This variable threshold is obtained under the assumption that no transient events occur for a certain time interval. During this time, the maximum value of the audio signal is detected, and then it is multiplied by a constant factor, and the result of the product will be used as a threshold. In the following time interval, if the signal exceeds this threshold, it will be detected. , which indicates that an emergency has occurred. The time interval between two adjacent bursts is measured. This step is performed in three different frequency bands of the input signal.

这种已有的检测节拍数的装置存在的缺点就是:至少需要5至6拍来检测BPM值。The disadvantage of this existing device for detecting the number of beats is that at least 5 to 6 beats are needed to detect the BPM value.

发明内容 Contents of the invention

因此本发明的一个目的就是要提供一个只需3拍的检测时间即可高精度地检测乐曲节拍数的装置。It is therefore an object of the present invention to provide a device which can detect the number of beats of a musical piece with high precision in a detection time of only 3 beats.

目前的BPM检测器的实时操作通常是以自相关和可变阈值原理为基础的。The real-time operation of current BPM detectors is usually based on autocorrelation and variable threshold principles.

根据本发明的节拍检测装置,其特征包括:带通滤波器,用于从输入音频信号中选取特定频率;瞬变值检测装置,用于从带通滤波器的输出中检测瞬变值;定时器,用于确定积分器窗口(window)长度;周期检测装置,用于检查被测时间间隔和确定BPM平均值;以及显示逻辑装置,用于从上述周期检测装置中确定最可信的被测BPM值。According to the beat detection device of the present invention, it is characterized in that it comprises: a band-pass filter for selecting a specific frequency from an input audio signal; a transient value detection device for detecting a transient value from the output of the band-pass filter; a device for determining the length of the integrator window; period detection means for examining the measured time interval and determining the BPM average; and display logic means for determining the most plausible measured value from the above period detection means BPM value.

按照本发明,BPM检测器的检测精确度可高达±0.1BPM。According to the present invention, the detection accuracy of the BPM detector can be as high as ±0.1 BPM.

附图说明 Description of drawings

通过下面的详细说明及其所附各图,本发明的目的和特点将更加清楚。Objects and features of the present invention will become more clear through the following detailed description and accompanying drawings.

图1示出根据本发明的节拍检测装置;Fig. 1 shows a beat detection device according to the present invention;

图2为瞬变值检测器的结构框图;Fig. 2 is the structural block diagram of transient value detector;

图3示出按照本发明的窗口积分器;Figure 3 shows a window integrator according to the invention;

图4示出在延迟长度和恒定时间间隔之间的时间关系;Figure 4 shows the time relationship between delay length and constant time interval;

图5示出根据本发明的阈值电路;Figure 5 shows a threshold circuit according to the invention;

图6示出用于检测被测能量值的最大值的过程;Figure 6 shows a process for detecting the maximum value of the measured energy value;

图7示出对几个延迟器中被测能量值进行线性衰减的流程图;Fig. 7 shows the flow chart that the measured energy value in several retarders is linearly attenuated;

图8示出周期检测器的运行流程图;和Figure 8 shows a flow diagram of the operation of the cycle detector; and

图9示出显示逻辑单元的运行流程图。FIG. 9 shows a flow chart showing the operation of the logic unit.

具体实施方式 Detailed ways

以下将根据附图对本发明的一个具体实施例进行详细的说明。A specific embodiment of the present invention will be described in detail below according to the accompanying drawings.

图1示出根据本发明的节拍检测装置。FIG. 1 shows a tempo detection device according to the present invention.

在该BPM检测装置中,模拟音频信号首先被输入到A/D转换器1中。这样,通过A/D转换器1,输入的模拟音频信号就被转化为数字音频信号。被转化的数字音频信号作为每个BPM检测器101,102,...,10n的输入。In this BPM detection device, an analog audio signal is first input into the A/D converter 1 . Thus, through the A/D converter 1, the input analog audio signal is converted into a digital audio signal. The converted digital audio signal serves as input to each BPM detector 101, 102, . . . , 10n.

图1示出BPM检测器101的所有元件。因为所有的BPM检测器101,102,...,10n之间的差别仅在于其各自的带通滤波器的参数不同,因此仅详细示出BPM检测器101。FIG. 1 shows all elements of the BPM detector 101 . Since all BPM detectors 101 , 102 , . . . , 10n differ only in the parameters of their respective bandpass filters, only BPM detector 101 is shown in detail.

从图1中可以看出,BPM检测器101包含一个带通滤波器2,一个瞬变值检测器3,一个计时器4和一个周期检测器5。带通滤波器2与A/D转换器1相连,接收输入的数字音频信号。带通滤波器2被设计为一个带宽非常小的滤波器(高Q)。带通滤波器2的中心频率是一个特定的频率,如80Hz。对于不同的BPM检测器101,102,...,10n,每一个BP滤波器仅被设定到一个中心频率。不同的BPM检测器中的每一个BP滤波器被设定到的不同中心频率最好是在可听得见的声音的频谱中的非常高的频率和低的频率的范围之内,典型地用于监测节奏乐器,如踩钹和低音鼓。It can be seen from FIG. 1 that the BPM detector 101 includes a bandpass filter 2 , a transient value detector 3 , a timer 4 and a period detector 5 . The band-pass filter 2 is connected with the A/D converter 1 to receive the input digital audio signal. Bandpass filter 2 is designed as a very narrow bandwidth filter (high Q). The center frequency of the bandpass filter 2 is a specific frequency, such as 80Hz. For different BPM detectors 101, 102, . . . , 10n, each BP filter is set to only one center frequency. The different center frequencies to which each BP filter in the different BPM detectors are set are preferably in the range of very high and low frequencies in the spectrum of audible sounds, typically with Useful for monitoring rhythm instruments such as hi-hats and bass drums.

带通滤波器2的输出端与瞬变值检测器3相连。从带通滤波器2中得到的经滤波的数字信号被输入到瞬变值检测器3并被瞬变值检测器3分析。The output of the bandpass filter 2 is connected to a transient value detector 3 . The filtered digital signal obtained from the bandpass filter 2 is input to and analyzed by the transient detector 3 .

图2为瞬变值检测器的结构框图。Figure 2 is a block diagram of the transient value detector.

从图2可以看出,瞬变值检测器3包含窗口积分器201,阈值电路202,开关203,计时器205和本地最大值检测器204。窗口积分器201接收从带通滤波器2得到的经滤波的数字信号。下面将参照图3对该数字信号的详细处理过程进行说明。It can be seen from FIG. 2 that the transient value detector 3 includes a window integrator 201 , a threshold circuit 202 , a switch 203 , a timer 205 and a local maximum value detector 204 . Window integrator 201 receives the filtered digital signal from bandpass filter 2 . The detailed processing of the digital signal will be described below with reference to FIG. 3 .

图3示出按照本发明的窗口积分器。Figure 3 shows a windowed integrator according to the invention.

积分器201包含一个乘法器301,其用于接收从带通滤波器2输出的输入数字信号。从图3中可以看出,从带通滤波器2中输出的数字信号首先在乘法器301中进行自乘。乘法器301的输出端与延迟器302和加法器304相连。乘法器301的输出首先送给延迟器302并被延迟一个tw长度。tw长度就是窗口积分器的长度。延迟器302的输出端与乘法器303相连。The integrator 201 includes a multiplier 301 for receiving the input digital signal output from the bandpass filter 2 . It can be seen from FIG. 3 that the digital signal output from the band-pass filter 2 is first multiplied by itself in the multiplier 301 . The output terminal of the multiplier 301 is connected with a delay 302 and an adder 304 . The output of the multiplier 301 is first sent to the delayer 302 and delayed by a length of tw. The tw length is the length of the window integrator. The output terminal of the delayer 302 is connected with the multiplier 303 .

这样,延迟器302输出的被延迟了的数字信号被乘以“-1”,乘法器303的输出端与加法器304相连。从图3可以看出,乘法器303的输出信号与延迟器302的输入信号通过加法器304相加,加法器304中相加的结果随后送到延迟元件305的输入端。In this way, the delayed digital signal output by the delayer 302 is multiplied by “-1”, and the output terminal of the multiplier 303 is connected to the adder 304 . It can be seen from FIG. 3 that the output signal of the multiplier 303 and the input signal of the delayer 302 are added through the adder 304 , and the result of the addition in the adder 304 is then sent to the input end of the delay element 305 .

延迟元件305的输出端分别与加法器304的输入端、常数乘法器306和阈值电路202相连。这样,延迟器302的输出在被乘以“-1”后与延迟器302的输入和延迟元件305的输出相加,得到一个宽度为tw的,用于测量一个频段中的平均能量值的矩形积分窗口。The output terminals of the delay element 305 are respectively connected with the input terminals of the adder 304 , the constant multiplier 306 and the threshold circuit 202 . In this way, the output of the delayer 302 is added to the input of the delayer 302 and the output of the delay element 305 after being multiplied by "-1", to obtain a rectangle with a width of tw for measuring the average energy value in a frequency band Integral window.

然后,延迟元件305的输出与常数因子“C”相乘,也就是说,被测量的能量值可以由常数因子“C”来调整。常数乘法器306的输出端与开关203相连。这样,常数乘法器306的输出被传送到开关203。在本实施例中,开关203是一个门电路。但本发明并不限于此。Then, the output of the delay element 305 is multiplied by a constant factor "C", that is, the measured energy value can be adjusted by the constant factor "C". The output terminal of the constant multiplier 306 is connected to the switch 203 . Thus, the output of the constant multiplier 306 is transferred to the switch 203 . In this embodiment, the switch 203 is a gate circuit. But the present invention is not limited thereto.

定时器4控制开关203,使之在一个ts的时间间隔中闭合一次。由常数因子“C”来调整的被测能量值在ts的恒定时间段中输出。当门电路闭合时,被测能量值被传送到本地最大值检测器204。Timer 4 controls the switch 203 to close once in a time interval of ts. The measured energy value adjusted by the constant factor "C" is output in a constant time period of ts. When the gate is closed, the measured energy value is passed to the local maximum detector 204 .

定时器4还与计时器205相连。每隔ts定时器4不断地增加计时器205的值,该值将在本地最大值检测器204中被使用。Timer 4 is also connected to timer 205 . Every ts Timer4 keeps incrementing the value of Timer 205 which will be used in Local Maximum Detector 204 .

图4示出在延迟长度和恒定时间间隔之间的时间关系。FIG. 4 shows the time relationship between the delay length and the constant time interval.

从乘法器301中输出的数字信号由延迟器302延迟了时间长度tw。定时器4产生恒定时间段ts。为了使积分窗之间产生如图4所示的交迭,需要将恒定时间段ts选择得比延迟长度tw短。例如,在本实施例中,恒定时间ts=0.5*延迟时间长度tw。The digital signal output from the multiplier 301 is delayed by the time length tw by the delayer 302 . Timer 4 generates a constant time period ts. In order to make the integration windows overlap as shown in FIG. 4 , it is necessary to select the constant time period ts to be shorter than the delay length tw. For example, in this embodiment, constant time ts=0.5*delay time length tw.

图5示出根据本发明的阈值电路。Figure 5 shows a threshold circuit according to the invention.

为了监控频带中的平均能量水平,使用了标准峰值保持电路来产生信号阈值。该阈值电路202包括比较器501,延迟器502,常数乘法器503,延迟器504和常数乘法器505。从图5中可以看出延迟器504的输出与常数因子CRel相乘,再被输入到比较器501中。在比较器501中,从延迟器504中输出后再乘以常数因子CRel的能量值与从窗口积分器201中得到的被测能量值进行比较。其中较大的值送入上述延迟器504中,同时该值被延迟器502延迟5*ts时间长度。通过常数乘法器503,延迟器502的输出与常数因子C相乘并被传送到本地最大值检测器204。To monitor the average energy level in the frequency band, a standard peak-and-hold circuit is used to generate a signal threshold. The threshold circuit 202 includes a comparator 501 , a delay 502 , a constant multiplier 503 , a delay 504 and a constant multiplier 505 . It can be seen from FIG. 5 that the output of the delayer 504 is multiplied by the constant factor C Rel and then input to the comparator 501 . In the comparator 501 , the energy value output from the delayer 504 and then multiplied by the constant factor C Rel is compared with the measured energy value obtained from the window integrator 201 . The larger value is sent to the delayer 504, and the value is delayed by the delayer 502 for a time length of 5*ts. The output of delayer 502 is multiplied by a constant factor C by constant multiplier 503 and sent to local maximum detector 204 .

图5示出比较器501的输出被延迟了5*ts后,其值又乘以小于1.0的常数因子C。但延迟的时间长度并不限于上述时间长度。只要不超出本发明的范围,这个时间长度是可以被修改的。FIG. 5 shows that after the output of the comparator 501 is delayed by 5*ts, its value is multiplied by a constant factor C less than 1.0. However, the length of the delay is not limited to the above-mentioned length of time. This length of time can be modified without departing from the scope of the present invention.

图6示出用于检测被测能量值的最大值的过程。Fig. 6 shows a procedure for detecting the maximum value of the measured energy value.

参照图6,窗口积分器201的被分成不同时间段的输出送入一个延迟线601中。延迟线601包含10个延迟器611,612,...,620。第5个延迟器615输出的能量值被称作X(n)。前5个和后5个被测能量值被称作X(n-5),X(n-4),X(n-3),X(n-2),X(n-1),X(n+1),X(n+2),X(n+3),X(n+4)和X(n+5)。假设X(n)为本地的最大能量值。Referring to FIG. 6 , the output of the window integrator 201 divided into different time segments is fed into a delay line 601 . The delay line 601 includes 10 delayers 611 , 612 , . . . , 620 . The energy value output by the fifth delay 615 is called X(n). The first 5 and last 5 measured energy values are called X(n-5), X(n-4), X(n-3), X(n-2), X(n-1), X (n+1), X(n+2), X(n+3), X(n+4), and X(n+5). Suppose X(n) is the local maximum energy value.

参照图6,在步骤S61中,检查被测能量值X(n)在11个能量值X(n-5),X(n-4),...,X(n+5)中是否为最大值。如果经检查被测能量值X(n)在这11个能量值中为最大值,则流程进入步骤S62。但是,如果经检查从延迟器615中输出的能量值X(n)并非这11个能量值中的最大值,流程在步骤S61结束。Referring to Fig. 6, in step S61, check whether the measured energy value X(n) is among 11 energy values X(n-5), X(n-4), ..., X(n+5) maximum value. If it is checked that the measured energy value X(n) is the maximum value among the 11 energy values, the process goes to step S62. However, if it is checked that the energy value X(n) output from the delayer 615 is not the maximum value among the 11 energy values, the process ends in step S61.

在步骤S62中,检查能量值X(n)是否超过了阈值电路输出的阈值。为了避免在没有音频信号存在的情况下进行BPM检测,也要检查能量值X(n)是否低于规定的最小能量标准MinLevel。如果能量值X(n)比阈值大且比规定的最小能量值MinLevel大,则流程进入步骤S63。否则,流程在S62结束。In step S62, it is checked whether the energy value X(n) exceeds the threshold output by the threshold circuit. In order to avoid BPM detection when no audio signal exists, it is also checked whether the energy value X(n) is lower than the specified minimum energy standard MinLevel. If the energy value X(n) is greater than the threshold value and greater than the prescribed minimum energy value MinLevel, the flow goes to step S63. Otherwise, the process ends at S62.

在步骤S63中,能量值X(n)前面的两个和后面的两个被测能量值同样需要满足两个条件:In step S63, the two measured energy values before and after the energy value X(n) also need to meet two conditions:

X(n-2)<X(n-1)&X(n+1)>X(n+2)    (1)X(n-2)<X(n-1)&X(n+1)>X(n+2) (1)

其中X(n-2)是延迟器613的输出的能量值,X(n-1)是延迟器614输出的能量值,其中X(n+1)是延迟器616输出的能量值,其中X(n+2)是延迟器617输出的能量值。Wherein X(n-2) is the energy value of the output of delayer 613, X(n-1) is the energy value of delayer 614 output, and wherein X(n+1) is the energy value of delayer 616 output, and wherein X (n+2) is the energy value output by the delayer 617 .

在步骤S63中,检查能量值X(n-1)是否超过能量值X(n-2),并且能量值X(n+1)是否超过能量值X(n+2)。如果在步骤S63中经检查满足公式(1)定义的条件,则流程进入步骤S64。否则,流程在步骤S63结束。In step S63, it is checked whether the energy value X(n-1) exceeds the energy value X(n-2), and whether the energy value X(n+1) exceeds the energy value X(n+2). If it is checked in step S63 that the condition defined by formula (1) is satisfied, the flow goes to step S64. Otherwise, the process ends in step S63.

本系统是为可能的最大值为158BPM的BPM值的测量而设计的。但是考虑到音乐信号中的某些打击乐器可能产生相当于实际的BPM值2倍或4倍的瞬变值,被检测的两个瞬变事件之间的最小时间间隔应不少于90ms。This system is designed for the measurement of the possible maximum BPM value of 158BPM. However, considering that some percussion instruments in the music signal may produce a transient value equivalent to 2 times or 4 times the actual BPM value, the minimum time interval between the two detected transient events should not be less than 90ms.

因此,我们假定本发明的最小时间间隔tmin=90ms。Therefore, we assume the minimum time interval tmin=90ms of the present invention.

在步骤S64中,计时器205的值与最小时间值tmin相比较。如果经检查,计时器205的值比最小时间值tmin小,则流程在步骤S64结束。这样,从前面被检测出的瞬变值中得到的于tmin时间段中产生的所有本地最大值被忽略不计。但是,如果经检查计时器205的值比最小时间值tmin大,则流程进入步骤S65。In step S64, the value of the timer 205 is compared with the minimum time value tmin. If it is checked that the value of the timer 205 is smaller than the minimum time value tmin, the flow ends in step S64. In this way, all local maxima arising during the tmin period from previously detected transients are ignored. However, if the value of the checked timer 205 is greater than the minimum time value tmin, the flow proceeds to step S65.

在步骤S65中,对第3,第4,第6,第7个延迟器613,614,616,617输出的能量值进行线性衰减处理。时间值Δt可以由该线性衰减处理去确定。该线性衰减的详细处理过程参考图7进行说明。然后,流程进入步骤S66。In step S65, the energy values output by the 3rd, 4th, 6th and 7th delayers 613, 614, 616, 617 are subjected to linear attenuation processing. The time value Δt can be determined by this linear decay process. The detailed processing of the linear attenuation will be described with reference to FIG. 7 . Then, the flow goes to step S66.

在步骤S66中,被计算出的时间值Δt与计时器205的值相加。这样,被测时间段tp与计时器的值和被计算出的时间值Δt之和相等。之后,被测的计时器205的时间值被传送到周期检测器5。然后,计时器205被重新初始化为Δt。In step S66 , the calculated time value Δt is added to the value of the timer 205 . In this way, the measured time period tp is equal to the sum of the timer value and the calculated time value Δt. Afterwards, the measured time value of the timer 205 is transmitted to the period detector 5 . Then, the timer 205 is re-initialized to Δt.

因为仅在长度为ts的时间段中检测本地最大值的存在,很明显,本地最大值位置的精度仅能被确定为±0.5*ts(因为计时器在各个步骤中随ts而增加)。为得到本地最大值更为精确的位置,使用延迟器615的前两个和后两个被测能量值来计算一个四点线性衰减。Since the presence of the local maximum is detected only in a time period of length ts, it is clear that the local maximum position can only be determined with an accuracy of ±0.5*ts (because the timer is incremented with ts in each step). To get a more precise location of the local maximum, a four-point linear decay is calculated using the first two and last two measured energy values of delayer 615 .

图7示出对几个延迟器中被测能量值进行线性衰减的流程图。Fig. 7 shows a flow chart for linear attenuation of measured energy values in several retarders.

参照图7,X轴表示时间,Y轴表示能量值。从图7可以看出,两个被测值X(n-2)和X(n-1)与两个被测值X(n+1)和X(n+2)都是通过直线相连的。这样,这两条直线的交点就表示本地最大值的确切位置:Referring to FIG. 7, the X-axis represents time, and the Y-axis represents energy values. It can be seen from Figure 7 that the two measured values X(n-2) and X(n-1) and the two measured values X(n+1) and X(n+2) are connected by a straight line . Thus, the intersection of these two lines indicates the exact location of the local maximum:

Δt=[5*X(n+1)-4*X(n+2)+X(n-1)-2*X(n-2)]/[X(n-1)-X(n-2)-X(n+2)+X(n+1)]    (2)Δt=[5*X(n+1)-4*X(n+2)+X(n-1)-2*X(n-2)]/[X(n-1)-X(n- 2)-X(n+2)+X(n+1)] (2)

图8示出周期检测器的运行流程图。Fig. 8 shows a flowchart of the operation of the cycle detector.

参照图8,流程开始于步骤S801。首先,在步骤S801中,利用如下公式被测时间间隔tp先转化为一个BPM值:Referring to FIG. 8, the process starts at step S801. First, in step S801, the measured time interval tp is first converted into a BPM value using the following formula:

BPMnew=60/tp    (3)BPMnew=60/tp (3)

其中BPMnew为一个新确定的BPM值,tp是从本地最大值检测器中输出的被测时间间隔。Where BPMnew is a newly determined BPM value, and tp is the measured time interval output from the local maximum detector.

假定被测时间间隔可以从一个节拍中得到,该节拍为被检测的乐曲的实际BPM值的1/2,1/4或2倍。鉴于BPM检测器仅被用于在60到158BPM的范围内确定BPM的值,因此假定低于或高于该范围的BPM值很可能是实际的BPM值的倍数。基于这个原因,为了使BPMnew的值落入理想的范围,根据BPMnew值,新确定的BPM值BPMnew乘以因子2,4,或0.5。It is assumed that the time interval to be measured can be obtained from a beat which is 1/2, 1/4 or 2 times the actual BPM value of the music piece to be detected. Given that the BPM detector is only used to determine BPM values within the range of 60 to 158 BPM, it is assumed that BPM values below or above this range are likely to be multiples of the actual BPM value. For this reason, in order to make the value of BPMnew fall within a desired range, the newly determined BPM value BPMnew is multiplied by a factor of 2, 4, or 0.5 according to the BPMnew value.

之后,流程进入步骤S802。在步骤S802中,检查新确定的BPM值BPMnew是否低于60BPM。如果它低于60BPM,则流程进入步骤S803,否则流程进入步骤S804。After that, the flow goes to step S802. In step S802, it is checked whether the newly determined BPM value BPMnew is lower than 60 BPM. If it is lower than 60 BPM, the flow goes to step S803, otherwise the flow goes to step S804.

在步骤S803中,利用如下公式,新确定的BPM值被加倍:In step S803, the newly determined BPM value is doubled using the following formula:

BPMnew=2*BPMnew    (4)BPMnew=2*BPMnew (4)

然后,流程进入步骤S804。在步骤S804中,再次检查新确定的BPM值BPMnew是否低于60BPM。如果它低于60BPM,流程进入步骤S805,否则,流程进入步骤S806。Then, the flow goes to step S804. In step S804, it is checked again whether the newly determined BPM value BPMnew is lower than 60 BPM. If it is lower than 60 BPM, the flow goes to step S805, otherwise, the flow goes to step S806.

在步骤S805中,利用公式(4)新确定的BPM值BPMnew被加倍。然后,流程进入步骤S806。In step S805, the newly determined BPM value BPMnew using formula (4) is doubled. Then, the flow goes to step S806.

在步骤S806中,检查新确定的BPM值BPMnew是否大于158BPM。如果它大于158BPM,则流程进入步骤S807,否则,流程进入步骤S808。In step S806, it is checked whether the newly determined BPM value BPMnew is greater than 158 BPM. If it is greater than 158BPM, the flow goes to step S807, otherwise, the flow goes to step S808.

在步骤S807中,利用如下公式,新确定的BPM值BPMnew被减半:In step S807, the newly determined BPM value BPMnew is halved by using the following formula:

BPMnew=0.5*BPMnew  (5)BPMnew=0.5*BPMnew (5)

然后,流程进入步骤S808。在步骤S808中,利用如下公式,可以得到前面所测BPM值的平均值BPMavr:Then, the flow goes to step S808. In step S808, the average value BPMavr of the previously measured BPM values can be obtained by using the following formula:

BPMavr=SUM/NUMBER  (6)BPMavr=SUM/NUMBER (6)

其中BPMavr为前面所测BPM值的平均值;SUM为前面BPM值之和;NUMBER为累加的BPM值的个数。Among them, BPMavr is the average value of the previously measured BPM values; SUM is the sum of the previous BPM values; NUMBER is the number of accumulated BPM values.

之后,流程进入步骤S809。在步骤S809中,新检测得到的BPM值BPMnew与前面所测的BPM值的平均值BPMavr进行比较并确定这两个值之差的绝对值是否小于当前值ΔBPMmax。After that, the flow goes to step S809. In step S809, the newly detected BPM value BPMnew is compared with the average BPMavr of the previously measured BPM values and it is determined whether the absolute value of the difference between the two values is smaller than the current value ΔBPMmax.

如果新检测得到的BPM值BPMnew与前面所测的BPM值的平均值BPMavr之差的绝对值大于ΔBPMmax的当前值,则认为新的检测是失败的。失败标记FAIL被置为1。If the absolute value of the difference between the newly detected BPM value BPMnew and the average BPMavr of the previously measured BPM values is greater than the current value of ΔBPMmax, the new detection is considered to be a failure. The failure flag FAIL is set to 1.

如果差的绝对值在当前值ΔBPMmax的范围之内,则流程进入步骤S813。否则流程进入步骤S810。If the absolute value of the difference is within the range of the current value ΔBPMmax, the flow proceeds to step S813. Otherwise, the process goes to step S810.

在步骤S813中,新检测得到的BPM值BPMnew与前面的BPM值之和相加。并且,累加的BPM值的个数增加1。然后流程进入步骤S814。In step S813, the newly detected BPM value BPMnew is added to the sum of the previous BPM values. And, the number of accumulated BPM values increases by 1. Then the flow goes to step S814.

在步骤S810中,检查失败标记FAIL是否小于值“2”。如果失败标记FAIL小于“2”,则流程进入步骤S812.在步骤S812中,失败标记FAIL被增加1并且流程在步骤S812结束。否则,如果在步骤S810中经检查失败标记FAIL不小于2,则流程进入步骤S811。在步骤S811中,前面BPM值之和SUM和累加的BPM值的个数NUMBER都被初始化为“0”。然后流程在步骤S811结束。In step S810, it is checked whether the failure flag FAIL is smaller than the value "2". If the failure flag FAIL is less than "2", the flow proceeds to step S812. In step S812, the failure flag FAIL is incremented by 1 and the flow ends in step S812. Otherwise, if the failed flag FAIL is not less than 2 after checking in step S810, then the flow goes to step S811. In step S811, both the sum of the previous BPM values SUM and the number of accumulated BPM values NUMBER are initialized to "0". Then the flow ends in step S811.

再返回步骤S814,检查累加的BPM值的个数NUMBER是否大于或等于“3”。如果它小于3,则流程在步骤S814结束。否则,流程进入步骤S815并且失败标记FAIL被重新置为“0”。然后流程进入步骤S816。Returning to step S814, it is checked whether the number NUMBER of the accumulated BPM values is greater than or equal to "3". If it is less than 3, the flow ends at step S814. Otherwise, the flow goes to step S815 and the failure flag FAIL is reset to "0". Then the flow goes to step S816.

在步骤S816中,利用公式6重新计算前面所测的BPM值的平均值BPMavr。最后,前面所测的BPM值的平均值BPMavr和累加的BPM值的个数NUMBER都被传送到显示逻辑单元6。In step S816, formula 6 is used to recalculate the average BPMavr of the previously measured BPM values. Finally, both the average value BPMavr of the previously measured BPM values and the number NUMBER of accumulated BPM values are sent to the display logic unit 6 .

图9示出显示逻辑单元的运行流程图。FIG. 9 shows a flow chart showing the operation of the logic unit.

参照图1和9,显示逻辑单元6首先从每个BPM检测器101,102,...,10n的周期检测器中接收前面所测的BPM值的平均值BPMavr和累加的BPM值的个数NUMBER。1 and 9, the display logic unit 6 first receives the average BPMavr of the previously measured BPM values and the number of accumulated BPM values from the cycle detectors of each BPM detector 101, 102, ..., 10n NUMBER.

在步骤S901中,变量“i”被用作循环指示变量并被首先初始化为“2”。另外,变量ibest被初始化为“1”。In step S901, a variable "i" is used as a loop indicator variable and is first initialized to "2". Also, the variable ibest is initialized to "1".

假定所有BPM检测器101,102,...,10n中的前面所测的BPM值的平均值BPMavr和累加的BPM值的个数NUMBER被存储在数组变量BPMavr(i)和NUMBER(i)中。这就意味着BPM检测器101中的被测BPM值的平均值BPMavr存储在BPMavr(1)中并且累加的BPM值的个数存储在NUMBER(1)中。BPM检测器102中的被测BPM值的平均值BPMavr存储在BPMavr(2)中等等。Assume that the average value BPMavr of the BPM values measured in front of all BPM detectors 101, 102, ..., 10n and the number NUMBER of the accumulated BPM values are stored in the array variables BPMavr (i) and NUMBER (i) . This means that the average BPMavr of the measured BPM values in the BPM detector 101 is stored in BPMavr(1) and the number of accumulated BPM values is stored in NUMBER(1). The average value BPMavr of the measured BPM values in the BPM detector 102 is stored in BPMavr(2) and so on.

为了确定当前哪一个BPM检测器存储着最大值NUMBER,使用一个循环来得到最大值NUMBER的指示。To determine which BPM detector currently stores the maximum NUMBER, a loop is used to get an indication of the maximum NUMBER.

在步骤S902中,比较变量NUMBER(i)和NUMBER(ibest)中的内容。只有当值NUMBER(i)比值NUMBER(ibest)大时,循环指示变量“i”中的内容才被存储到ibest中。下面,循环变量“i”被增加“1”。然后流程进入步骤S903。在步骤S903中,检查“i”是否等于或大于“n”,其中“n”为BPM检测器的个数加1。如果“i”比“n”小,则流程返回步骤S902。否则,流程进入步骤S904。In step S902, the contents of variables NUMBER(i) and NUMBER(ibest) are compared. Only when the value NUMBER(i) is greater than the value NUMBER(ibest), the content of the loop indicator variable "i" is stored in ibest. Next, the loop variable "i" is incremented by "1". Then the flow goes to step S903. In step S903, it is checked whether "i" is equal to or greater than "n", where "n" is the number of BPM detectors plus 1. If "i" is smaller than "n", the process returns to step S902. Otherwise, the process goes to step S904.

在步骤S904中,检查存储最大的NUMBER值的BPM检测器中的NUMBER(ibest)的值是否等于或大于“3”。如果它小于3,则流程在步骤S904结束。但是,如果它等于或大于3,流程进入步骤S905。然后,已确定的BPM值BPMavr(ibest)输出到显示单元7。这样,一支乐曲的节拍数就被准确地检测出来了。In step S904, it is checked whether the value of NUMBER(ibest) in the BPM detector storing the largest NUMBER value is equal to or greater than "3". If it is less than 3, the flow ends in step S904. However, if it is equal to or greater than 3, the flow advances to step S905. Then, the determined BPM value BPMavr(ibest) is output to the display unit 7 . In this way, the number of beats of a piece of music is accurately detected.

上面说明的实施例是专门适用于检测一支乐曲的节拍数的。鉴于这种装置主要应用于“DJ设备”,BPM检测器被设计为速度范围在60到158BPM之间。但是,本发明并不限于此,对于其它检测方法它也是适用的,例如检测其它音频信号节拍数的方法。The above-described embodiment is specially adapted to detect the number of beats of a piece of music. Given that this device is mainly used in "DJ equipment", the BPM detector is designed to have a tempo range between 60 and 158BPM. However, the present invention is not limited thereto, and it is also applicable to other detection methods, such as methods for detecting beat numbers of other audio signals.

不脱离本发明的范围和构思可以作出许多其它改变和改型。应当理解,本发明不限于特定的实施例,本发明的范围由所附权利要求限定。Many other changes and modifications can be made without departing from the scope and spirit of the invention. It should be understood that the invention is not limited to the particular embodiments, but that the scope of the invention is defined by the appended claims.

Claims (10)

1.一种节拍数检测装置,包括:1. A beat detection device, comprising: 带通滤波器(2),用于从输入音频信号中选取特定频率;a bandpass filter (2) for selecting specific frequencies from the input audio signal; 瞬变值检测装置(3),用于从带通滤波器(2)的输出中检测瞬变值;A transient value detection device (3), used for detecting transient values from the output of the bandpass filter (2); 定时器(4),用于确定积分器窗口长度;Timer (4), is used for determining integrator window length; 周期检测装置(5),用于检查被测时间间隔和确定BPM平均值;以及Period detection means (5) for checking the measured time interval and determining the average value of BPM; and 显示逻辑装置(6),用于从上述周期检测装置(5)中确定最可信的被测BPM值。Display logic means (6) for determining the most plausible measured BPM value from the period detection means (5) described above. 2.根据权利要求1所述的节拍数检测装置,其中,上述瞬变值检测装置(3)包括:2. The beat number detection device according to claim 1, wherein the above-mentioned transient value detection device (3) comprises: 窗口积分器(201),用于产生矩形积分窗口,以检测频带内的平均能量值;A window integrator (201), used to generate a rectangular integration window to detect the average energy value in the frequency band; 阈值装置(202),用于产生信号阈值,以监测频带内的平均能量值;Threshold means (202), for generating a signal threshold to monitor the average energy value within the frequency band; 本地最大值检测装置(204),用于从上述窗口积分器(201)的输出中确定最大能量值;以及local maximum detection means (204) for determining the maximum energy value from the output of said window integrator (201); and 开关(203),用于在上述定时器(4)的控制下将从上述窗口积分器(201)中输出的能量值提供给上述本地最大值检测装置(204)。A switch (203), configured to provide the energy value output from the window integrator (201) to the local maximum detection device (204) under the control of the timer (4). 3.根据权利要求2所述的节拍数检测装置,其中,上述瞬变值检测装置(3)还包括:3. The beat number detection device according to claim 2, wherein the above-mentioned transient value detection device (3) also includes: 计时器(205),用于根据上述定时器(4)计算时间以及检测两个被测瞬变值之间的时间间隔。The timer (205) is used for calculating time according to the above-mentioned timer (4) and detecting the time interval between two measured transient values. 4.根据权利要求2所述的节拍数检测装置,其中,上述瞬变值检测装置(3)还包括:4. The beat number detection device according to claim 2, wherein the above-mentioned transient value detection device (3) further comprises: 常数乘法器(306),用于将从上述窗口积分器(201)中输出的能量值加倍并将其输出到上述本地最大值检测装置(204)。A constant multiplier (306) for multiplying the energy value output from the window integrator (201) and outputting it to the local maximum detection means (204). 5.根据权利要求2所述的节拍数检测装置,其中,由上述定时器(4)产生的恒定时间间隔(ts)比由窗口积分器(201)产生的延迟长度(tw)短。5. The beat number detection device according to claim 2, wherein the constant time interval (ts) generated by the timer (4) is shorter than the delay length (tw) generated by the window integrator (201). 6.根据权利要求2至5中任意一项所述的节拍数检测装置,其中,上述本地最大值检测装置(204)还包括:6. The beat number detection device according to any one of claims 2 to 5, wherein the above-mentioned local maximum detection device (204) further comprises: 多个延迟器(611,…,620),用于将从上述窗口积分器(201)中输出的能量值延迟;上述本地最大值检测装置(204)在上述延迟器(611,…,620)之上进行线性衰减处理,并将检测的时间间隔输出到上述周期检测装置(5)。A plurality of delayers (611, ..., 620), used to delay the energy value output from the above-mentioned window integrator (201); the above-mentioned local maximum detection device (204) On top of that, linear attenuation processing is performed, and the detected time interval is output to the above-mentioned cycle detection device (5). 7.根据权利要求1所述的节拍数检测装置,其中,上述周期检测装置(5)根据前面BPM值之和及累加的BPM值的个数确定前面被测BPM值的平均值。7. The beat number detection device according to claim 1, wherein the period detection device (5) determines the average value of the previous BPM values measured according to the sum of the previous BPM values and the number of accumulated BPM values. 8.根据权利要求1所述的节拍数检测装置,其中,上述周期检测装置(5)比较新检测的BPM值和前面检测的BPM值的平均值之间的差值。8. The beat number detection device according to claim 1, wherein said period detection device (5) compares the difference between the newly detected BPM value and the average value of the previously detected BPM values. 9.根据权利要求1所述的节拍数检测装置,其中,上述显示逻辑装置(6)确定从BPM检测器中输出的前面检测的BPM值的平均值为最可信的BPM值,其中该BPM检测器中的累加BPM值个数为BPM检测器(101,…,10n)中最多的。9. The number of beat detection device according to claim 1, wherein the above-mentioned display logic device (6) determines that the average value of the BPM values detected in front of the output from the BPM detector is the most credible BPM value, wherein the BPM The number of accumulated BPM values in the detector is the largest among the BPM detectors (101, . . . , 10n). 10.根据权利要求1所述的节拍数检测装置,还包括显示装置(7),其用于与被测BPM值的产生同步地进行显示。10. The beat number detection device according to claim 1, further comprising display means (7) for displaying in synchronization with generation of the measured BPM value.
CNB02142473XA 2002-09-20 2002-09-20 Beat number detector Expired - Fee Related CN100478810C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB02142473XA CN100478810C (en) 2002-09-20 2002-09-20 Beat number detector

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB02142473XA CN100478810C (en) 2002-09-20 2002-09-20 Beat number detector

Publications (2)

Publication Number Publication Date
CN1484116A CN1484116A (en) 2004-03-24
CN100478810C true CN100478810C (en) 2009-04-15

Family

ID=34148064

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB02142473XA Expired - Fee Related CN100478810C (en) 2002-09-20 2002-09-20 Beat number detector

Country Status (1)

Country Link
CN (1) CN100478810C (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1684263B1 (en) * 2005-01-21 2010-05-05 Unlimited Media GmbH Method of generating a footprint for an audio signal
US7330803B2 (en) * 2005-06-22 2008-02-12 Ametek, Inc. High resolution time interval measurement apparatus and method
CN104299621B (en) * 2014-10-08 2017-09-22 北京音之邦文化科技有限公司 The timing intensity acquisition methods and device of a kind of audio file
CN107103917B (en) * 2017-03-17 2020-05-05 福建星网视易信息系统有限公司 Music rhythm detection method and system
CN113011549A (en) * 2021-02-20 2021-06-22 重庆博奥新景医学科技有限公司 Self-adaptive measurement and calculation method applied to luminescence value of chemiluminescence analyzer

Also Published As

Publication number Publication date
CN1484116A (en) 2004-03-24

Similar Documents

Publication Publication Date Title
US6812394B2 (en) Method and device for determining rhythm units in a musical piece
US10497348B2 (en) Evaluation device and evaluation method
US20110067555A1 (en) Tempo detecting device and tempo detecting program
EP0146640B1 (en) Period detection circuit
US11749240B2 (en) Beat timing generation device and method thereof
CN100478810C (en) Beat number detector
CN109584902B (en) Music rhythm determining method, device, equipment and storage medium
JP3373315B2 (en) Beat detection device
US6940931B2 (en) Clock-synchronism evaluating apparatus and method
JP4214606B2 (en) Tempo calculation method and tempo calculation device
JP2001311754A (en) Time measuring device
JP2017203931A (en) Acoustic property measurement device and acoustic property measurement method
EP3346468B1 (en) Musical-piece analysis device, musical-piece analysis method, and musical-piece analysis program
JPS6370294A (en) Tempo display device
JP3919359B2 (en) Device for detecting the attack position of a musical sound signal
KR0132493B1 (en) Score calculating device of karaoke
KR870003461A (en) Piano tuning method and device
JPH021566A (en) Cycle measuring instrument
Bhatta et al. Laya Estimation for Hindustani Classical Vocals, Devoid of Rhythmic Indicators
RU2003985C1 (en) Device for measuring frequency instability
JP3092197B2 (en) Pitch extraction device
JP2000267654A5 (en) Tempo calculation method and tempo calculation device
SU546901A1 (en) Delay device
JPWO2017037919A1 (en) Music analysis apparatus, music analysis method, and music analysis program
JPS6370293A (en) Tempo display device

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
ASS Succession or assignment of patent right

Owner name: MUSIC GROUP IP LTD.

Free format text: FORMER OWNER: HONGXIN LTD.

Effective date: 20121113

C41 Transfer of patent application or patent right or utility model
TR01 Transfer of patent right

Effective date of registration: 20121113

Address after: The British Virgin Islands of Tortola

Patentee after: MUSIC GROUP INTELLECTUAL PROPERTY CO., LTD.

Address before: The British Virgin Islands of Tortola

Patentee before: Red Core Co., Ltd.

CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20090415

Termination date: 20160920