Music rhythm detection method, device, equipment and storage medium
Through spectral decomposition and filtering processing of audio data, combined with phase and amplitude information, the problem of being unable to detect phase changes and variable beats in the existing technology is solved, and accurate detection of music rhythm and calculation of rhythm cycles are achieved.
Patent Information
- Application Number
- CN202110767209.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-07-07
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2041-07-07
AI Technical Summary
Existing music rhythm detection methods are based on the spectral energy method, which ignores phase changes in the frequency domain of music, cannot detect rhythm points caused by phase changes, and is difficult to handle changeable beat forms, such as syncopation.
By obtaining the spectrum data of audio data, decomposing it into amplitude spectrum and phase spectrum, calculating the predicted spectrum and target amplitude spectrum, and performing filtering processing to detect rhythm points, combining phase information and amplitude information, and using the filtering results under different delays Determine optimal delay and cadence period.
It accurately detects rhythm points caused by phase changes, improves the rhythm detection rate, and can handle rhythm points in changing beat forms, such as syncopation.
Smart Images

Figure CN113643717B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of audio data processing, and in particular to a music rhythm detection method, device, equipment and storage medium. Background Art
[0002] Music rhythm detection is one of the important tasks of Music Information Retrieval (MIR), and it has great potential for application in automatic stage lighting change, song classification, etc. Humans can easily identify the rhythm of music, and then naturally follow the beat of the music by tapping their feet, shaking their heads, or clapping their hands. But for computers, understanding the rhythm and melody of music is still a challenging task. The current mainstream music rhythm detection method is based on the music signal spectrum energy method to detect music rhythm. The existing detection method based on the spectrum energy method has two defects: 1. It ignores the change of the music frequency domain phase and only uses the frequency domain amplitude, and cannot detect the rhythm point caused by the phase change; 2. The method based only on the spectrum energy peak to judge the rhythm point cannot handle the variable beat forms in existing music, such as syncopation. Summary of the invention
[0003] In view of the above problems, the purpose of the present invention is to provide a music rhythm detection method, device, equipment and storage medium, which can detect rhythm points caused by phase changes and improve the rhythm detection rate.
[0004] In a first aspect, an embodiment of the present invention provides a music rhythm detection method, comprising:
[0005] Acquire several frames of audio data of the music to be detected, and convert the several frames of audio data into spectrum data;
[0006] Decomposing the frequency spectrum data of the plurality of frames to obtain amplitude spectra and phase spectra of the audio data of the plurality of frames;
[0007] Calculate the predicted frequency spectrum of the current frame of audio data based on the amplitude spectrum and phase spectrum corresponding to the previous K frames of audio data;
[0008] Calculate the target amplitude spectrum of the current frame audio data according to the frequency spectrum data corresponding to the current frame audio data and the predicted frequency spectrum data;
[0009] The target amplitude spectrum is filtered to obtain the rhythm point of the current frame audio data.
[0010] As an improvement of the above solution, filtering the target amplitude spectrum to obtain the rhythm point of the current frame audio data includes:
[0011] Performing filtering processing on the target amplitude spectrum at different delays to obtain filtering results at different delays;
[0012] Determine the optimal delay based on the filtering results under different delays;
[0013] Calculating a starting rhythm point according to the optimal delay and a filtering result corresponding to the optimal delay;
[0014] The optimal delay is used as the rhythm cycle, and the rhythm point is obtained according to the starting rhythm point and the rhythm cycle.
[0015] As an improvement of the above solution, determining the optimal delay according to the filtering results under different delays includes:
[0016] The filtering results under different delays are summed up, and the delay corresponding to the maximum sum value is obtained as the optimal delay.
[0017] As an improvement of the above solution, the step of converting the audio data of a plurality of frames into spectrum data includes:
[0018] Performing sliding window frame processing on the audio data;
[0019] Perform Fourier transform on the framed audio data to obtain the spectrum data.
[0020] As an improvement of the above solution, the step of calculating the predicted spectrum of the current frame audio data according to the amplitude spectrum and phase spectrum corresponding to the previous K frames of audio data includes:
[0021] According to the amplitude spectrum and phase spectrum corresponding to the previous K frames of audio data, the predicted spectrum of the current frame of audio data is calculated by formula (1);
[0022]
[0023] Where K = 2, M (i-1, m), Represents the amplitude spectrum and phase spectrum of the previous frame of audio data, It represents the phase spectrum of the first two frames of audio data, and fmod represents the remainder function.
[0024] As an improvement of the above solution, the step of calculating the target amplitude spectrum of the current frame audio data according to the spectrum data corresponding to the current frame audio data and the predicted spectrum data includes:
[0025] The target amplitude spectrum of the current frame audio data is calculated by formula (2);
[0026]
[0027] Wherein, R(i, m), I(i, m) represent the real part and imaginary part of the spectrum data corresponding to the current frame audio data; Represents the real and imaginary parts of the predicted spectrum data corresponding to the current frame audio data.
[0028] As an improvement of the above solution, the calculating the starting rhythm point according to the optimal delay and the filtering result corresponding to the optimal delay includes:
[0029] Calculate the starting rhythm point by formula (3);
[0030]
[0031] Among them, τ pre represents the optimal delay, y(i, τ pre ) is the filtering result corresponding to the optimal delay, and N represents the number of frames of audio data.
[0032] In a second aspect, an embodiment of the present invention provides a music rhythm detection device, comprising:
[0033] A spectrum conversion module, used to obtain a plurality of frames of audio data of the music to be detected, and convert the plurality of frames of the audio data into spectrum data;
[0034] A spectrum decomposition module, used to decompose the spectrum data of several frames to obtain amplitude spectrum and phase spectrum of the audio data of several frames;
[0035] The spectrum prediction module is used to calculate the predicted spectrum of the current frame audio data based on the amplitude spectrum and phase spectrum corresponding to the previous K frames of audio data;
[0036] A target amplitude spectrum calculation module is used to calculate the target amplitude spectrum of the current frame audio data according to the spectrum data corresponding to the current frame audio data and the predicted spectrum data;
[0037] The rhythm point calculation module is used to filter the target amplitude spectrum to obtain the rhythm point of the current frame audio data.
[0038] In a third aspect, an embodiment of the present invention provides a music rhythm detection device, comprising a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein when the processor executes the computer program, it implements the music rhythm detection method as described in any one of the first aspects.
[0039] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute the music rhythm detection method as described in any one of the first aspects.
[0040] Compared with the prior art, the beneficial effect of the example of the present invention is that the music rhythm detection method includes: obtaining several frames of audio data of the music to be detected, and converting the several frames of audio data into spectrum data; decomposing the several frames of spectrum data to obtain the amplitude spectrum and phase spectrum of the several frames of audio data; calculating the predicted spectrum of the current frame of audio data according to the amplitude spectrum and phase spectrum corresponding to the previous K frames of audio data; calculating the target amplitude spectrum of the current frame of audio data according to the spectrum data and predicted spectrum data corresponding to the current frame of audio data; filtering the target amplitude spectrum to obtain the rhythm point of the current frame of audio data. By combining the phase information and amplitude information of the audio data, the rhythm point caused by the phase change can be accurately detected, and the rhythm detection rate can be improved. At the same time, the rhythm period can be calculated by filtering, and the rhythm point under the variable beat form can be accurately detected without relying on the amplitude and phase size. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the technical solution of the present invention, the drawings required for use in the implementation mode will be briefly introduced below. Obviously, the drawings described below are only some implementation modes of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0042] Figure 1 is a flow chart of a music rhythm detection method provided by the first embodiment of the present invention;
[0043] Figure 2 is a schematic diagram of a music rhythm detection device provided by a second embodiment of the present invention;
[0044] Figure 3 2 is a schematic diagram of a music rhythm detection device provided by the third embodiment of the present invention. DETAILED DESCRIPTION
[0045] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0046] See also Figure 1 , a flowchart of a music rhythm detection method provided by an embodiment of the present invention, the music rhythm detection method comprising:
[0047] S1: Acquire several frames of audio data of the music to be detected, and convert the several frames of audio data into spectrum data;
[0048] S2: Decomposing the frequency spectrum data of the plurality of frames to obtain amplitude spectra and phase spectra of the audio data of the plurality of frames;
[0049] S3: Calculate the predicted spectrum of the current frame audio data according to the amplitude spectrum and phase spectrum corresponding to the previous K frames of audio data;
[0050] S4: Calculate the target amplitude spectrum of the current frame audio data according to the spectrum data corresponding to the current frame audio data and the predicted spectrum data;
[0051] S5: Filter the target amplitude spectrum to obtain the rhythm point of the current frame audio data.
[0052] In this implementation, the predicted frequency spectrum data of the current frame audio data is predicted by the phase spectrum and amplitude spectrum of the previous K frames of audio data of the current frame. The local stability characteristics of music audio can be utilized to fully utilize the amplitude spectrum and phase spectrum information, so as to accurately detect rhythm points caused by phase changes, such as rhythm points when pitch changes occur, thereby improving the rhythm detection rate. At the same time, the rhythm period is calculated by filtering, and the rhythm points in variable beat forms, such as syncopated positions, can be accurately detected without relying on the amplitude and phase size.
[0053] In an optional embodiment, filtering the target amplitude spectrum to obtain the rhythm point of the current frame audio data includes:
[0054] Performing filtering processing on the target amplitude spectrum at different delays to obtain filtering results at different delays;
[0055] Determine the optimal delay based on the filtering results under different delays;
[0056] Calculating a starting rhythm point according to the optimal delay and a filtering result corresponding to the optimal delay;
[0057] The optimal delay is used as the rhythm cycle, and the rhythm point is obtained according to the starting rhythm point and the rhythm cycle.
[0058] Further, determining the optimal delay according to the filtering results under different delays includes:
[0059] The filtering results under different delays are summed up, and the delay corresponding to the maximum sum value is obtained as the optimal delay.
[0060] Exemplarily, assuming that the delay of the filter is τ, the target amplitude spectrum is a series of first-order difference values ξ(i), and a series of filtered filtering results y(i,τ)=ξ(i)+α*y(i-τ,τ) are obtained; wherein α represents the gain coefficient, preferably, α=0.5 i / N . N represents the number of frames of audio data.
[0061] Then add the filter results y obtained under different delays τ, and output the maximum filter delay as the optimal rhythm period τ pre ;
[0062]
[0063] Then according to the rhythm period τ pre and its corresponding filtering result y(i,τ pre ), calculate the position of the starting rhythm point;
[0064] Finally, according to the position of the starting rhythm point and the rhythm period τ pre You can get the rest of the rhythm points.
[0065] In an embodiment of the present invention, a group of filters are used to estimate the music rhythm. After the target amplitude spectrum passes through a series of filters with different delays, the output of the filter that best matches the signal period will receive the highest excitation, thereby detecting rhythm points with positions such as syncopation.
[0066] In an optional embodiment, converting the plurality of frames of audio data into spectrum data comprises:
[0067] Performing sliding window frame processing on the audio data;
[0068] Perform Fourier transform on the framed audio data to obtain the spectrum data.
[0069] In the embodiment of the present invention, the audio data x(t) is subjected to sliding window framing and Fourier transform to obtain spectrum data X(n, m), where n is the frame number, n=1, 2, ..., N; m is the number of audio points in a frame, m=1, 2, ..., M. The Fourier transform result of the mth point in the i-th frame can be expressed as:
[0070] X(i, m) = R(i, m) + jI(i, m)
[0071] Among them, R(i, m) and I(i, m) represent the real part and the imaginary part respectively.
[0072] By performing Fourier transform on the audio data, we can get the amplitude spectrum M(i, m) and phase spectrum of the audio data. This facilitates subsequent rhythm point detection. The amplitude spectrum and phase spectrum of the mth point in the i-th frame can be expressed as:
[0073]
[0074] Among them, atan represents the inverse tangent function
[0075] In an optional embodiment, the step of calculating the predicted spectrum of the current frame of audio data according to the amplitude spectrum and the phase spectrum corresponding to the previous K frames of audio data includes:
[0076] According to the amplitude spectrum and phase spectrum corresponding to the previous K frames of audio data, the predicted spectrum of the current frame of audio data is calculated by formula (1);
[0077]
[0078] Where K = 2, M (i-1, m), Represents the phase spectrum of the previous frame of audio data, It represents the phase spectrum of the first two frames of audio data, and fmod represents the remainder function.
[0079] Furthermore, the frequency spectrum data corresponding to the current frame audio data and the first-order difference of the predicted frequency spectrum data can be calculated as the rhythm detection basis of the current frame audio data, that is, the target amplitude spectrum. The target amplitude spectrum of the i-th frame audio data can be expressed as:
[0080]
[0081] Wherein, R(i, m), I(i, m) represent the real part and imaginary part of the spectrum data corresponding to the current frame audio data; Represents the real and imaginary parts of the predicted spectrum data corresponding to the current frame audio data.
[0082] Formula (2) can be used to predict the rhythm weights of the current frame at different frequency points.
[0083] In an optional embodiment, calculating the starting rhythm point according to the optimal delay and the filtering result corresponding to the optimal delay includes:
[0084] Calculate the starting rhythm point by formula (3);
[0085]
[0086] Among them, τ pre represents the optimal delay, y(i, τ pre ) is the filtering result corresponding to the optimal delay, and N represents the number of frames of audio data.
[0087] Compared with the prior art, the beneficial effects of the embodiments of the present invention are:
[0088] 1. The rhythm point caused by phase change has an amplitude change that is not obvious at this time, and the traditional amplitude detection method cannot detect it. The embodiment of the present invention can accurately detect the rhythm point caused by phase change by combining the phase information and amplitude information of the audio data, thereby improving the rhythm detection rate;
[0089] 2. The best rhythm cycle is calculated through filtering, and then the rhythm point can be accurately calculated through the rhythm cycle, which is independent of the amplitude and phase size, and can accurately detect the rhythm points in various beat forms, such as syncopation.
[0090] See also Figure 2 The second embodiment of the present invention provides a music rhythm detection device, comprising:
[0091] The spectrum conversion module 1 is used to obtain a plurality of frames of audio data of the music to be detected, and convert the plurality of frames of the audio data into spectrum data;
[0092] The spectrum decomposition module 2 is used to decompose the spectrum data of several frames to obtain the amplitude spectrum and phase spectrum of the audio data of several frames;
[0093] The spectrum prediction module 3 is used to calculate the predicted spectrum of the current frame audio data according to the amplitude spectrum and phase spectrum corresponding to the previous K frames of audio data;
[0094] The target amplitude spectrum calculation module 4 is used to calculate the target amplitude spectrum of the current frame audio data according to the spectrum data corresponding to the current frame audio data and the predicted spectrum data;
[0095] The rhythm point calculation module 5 is used to filter the target amplitude spectrum to obtain the rhythm point of the current frame audio data.
[0096] In an optional embodiment, the rhythm point calculation module 5 includes:
[0097] A filtering unit, used for performing filtering processing on the target amplitude spectrum at different delays to obtain filtering results at different delays;
[0098] An optimal delay determination unit, used to determine the optimal delay according to the filtering results under different delays;
[0099] A starting rhythm point calculation unit, used for calculating a starting rhythm point according to the optimal delay and a filtering result corresponding to the optimal delay;
[0100] The remaining rhythm point calculation units are used to obtain the rhythm point according to the starting rhythm point and the rhythm period, taking the optimal delay as the rhythm period.
[0101] Furthermore, the optimal delay determination unit is used to sum the filtering results under different delays and obtain the delay corresponding to the maximum sum value as the optimal delay.
[0102] In an optional embodiment, the spectrum conversion module 1 includes:
[0103] A framing unit, used for performing sliding window framing processing on the audio data;
[0104] The Fourier transform unit is used to perform Fourier transform on the framed audio data to obtain the spectrum data.
[0105] In an optional embodiment, the spectrum prediction module 3 is used to
[0106] According to the amplitude spectrum and phase spectrum corresponding to the previous K frames of audio data, the predicted spectrum of the current frame of audio data is calculated by formula (1);
[0107]
[0108] Where K = 2, M (i-1, m), Represents the amplitude spectrum and phase spectrum of the previous frame of audio data, It represents the phase spectrum of the first two frames of audio data, and fmod represents the remainder function.
[0109] In an optional embodiment, the target amplitude spectrum calculation module 4 is used to
[0110] The target amplitude spectrum of the current frame audio data is calculated by formula (2);
[0111]
[0112] Wherein, R(i, m), I(i, m) represent the real part and imaginary part of the spectrum data corresponding to the current frame audio data; Represents the real and imaginary parts of the predicted spectrum data corresponding to the current frame audio data.
[0113] In an optional embodiment, the starting rhythm point calculation unit is used to
[0114] Calculate the starting rhythm point by formula (3);
[0115]
[0116] Among them, τ pre represents the optimal delay, y(i, τ pre ) is the filtering result corresponding to the optimal delay, and N represents the number of frames of audio data.
[0117] It should be noted that the principle and technical effect of the music rhythm detection device described in the embodiment of the present invention are the same as those of the music rhythm detection method described in the first embodiment, and will not be repeated here.
[0118] See also Figure 3The third embodiment of the present invention provides a music rhythm detection device, including at least one processor 11, such as a CPU, at least one network interface 14 or other user interface 13, a memory 15, and at least one communication bus 12, wherein the communication bus 12 is used to realize the connection and communication between these components. Among them, the user interface 13 may optionally include a USB interface and other standard interfaces and a wired interface. The network interface 14 may optionally include a Wi-Fi interface and other wireless interfaces. The memory 15 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk storage. The memory 15 may optionally include at least one storage device located away from the aforementioned processor 11.
[0119] In some embodiments, the memory 15 stores the following elements, executable modules or data structures, or a subset thereof, or an extended set thereof:
[0120] Operating system 151, including various system programs for implementing various basic services and processing hardware-based tasks;
[0121] Procedure 152.
[0122] Specifically, the processor 11 is used to call the program 152 stored in the memory 15 to execute the music rhythm detection method described in the above embodiment, for example Figure 1 Alternatively, when the processor executes the computer program, the functions of the modules / units in the above-mentioned device embodiments are implemented, such as the spectrum conversion module.
[0123] Exemplarily, the computer program may be divided into one or more modules / units, which are stored in the memory and executed by the processor to complete the present invention. The one or more modules / units may be a series of computer program instruction segments capable of completing specific functions, which are used to describe the execution process of the computer program in the music rhythm detection device.
[0124] The music rhythm detection device may be a computing device such as a VCU, an ECU, or a BMS. The music rhythm detection device may include, but is not limited to, a processor and a memory. Those skilled in the art will appreciate that the schematic diagram is merely an example of a music rhythm detection device and does not constitute a limitation on the music rhythm detection device, and may include more or fewer components than shown in the figure, or combine certain components, or different components.
[0125] The processor 11 may be a microprocessor (MCU) or a central processing unit (CPU), or other general-purpose processors, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc. The processor 11 is the control center of the music rhythm detection device, and various interfaces and lines are used to connect various parts of the entire music rhythm detection device.
[0126] The memory 15 can be used to store the computer program and / or module, and the processor 11 realizes various functions of the music rhythm detection device by running or executing the computer program and / or module stored in the memory, and calling the data stored in the memory. The memory 15 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory 15 can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (SecureDigital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0127] Wherein, if the module / unit integrated in the music rhythm detection device is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by a processor. Wherein, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form, etc. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media does not include electrical carrier signals and telecommunication signals.
[0128] A fourth embodiment of the present invention provides a computer-readable storage medium, which includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute the music rhythm detection method as described in any one of the first embodiments.
[0129] It should be noted that the device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, in the accompanying drawings of the device embodiments provided by the present invention, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines. A person of ordinary skill in the art may understand and implement it without paying any creative effort.
[0130] The above is a preferred embodiment of the present invention. It should be pointed out that a person skilled in the art can make several improvements and modifications without departing from the principle of the present invention. These improvements and modifications are also considered to be within the scope of protection of the present invention.
Claims
1. A music rhythm detection method, characterized in that: include: Acquire several frames of audio data of the music to be detected, and convert the several frames of audio data into spectrum data; Decomposing the frequency spectrum data of the plurality of frames to obtain amplitude spectra and phase spectra of the audio data of the plurality of frames; Calculate the predicted frequency spectrum of the current frame of audio data based on the amplitude spectrum and phase spectrum corresponding to the previous K frames of audio data; Calculate the target amplitude spectrum of the current frame audio data according to the frequency spectrum data corresponding to the current frame audio data and the predicted frequency spectrum data; Filtering the target amplitude spectrum to obtain a rhythm point of the current frame audio data; The step of calculating the predicted frequency spectrum of the current frame of audio data according to the amplitude spectrum and the phase spectrum corresponding to the previous K frames of audio data includes: According to the amplitude spectrum and phase spectrum corresponding to the previous K frames of audio data, the predicted spectrum of the current frame of audio data is calculated by formula (1); Where K = 2, M (i-1, m), Represents the amplitude spectrum and phase spectrum of the previous frame of audio data, represents the phase spectrum of the first two frames of audio data, fmod represents the remainder function; m is the number of audio points in a frame, m = 1, 2, ..., M; The step of calculating the target amplitude spectrum of the current frame audio data according to the spectrum data corresponding to the current frame audio data and the predicted spectrum data includes: The target amplitude spectrum of the current frame audio data is calculated by formula (2); Wherein, R(i, m), I(i, m) represent the real part and imaginary part of the spectrum data corresponding to the current frame audio data; Represents the real and imaginary parts of the predicted spectrum data corresponding to the current frame audio data.
2. The music rhythm detection method as claimed in claim 1, characterized in that: The filtering of the target amplitude spectrum to obtain the rhythm point of the current frame audio data includes: Performing filtering processing on the target amplitude spectrum at different delays to obtain filtering results at different delays; Determine the optimal delay based on the filtering results under different delays; Calculating a starting rhythm point according to the optimal delay and a filtering result corresponding to the optimal delay; The optimal delay is used as the rhythm cycle, and the rhythm point is obtained according to the starting rhythm point and the rhythm cycle.
3. The music rhythm detection method as claimed in claim 2, characterized in that: Determining the optimal delay according to the filtering results under different delays includes: The filtering results under different delays are summed up, and the delay corresponding to the maximum sum value is obtained as the optimal delay.
4. The music rhythm detection method as claimed in claim 1, characterized in that: The converting of the plurality of frames of audio data into spectrum data comprises: Performing sliding window frame processing on the audio data; Perform Fourier transform on the framed audio data to obtain the spectrum data.
5. The music rhythm detection method as claimed in claim 2, characterized in that: The calculating the starting rhythm point according to the optimal delay and the filtering result corresponding to the optimal delay includes: Calculate the starting rhythm point by formula (3); Among them, τ pre represents the optimal delay, y(i, τ pre ) is the filtering result corresponding to the optimal delay, and N represents the number of frames of audio data.
6. A music rhythm detection device, characterized in that: include: A spectrum conversion module, used to obtain a plurality of frames of audio data of the music to be detected, and convert the plurality of frames of the audio data into spectrum data; A spectrum decomposition module, used to decompose the spectrum data of several frames to obtain amplitude spectrum and phase spectrum of the audio data of several frames; The spectrum prediction module is used to calculate the predicted spectrum of the current frame audio data based on the amplitude spectrum and phase spectrum corresponding to the previous K frames of audio data; A target amplitude spectrum calculation module is used to calculate the target amplitude spectrum of the current frame audio data according to the spectrum data corresponding to the current frame audio data and the predicted spectrum data; A rhythm point calculation module, used for filtering the target amplitude spectrum to obtain the rhythm point of the current frame audio data; The step of calculating the predicted frequency spectrum of the current frame of audio data according to the amplitude spectrum and the phase spectrum corresponding to the previous K frames of audio data includes: According to the amplitude spectrum and phase spectrum corresponding to the previous K frames of audio data, the predicted spectrum of the current frame of audio data is calculated by formula (1); Where K = 2, M (i-1, m), Represents the amplitude spectrum and phase spectrum of the previous frame of audio data, represents the phase spectrum of the first two frames of audio data, fmod represents the remainder function; m is the number of audio points in a frame, m = 1, 2, ..., M; The step of calculating the target amplitude spectrum of the current frame audio data according to the spectrum data corresponding to the current frame audio data and the predicted spectrum data includes: The target amplitude spectrum of the current frame audio data is calculated by formula (2); Wherein, R(i, m), I(i, m) represent the real part and imaginary part of the spectrum data corresponding to the current frame audio data; Represents the real and imaginary parts of the predicted spectrum data corresponding to the current frame audio data.
7. A music rhythm detection device, characterized in that: The method comprises a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor implements the music rhythm detection method as described in any one of claims 1 to 5 when executing the computer program.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored computer program, wherein when the computer program is executed, the device where the computer-readable storage medium is located is controlled to execute the music rhythm detection method according to any one of claims 1 to 5.
