A method for extracting music rhythm features and optimizing lighting rhythm

By combining visual and auditory elements in music rhythm feature extraction, screening beat points and rhythm endpoints, and using a 1.7s detection cycle, the problem of high complexity and redundancy in beat extraction in the existing technology is solved, and a system suitable for Accurate rhythm point detection of lighting equipment improves visual effects.

CN118711569BActive Publication Date: 2024-10-29ZHEJIANG TOSPO AUTOMOTIVE LIGHTING CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411187786.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-28
Publication Date
2024-10-29
Estimated Expiration
2044-08-28

AI Technical Summary

Technical Problem

When the existing technology detects music rhythm points, the algorithm complexity is high and it is not suitable for lighting equipment, which results in redundant number of beat extractions, causing the lighting to change too fast and the visual effect to be poor.

Method used

By acquiring music file data, sampling, frame-by-frame windowing, and calculating short-term energy, combined with the comprehensive elements of human vision and hearing, the beat points and rhythm endpoints are screened out, and a 1.7s detection cycle is used to reduce the output frequency of the beat points and avoid Visual fatigue.

Benefits of technology

It achieves accurate detection of rhythm points based on the original music signal. The algorithm has low complexity, avoids redundancy in the number of beat extractions, and ensures the validity of the output data. It is suitable for lighting equipment, conforms to audio-visual perception, and is suitable for a variety of music formats.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118711569B_ABST
    Figure CN118711569B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for extracting music rhythm features to optimize lighting rhythm, comprising the following steps: obtaining music file data; sampling, framing and windowing the sample data, and calculating the short-time energy of each frame; performing beat point detection based on the short-time energy of each frame, and outputting the detection effect; performing rhythm endpoint detection based on the short-time energy of each frame, and outputting the detection effect; combining the comprehensive elements of human vision and hearing, screening out the beat points corresponding to the lighting changes, and outputting the detection effect. The present invention extracts music rhythm features based on the soft angle of human visual and auditory perception, which is more in line with people's visual and auditory perception; the present invention can accurately detect rhythm points based on the original music signal, and the algorithm complexity is low. While ensuring the accuracy of beat point extraction, it avoids the redundancy of the number of beat extractions, ensures the validity of the output data, and is suitable for the scene of music beat extraction in lighting equipment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of music rhythm feature extraction, and in particular relates to a method for extracting music rhythm features to optimize lighting rhythm. Background Art

[0002] In the environment of booming digital information industry, the dissemination of music has taken on a new form of digitalization. In order to improve the user experience of lighting products with music rhythm technology and enhance the visual effect of music, it is necessary to continuously improve the accuracy and real-time performance of music feature extraction. Among them, the rhythm feature of music is an important factor in the user's perception of the visual effect of music.

[0003] At present, there are many methods for extracting rhythm from music, and the detection effect also meets the requirements. However, for some technical products that need to be integrated, while taking into account the detection effect, the implementation method is also required to be as simple as possible and occupy as few resources as possible.

[0004] Therefore, a commonly used solution is to reduce the sampling rate according to the human ear's perception of the beat of music, so as to achieve beat detection and reduce the resource usage of the algorithm. However, this solution is suitable for audio devices containing DSP chips such as digital recorders, and has certain usage restrictions. Another method is to determine the rhythm point by judging the short-term energy size of the first three frames and the last two frames of the short-term energy signal. Although this solution can improve the detection accuracy of the rhythm point to a certain extent, the number of rhythm points extracted is too large. If applied to actual lighting products, it will cause the lighting to change too quickly and the visual effect will be poor. Summary of the invention

[0005] To solve the problems raised in the above background technology, the present invention provides a method for extracting music rhythm features to optimize lighting rhythm, which has the characteristics of being able to accurately detect rhythm points according to original music signals, having low algorithm complexity, and being suitable for scenes of music beat extraction in lighting devices.

[0006] To achieve the above object, the present invention provides the following technical solution: a method for extracting music rhythm features to optimize lighting rhythm, comprising the following steps:

[0007] 1. Obtaining music file data;

[0008] (ii) sampling the sample data, dividing the frames into windows, and calculating the short-time energy of each frame;

[0009] (iii) Perform beat point detection based on the short-term energy of each frame and output the detection result;

[0010] (iv) Perform rhythm endpoint detection based on the short-term energy of each frame and output the detection effect;

[0011] (V) Combine the comprehensive elements of human vision and hearing to select the beat points corresponding to the light changes and output the detection results.

[0012] Furthermore, in step (i), the method for obtaining music file data is: reading a music file in any format, obtaining dual-channel sample data x(n) of the music file and a sampling rate Fs of the data.

[0013] Furthermore, the formats of music files include but are not limited to AIFC, AIFF, AU, FLAC, OGG, OPUS, WAVE, MP3 and MPEG-4 AAC.

[0014] Furthermore, in step (ii), the dual-channel sample data x(n) is converted into single-channel data, a frame length of 200 and a frame shift of 80 are given, and a Hamming window is added to perform frame division and windowing on the signal.

[0015] Furthermore, the short-time energy of each frame is calculated. The short-time energy calculation formula is:

[0016] ;

[0017] Where h(n)=w(n) 2 , w(n) is the Hamming window function.

[0018] Furthermore, in step (iii), the method of beat point detection is:

[0019] The rhythm point is determined by comparing the short-time energy of the first three frames and the last two frames. If the first four frames satisfy the increasing trend and the last three frames gradually decrease, the short-time energy of the current frame satisfies the formula:

[0020] ;

[0021] Then judge E p The dot is the beat point.

[0022] Furthermore, in step (iv), the method of rhythm endpoint detection is:

[0023] The rhythm point is determined by comparing the short-time energy of the first three frames and the next frame. If the first four frames satisfy the decreasing trend and the next two frames gradually increase, the short-time energy of the current frame satisfies the formula:

[0024] ;

[0025] Then judge E d The point is the rhythm endpoint.

[0026] Furthermore, in step (V), the method for selecting the beat points corresponding to the light changes is:

[0027] (1) According to the characteristics of human ear's perception of music beats, the number of beats per minute in a song is between 45 and 180, that is, the period of a music beat is between 0.33s and 1.33s. However, it generally takes 2s for the human ear to sense the speed of the music beat. Therefore, setting the detection period within 2s can meet the needs of light changes.

[0028] (2) According to the effect of human eyes on light changes, consider the extreme case where there is a beat every 0.33s. If the detection beat cycle is set to detect once every 30ms, the corresponding light needs to change every 30ms. For the human eye's perception, the light changes too frequently and easily cause visual fatigue. The visual persistence time is generally considered to be 0.1~0.4s in science.

[0029] (3) Combining the two features of steps (1) and (2) and the periodicity of music beats, step (iv) uses 1.7s as the beat detection period, that is, a beat point is output every 1.7s. By screening out the rhythm endpoint E in each 1.7s period, d The corresponding points near the mean are the rhythm endpoints corresponding to the beat points.

[0030] Compared with the prior art, the present invention has the following beneficial effects:

[0031] 1. The present invention extracts the music rhythm features based on the actual lighting effects based on the soft angle of people's audio-visual perception, which is more in line with people's audio-visual perception;

[0032] 2. The present invention can accurately detect the rhythm points according to the original music signal, and the algorithm complexity is low. While ensuring the accuracy of beat point extraction, it avoids the redundancy of beat extraction and ensures the validity of output data. It is suitable for the scene of music beat extraction in lighting equipment;

[0033] 3. The present invention is applicable to various music formats on various platforms and has a wider scope of application. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:

[0035] Figure 1 is a flow chart of the present invention;

[0036] Figure 2 This is the effect diagram of the preliminary extraction of beat points of the present invention;

[0037] Figure 3This is the effect diagram of the preliminary extraction of rhythm endpoints of the present invention;

[0038] Figure 4 The effect diagram of the beat points is finally screened out for the present invention;

[0039] Figure 5 The effect diagram of finally selecting the rhythm endpoints for the present invention;

[0040] Figure 6 The present invention finally selects the effect diagram in which the beat points and the rhythm endpoints correspond one to one. DETAILED DESCRIPTION

[0041] 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.

[0042] Example 1

[0043] See also Figure 1-6 The present invention provides the following technical solution: a method for extracting music rhythm features and optimizing lighting rhythm, comprising the following steps:

[0044] (i) Read any music file, obtain the dual-channel sample data y of the music file and the sampling rate Fs of the data;

[0045] (ii) Convert the dual-channel sample data y into single-channel data x, and read out the signal length N. Calculate the time scale of the signal based on the single-channel data x and the sampling rate Fs; fix the frame length to 200 and the frame shift to 80. Considering that the Hamming window has the amplitude-frequency characteristic of large sidelobe attenuation, in order to reduce signal leakage, select the Hamming window as the window function, divide the signal into frames and add windows, and calculate the frame number fn; calculate the short-time energy En of each frame signal according to the short-time energy calculation formula;

[0046] (III) Perform beat point detection: Screen the short-time energy of each frame signal to find the signal that satisfies the energy of the current frame and the energy of the three frames before it, and the energy of the two frames after it; when the time scale remains unchanged, store the signal that meets the conditions as preliminary beat detection data E p ;

[0047] (IV) Perform beat endpoint detection: Screen the short-term energy of each frame signal to find the signal that satisfies the energy of the current frame and the energy of the three previous frames, and the energy of the next frame; store the signal that satisfies the conditions as the preliminary rhythm endpoint detection number E while keeping the time scale unchanged. d ;

[0048] (V) Perform period detection on the initially selected beat data, namely: first, the beat detection data E p The corresponding time scale is divided into M equal parts with an interval of 1.7s. When the last time interval does not meet 1.7s, the data is supplemented with 0. Secondly, the maximum value of the beat detection data Ep is selected at every 1.7s time interval. Finally, when the time scale remains unchanged, the beat data that meets the conditions is stored as the final beat detection data E p_new .

[0049] The rhythm endpoint data preliminarily screened is periodically detected, that is, first, the rhythm endpoint detection data E d The corresponding time scale is divided into M equal parts with an interval of 1.7s. When the last time interval does not meet 1.7s, the data is supplemented with 0. Secondly, every 1.7s time interval, the rhythm endpoint detection data E d Perform mean calculation, and calculate the absolute value of the difference between each data and the mean value in the same time interval, and find the minimum difference. Finally, when the time scale remains unchanged, store the rhythm endpoint data that meets the conditions as the final rhythm endpoint detection data E d_new .

[0050] Example 2

[0051] The practical effects of the present invention are described in detail below in conjunction with simulation.

[0052] (1) Simulation conditions

[0053] The song "Canon" is used. The whole song is 5 minutes long, a total of 300 seconds. The song is sampled, framed, and windowed. The short-term energy of each frame is calculated, and the beat point and rhythm endpoint detection are performed. In order to facilitate the observation of the extracted data effect, the first 0~9 seconds of the song are randomly selected in this example effect diagram.

[0054] (2) Simulation results

[0055] In this example, Figure 2 (a) is the original speech waveform of the song "Canon" from 0 to 9 seconds before, (b) is the short-time energy corresponding to the first 0 to 9 seconds of the song, and (c) is the effect of using the first three and last two method to determine the beat point. Figure 3 (a), (b) and Figure 2(a) and (b) are consistent, and (c) is the effect of using the first three and the last one method to determine the rhythm endpoint. Figure 2 , 3 It can be seen that although the accuracy of information collection is guaranteed, the collected data is too much. Directly applying the collected data to the actual lighting will cause the lighting to change too quickly, which is easy to cause visual fatigue.

[0056] Figure 4 (a) and (b) with Figure 2 (a) and (b) are consistent, and (c) is the effect of adding the beat data screened by the period detection mechanism after the beat points are extracted by the first three and the last two methods. Figure 5 (a) and (b) with Figure 2 (a) and (b) are the same, and (c) is the effect of adding the rhythm endpoints screened by the period detection mechanism after the first three methods and the last one method extract the rhythm endpoints. Figure 4 , 5 It can be seen that while ensuring that the high-energy part can be correctly screened out, unnecessary data points are reduced to ensure that the data is concise and effective.

[0057] further, Figure 6 (a) is the beat point effect finally screened out by the present invention, and (b) is the rhythm endpoint effect finally screened out by the present invention. Figure 6 It can be seen that the selected beat points correspond to the rhythm endpoints one by one. If applied to lighting, it can show a better effect and conform to people's audio-visual perception.

[0058] In summary, the present invention extracts music rhythm features based on the actual effects of lighting based on the soft angle of human audiovisual perception, which is more in line with people's audiovisual perception; the present invention can accurately detect rhythm points based on original music signals, and the algorithm complexity is low. While ensuring the accuracy of beat point extraction, it avoids the redundancy of beat extraction and ensures the validity of output data. It is suitable for the scenario of music beat extraction in lighting equipment; the present invention is suitable for multiple platforms and multiple music formats, and has a wider range of applications.

[0059] Finally, it should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art can still modify the technical solutions described in the aforementioned embodiments or replace some of the technical features therein by equivalents. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for extracting music rhythm features to optimize lighting rhythm, It is characterized in that The following steps are involved:

1. Obtaining music file data; (ii) sampling the sample data, dividing the frames into windows, and calculating the short-time energy of each frame; (iii) Perform beat point detection based on the short-term energy of each frame and output the detection result; (iv) Perform rhythm endpoint detection based on the short-term energy of each frame and output the detection result; (V) Combine the comprehensive elements of human vision and hearing to select the beat points corresponding to the light changes and output the detection results; In step (iii), the beat points are the first three and the last two to obtain the energy maximum point; in step (iv), the rhythm endpoints are the first three and the last one to obtain the energy minimum point.

2. A method for extracting music rhythm features and optimizing lighting rhythm according to claim 1, Features: In the step (i), the method for obtaining the music file data is: reading a music file in any format, obtaining the dual-channel sample data x(n) of the music file and the sampling rate Fs of the data.

3. A method for extracting music rhythm features and optimizing lighting rhythm according to claim 2, Features: The formats of the music files include but are not limited to AIFC, AIFF, AU, FLAC, OGG, OPUS, WAVE, MP3 and MPEG-4 AAC.

4. The method for extracting music rhythm features and optimizing lighting rhythm according to claim 2, Features: In the step (ii), the dual-channel sample data x(n) is converted into single-channel data, a frame length of 200 and a frame shift of 80 are given, a Hamming window is added, and the signal is framed and windowed.

5. A method for extracting music rhythm features and optimizing lighting rhythm according to claim 4, Features: Calculate the short-time energy of each frame. The short-time energy calculation formula is: ; Where h(n)=w(n) 2 , w(n) is the Hamming window function.

6. The method for extracting music rhythm features and optimizing lighting rhythm according to claim 1, Features: In the step (iii), the method of beat point detection is: The rhythm point is determined by comparing the short-time energy of the first three frames and the last two frames. If the first four frames satisfy the increasing trend and the last three frames gradually decrease, the short-time energy of the current frame satisfies the formula: ; Then judge E p The dot is the beat point.

7. The method for extracting music rhythm features and optimizing lighting rhythm according to claim 1, Features: In the step (iv), the method of rhythm endpoint detection is: The rhythm point is determined by comparing the short-time energy of the first three frames and the next frame. If the first four frames satisfy the decreasing trend and the next two frames gradually increase, the short-time energy of the current frame satisfies the formula: ; Then judge E d The point is the rhythm endpoint.

8. The method for extracting music rhythm features and optimizing lighting rhythm according to claim 1, Features: In the step (V), the method for selecting the beat points corresponding to the light changes is: (1) According to the characteristics of human ear's perception of music beats, the number of beats per minute in a song is between 45 and 180, that is, the period of a music beat is between 0.33s and 1.33s. However, it generally takes 2s for the human ear to sense the speed of the music beat. Therefore, setting the detection period within 2s can meet the needs of light changes. (2) According to the effect of human eyes on light changes, consider the extreme case where there is a beat every 0.33s. If the detection beat cycle is set to detect once every 30ms, the corresponding light needs to change every 30ms. For the human eye's perception, the light changes too frequently and easily cause visual fatigue. The visual persistence time is generally considered to be 0.1~0.4s in science. (3) Combining the two features of steps (1) and (2) and the periodicity of music beats, step (iv) uses 1.7s as the beat detection period, that is, a beat point is output every 1.7s. By screening out the rhythm endpoint E in each 1.7s period, d The corresponding points near the mean are the rhythm endpoints corresponding to the beat points.

Citation Information

Patent Citations

  • Quick solo music score recognizing method

    CN104217731A

  • Method for identifying states of high-voltage switch cabinets on basis of electric discharge sound

    CN106782505A