Music automatic selection method and music automatic selection device
By receiving pre-recorded background sounds and real-time ambient sounds, noise reduction and breathing frequency are generated to select appropriate music beats, the problem of inconvenient music selection during exercise is solved and the user's body rhythm smoothness is improved.
Patent Information
- Application Number
- CN202311855918.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-29
- Publication Date
- 2025-07-01
AI Technical Summary
During exercise, the user needs to select music by himself through the wearable device, which leads to inconvenience and affects the user's feelings.
The processor receives pre-recorded background sounds and real-time ambient sounds to generate noise reduction, detects breathing sounds in the noise reduction to generate breathing frequency, and selects the initial music based on the breathing frequency, so that the beats per minute of the music correspond to the breathing frequency.
It realizes automatic selection of suitable music during exercise, improving the smoothness of the user's body rhythm.
Smart Images

Figure CN120234440A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a method and apparatus for automatically selecting music, and more particularly to a method and apparatus for automatically selecting suitable music according to a breathing frequency. Background Art
[0002] With the rise of health awareness, exercise has become a way for the public to maintain health. To add fun to exercise, more and more users choose to exercise while listening to music. However, during exercise, users still need to select music by themselves through wearable devices, which is very inconvenient for users and will also affect the user experience. Summary of the Invention
[0003] In view of the deficiencies of the prior art, one of the objects of the present invention (but not limited to) is to provide a method and apparatus for automatically selecting music to improve the deficiencies of the prior art.
[0004] In some embodiments, the method for automatically selecting music includes: receiving a prerecorded background sound and a real-time ambient sound by a processor; generating a noise-reduced sound by the processor according to the prerecorded background sound and the real-time ambient sound; detecting a breathing sound in the noise-reduced sound by the processor to generate a breathing frequency; and selecting an initial music by the processor according to the breathing frequency, wherein the beats per minute of the initial music correspond to the breathing frequency.
[0005] In some embodiments, the apparatus for automatically selecting music includes a memory and a processor. The memory is used for storing a plurality of instructions. The processor is coupled to the memory and reads the instructions from the memory to perform the following steps: receiving a prerecorded background sound and a real-time ambient sound; generating a noise-reduced sound according to the prerecorded background sound and the real-time ambient sound; detecting a breathing sound in the noise-reduced sound to generate a breathing frequency; and selecting an initial music according to the breathing frequency, wherein the beats per minute of the initial music correspond to the breathing frequency.
[0006] The technical means embodied in the embodiments of the present invention can improve at least one of the disadvantages of the prior art. The present invention can analyze the breathing frequency of a user in real time through the apparatus and method for automatically selecting music, calculate the beats per minute of the music suitable for the current rhythm of the user, and automatically select appropriate music to provide to the user, so as to make the body rhythm of the user smoother.
[0007] The features, embodiments and technical effects of the present invention will be described in detail below with reference to the preferred embodiments in conjunction with the accompanying drawings. Brief Description of the Drawings
[0008] Figure 1Shows a schematic diagram of a music automatic selection device, a radio receiving device, an audio data input interface, an audio data output interface, and a broadcasting device according to some embodiments of the present invention;
[0009] Figure 2 Shows a schematic flowchart of a music automatic selection method according to some embodiments of the present invention;
[0010] Figure 3 Shows a schematic diagram of a prerecorded background sound according to some embodiments of the present invention;
[0011] Figure 4 Shows a schematic diagram of a prerecorded background sound according to some embodiments of the present invention;
[0012] Figure 5 Shows a schematic diagram of real-time ambient sound and noise reduction according to some embodiments of the present invention;
[0013] Figure 6 Shows a schematic diagram of real-time ambient sound according to some embodiments of the present invention; and
[0014] Figure 7 Shows a schematic diagram of noise reduction according to some embodiments of the present invention.
[0015] Explanation of reference numerals:
[0016] 100: Music automatic selection device 110: Processor 120: Memory
[0017] 200: Method 210 - 240: Steps 910: Radio receiving device
[0018] 920: Audio data input interface 930: Audio data output interface 940: Broadcasting device Detailed implementation manners
[0019] All the terms used in this application have their ordinary meanings. The definitions of the above terms in commonly used dictionaries, including examples of the use of any of the terms discussed herein, are only for illustration and should not limit the scope and meaning of the claims of the present invention. Similarly, the present invention is not limited only to the various embodiments shown in the examples.
[0020] Regarding the use of "coupled" or "connected" herein, it can refer to two or more elements being directly physically or electrically connected to each other, or indirectly physically or electrically connected to each other, and can also refer to two or more elements operating or acting on each other. As used herein, the term "circuit" can be a device formed by connecting at least one transistor and / or at least one passive or active element in a certain manner to process signals.
[0021] As used herein, the term "and / or" includes any combination of one or more of the listed related items. In this text, the first, second, third, etc. are used to describe and distinguish each element. Thus, the first element in this text can also be referred to as the second element without departing from the spirit of the present invention. For ease of understanding, similar elements in the various figures will be designated with the same reference numerals.
[0022] To address the problem in the prior art that users still need to use a wearable device to select music by themselves during exercise, which is very inconvenient for users and will also affect the user experience, the present invention proposes a music automatic selection device and a music automatic selection method. Details are described below.
[0023] Figure 1 Schematic diagram of a music automatic selection device 100, a radio device 910, an audio data input interface 920, an audio data output interface 930, and a broadcasting device 940 according to some embodiments of the present invention. As shown, the music automatic selection device 100 is coupled to the audio data input interface 920 and the audio data output interface 930, and the audio data input interface 920 and the audio data output interface 930 are respectively coupled to the radio device 910 and the broadcasting device 940.
[0024] In some embodiments, the music automatic selection device 100 includes a processor 110 and a memory 120. The memory 120 stores a plurality of instructions, and the processor 110 obtains a plurality of instructions from the memory 120 to execute the music automatic selection method 200 as Figure 2 shown.
[0025] Before the music automatic selection method 200 starts to execute, the processor 110 can control the radio device 910 to record a sound as a pre-recorded background sound according to the instructions. Please refer to Figure 3 , before exercise, the user can record Figure 3 the sound shown as the pre-recorded background sound. Basically, before exercise, the user's breathing sound is very weak, and the pre-recorded background sound generally includes the background sound of the user's location, such as the sound of a riverside park, the sound of a sports field, etc. For example, Figure 3 the sound has a sample rate of 24000Hz and 1024 samples per frame.
[0026] Subsequently, the processor 110 can convert the Figure 3 time-domain sound of Figure 4Frequency domain sound. For example, the processor 110 may employ a Modulated Discrete Cosine Transform (MDCT) to perform the conversion between the time domain and the frequency domain. Assuming there are K background noise frames, the formula for the time-averaged background audio spectrum is as follows:
[0027]
[0028] In Equation 1, is the time-averaged background audio spectrum. When b is 1, it is the magnitude spectrum, and when b is 2, it is the power spectrum.
[0029] The above pre-recorded background sound is mainly used to compare with the real-time ambient sound when the user is exercising. Subsequently, the pre-recorded background sound can be provided to the processor 110 through the audio data input interface 920.
[0030] Next, when the music automatic selection method 200 starts to execute, the processor 110 can control the sound collection device 910 to record the sound during exercise as the real-time ambient sound according to the instruction. For example, during exercise, the user can record the sound of exercise as the real-time ambient sound, and this real-time ambient sound basically includes the background sound and the breathing sound of the user during exercise. Please refer to Figure 5 . During exercise, the user can record Figure 5 the shown sound as the real-time ambient sound. Subsequently, the processor 110 can convert Figure 5 the time domain sound to Figure 6 the frequency domain sound. Similarly, the real-time ambient sound can be provided to the processor 110 through the audio data input interface 920.
[0031] Please also refer to Figure 1 and Figure 2 . In step 210, the pre-recorded background sound and the real-time ambient sound can be received through the processor 110. For example, when the user is exercising, the processor 110 can control the sound collection device 910 to record the real-time ambient sound during exercise according to the instruction, and provide the real-time ambient sound and the pre-recorded background sound together to the processor 110 through the audio data input interface 920, so that the processor 110 can perform subsequent processing.
[0032] In step 220, the processor 110 can generate noise reduction based on the pre-recorded background sound and the real-time ambient sound. For example, please refer to Figure 5, the processor 110 can subtract a certain proportion of pre-recorded background sound from the real-time ambient sound during exercise to obtain noise reduction. For detailed description, please refer to the following text.
[0033] y(m) = x(m) + n(m)… Formula 2
[0034] In Formula 2, under ideal conditions, y(m) is the real-time ambient sound in the time domain, x(m) is the breathing sound in the time domain, and n(m) is the pre-recorded background sound in the time domain. Subsequently, the formula for converting the time domain in Formula 2 to the frequency domain is Formula 3 as follows:
[0035] Y(f) = X(f) + N(f)… Formula 3
[0036] In Formula 3, Y(f) is the real-time ambient sound in the frequency domain, x(f) is the breathing sound in the frequency domain, and N(f) is the pre-recorded background sound in the frequency domain. Theoretically, the real-time ambient sound will be equal to the sum of the breathing sound and the background sound.
[0037] After arranging Formulas 2 and 3, the calculation formula for estimating the breathing sound is as follows:
[0038]
[0039] As shown in Formula 4, To estimate the breathing sound, |Y(f)| b is the real-time ambient sound, |N(f)| b is the pre-recorded background sound. It should be noted that generally, the real-time ambient sound |Y(f)| b will not be directly subtracted from the pre-recorded background sound |N(f)| b to obtain the estimated breathing sound otherwise it may cause distortion. The above estimated breathing sound can be referred to Figure 7 .
[0040] To obtain the breathing sound, the present invention sets the sensitivity S (sensitivity S) (dB) and the intensity value G (reduction gain G) (dB) according to Formula 4, and sets the following judgment formula:
[0041]
[0042] not noise, keep original bin value,
[0043] else
[0044] noise, reduce G for this bin,
[0045] As shown in formulas 5 to 7, the smaller the value of sensitivity S, the higher the value of |Y(f)| b The easier it is to be considered as a breath sound, conversely, the larger the value of sensitivity S, |Y(f)| b The more likely it is to be considered background sound.
[0046] Refer to Formula 7. Assuming that this frequency band is considered to have background sound, the recorded real-time ambient sound |Y(f)| b Subtract the intensity value G. At this point, To reduce the noise, the processor 110 converts the real-time ambient sound during exercise |Y(f)| b Subtract the intensity value G, which is proportional to the pre-recorded background sound. Then, the breathing sound can be obtained from the noise reduction, as described below.
[0047] In step 230, the processor 110 may detect the breathing sound in the noise reduction to generate the breathing frequency. For example, to obtain the breathing frequency of the user, the processor 110 may detect the breathing sound of the user from the noise reduction, and then calculate the breathing frequency from the breathing sound. Figure 5 There are multiple noise reduction sounds with larger amplitudes, and these noise reduction sounds with larger amplitudes are the exhalation sounds S in the user's breathing sounds. It can be seen that the user's breathing sounds can be obtained more accurately through the above processing. The detailed calculation method of the breathing sounds is described below.
[0048]
[0049]
[0050] In formula 8, E(t) is the current frame energy, fs is the sampling rate, In formula 9, AvgPreE(t) is the average of the previous frame energy (Average of Previous FrameEnergy). Assuming a given M value, if the current frame energy E(t) is greater than the average of the previous frame energy AvgPreE(t)×M, it means that a breathing sound is detected at time t.
[0051] As described above, assume that breath sounds are detected in sequence at time points t1, t2, and t3. The breath interval P1 between time points t1 and t2 is 44 frames, and the breath interval P2 between time points t2 and t3 is 45 frames. It can be seen that the difference between the breath interval P1 and the breath interval P2 is only 1 frame, which is very small, indicating that the user's breathing is basically stable. It should be noted that the present invention can set a preset difference. If the difference between the breath intervals is lower than the preset difference, it means that the user's breathing is stable. For example, the preset difference of the present invention can be 2 frames. According to the above embodiment, since the difference between the breath interval P1 and the breath interval P2 is only 1 frame, which is lower than the preset difference of 2 frames of the present invention, it can be seen that the user's breathing is stable.
[0052] As described above, since the user's breathing is stable, the single breath time of the user can be calculated at this time. The formula is as follows:
[0053]
[0054] As shown in Formula 10, Tb is the single breath time, P1 and P2 are the breath intervals, fsize is the frame length, and fs is the sampling rate. Assume that the breath interval P1 is 44 frames, the breath interval P2 is 45 frames, fsize is 1024, and fs is 24000 Hz. Then the single breath time Tb is approximately 1.9 seconds. The number of breaths per minute represents the number of breaths that can be completed within one minute. Therefore, if you want to calculate the breathing rate, you can divide 60 seconds by the time required for each breath. After conversion, the breathing rate is approximately 31.6 times per minute.
[0055] In step 240, the processor 110 can select the initial music according to the breathing rate, and the number of beats per minute of the above initial music corresponds to the breathing rate. For example, the processor 110 can calculate the number of music beats suitable for the user's current rhythm by analyzing the user's breathing rate in real time, and automatically select the appropriate music to provide to the user, so as to make the user's body rhythm smoother.
[0056] Generally speaking, an adult will breathe about 12 to 20 times per minute under calm conditions. Therefore, the breathing rate of an adult is 12 to 20 times per minute. During exercise, the breathing rate of an adult will increase and will increase to different breathing rates according to the intensity of different exercises. On average, the breathing rate of an adult during exercise is 30 times per minute. According to the above embodiments, a breathing rate of 31.6 times per minute means that the user performs a total of 31.6 cycles of exhalation and inhalation per minute. If the number of exhalations and inhalations is all calculated, the total number of exhalations and inhalations of the user per minute is about 63 times per minute. Accordingly, the music automatic selection device 100 and the music automatic selection method 200 of the present invention can automatically select an initial music with a beats per minute (BPM) of about 63 times and provide it to the user. Since the beats of the initial music are equivalent to the total number of exhalations and inhalations of the user, it is very suitable for the user's current rhythm, thus making the user's body rhythm smoother.
[0057] In some embodiments, the beats per minute of the initial music selected by the music automatic selection device 100 and the music automatic selection method 200 of the present invention is approximately equal to twice the breathing rate. For example, if the breathing rate of the user is calculated to be 30 times per minute, then the beats per minute of the selected initial music is 60 times. Similarly, if the breathing rate of the user is calculated to be 35 times per minute, then the beats per minute of the selected initial music is 70 times. If the breathing rate of the user is calculated to be 40 times per minute, then the beats per minute of the selected initial music is 80 times, and so on.
[0058] In some embodiments, the beats per minute of the initial music selected by the music automatic selection device 100 and the music automatic selection method 200 of the present invention is between twice the breathing rate and four times the breathing rate. For example, if the breathing rate of the user is calculated to be 30 times per minute, in addition to selecting an initial music with a beats per minute of 60 times equivalent to the number of exhalations and inhalations of the user for the user to exercise, according to the preferences of different users, for example, if the user prefers a faster rhythm, an initial music with a beats per minute of 120 times can be selected for the user to exercise. Similarly, if the breathing rate of the user is calculated to be 35 times per minute, the beats per minute of the selected initial music can be 140 times. If the breathing rate of the user is calculated to be 40 times per minute, the beats per minute of the selected initial music can be 160 times, and so on.
[0059] In one embodiment, the processor 110 may adjust the initial music to the target music according to an adjustment signal, and the beats per minute (BPM) of the target music is equal to the BPM of the initial music plus a preset number of beats. For example, the processor 110 may obtain instructions from the memory 120 to execute an application program (APP). When the user wants to increase the exercise speed, the user may input a speed-up signal through the application program. The processor 110 may select the target music with a BPM 5 beats higher than that of the initial music according to the speed-up signal. For example, if the BPM of the initial music is 60 beats per minute, the processor 110 may select the target music with a BPM of 65 beats per minute, so that the user can increase the exercise speed according to the target music with a higher BPM. However, the present invention is not limited to the above embodiment, which is only used to exemplarily show one implementation manner of the present invention to make the technology of the present invention easy to understand. In other embodiments, the processor 110 may also select the target music with a BPM 10 beats, 15 beats, 20 beats, etc. higher than that of the initial music, which should be determined according to actual needs.
[0060] In one embodiment, the processor 110 may adjust the initial music to the target music according to an adjustment signal, and the BPM of the target music is equal to the BPM of the initial music minus a preset number of beats. For example, the processor 110 may obtain instructions from the memory 120 to execute the application program. When the user wants to decrease the exercise speed, the user may input a speed-down signal through the application program. The processor 110 may select the target music with a BPM 5 beats lower than that of the initial music according to the speed-down signal. For example, if the BPM of the initial music is 60 beats per minute, the processor 110 may select the target music with a BPM of 55 beats per minute, so that the user can decrease the exercise speed according to the target music with a lower BPM. However, the present invention is not limited to the above embodiment, which is only used to exemplarily show one implementation manner of the present invention to make the technology of the present invention easy to understand. In other embodiments, the processor 110 may also select the target music with a BPM 10 beats, 15 beats, 20 beats, etc. lower than that of the initial music, which should be determined according to actual needs.
[0061] In one embodiment, the music automatic selection device 100 and the music automatic selection method 200 of the present invention can be applied to various consumer electronic products such as mobile phones, tablets, wearable devices, etc. In addition, the present invention is not limited to Figures 1 to 7 the embodiments shown, which are only used to exemplarily show one implementation manner of the present invention to make the technology of the present invention easy to understand. The protection scope of the claims of the present invention shall be subject to the protection scope of the claims of the present invention. Those skilled in the art, without departing from the spirit of the present invention, the modifications and retouches made to the embodiments of the present invention still fall within the protection scope of the claims of the present invention.
[0062] In summary, the present invention can analyze the user's breathing frequency in real time through the music automatic selection device and the music automatic selection method, calculate the number of music beats suitable for the user's current rhythm, and automatically select appropriate music to provide to the user, so as to make the user's body rhythm smoother.
[0063] Although the embodiments of the present invention are as described above, these embodiments are not intended to limit the present invention. Those skilled in the art with ordinary knowledge in this technical field can change the technical features of the present invention according to the explicit or implicit content of the present invention, and these changes all fall within the scope of patent protection sought by the present invention. In other words, the protection scope of the present invention should be defined according to the protection scope of the claims of the present invention.
Claims
1. A method for automatic music selection, comprising: Receiving a pre-recorded background sound and a real-time ambient sound through a processor; Generating a noise reduction sound by the processor according to the pre-recorded background sound and the real-time ambient sound; Detecting a breathing sound in the noise reduction sound by the processor to generate a breathing frequency; and Selecting an initial music by the processor according to the breathing frequency, wherein the beats per minute of the initial music corresponds to the breathing frequency.
2. The music automatic selection method according to claim 1, characterized in that, The beats per minute of the initial music is approximately equal to twice the breathing frequency.
3. The music automatic selection method according to claim 1, characterized in that, The beats per minute of the initial music is between twice the breathing frequency and four times the breathing frequency.
4. The music automatic selection method according to any one of claims 1 to 3, characterized in that, Further comprising: Adjusting the initial music to a target music by the processor according to an adjustment signal, wherein the beats per minute of the target music is equal to the beats per minute of the initial music plus a preset number of beats.
5. The music automatic selection method according to any one of claims 1 to 3, characterized in that Further comprising: Adjusting the initial music to a target music by the processor according to an adjustment signal, wherein the beats per minute of the target music is equal to the beats per minute of the initial music minus a preset number of beats.
6. An apparatus for automatic music selection, comprising: A memory for storing a plurality of instructions; A processor coupled to the memory and reading the plurality of instructions from the memory to perform the following steps: Receiving a pre-recorded background sound and a real-time ambient sound; Generating a noise reduction sound according to the pre-recorded background sound and the real-time ambient sound; Detecting a breathing sound in the noise reduction sound to generate a breathing frequency; and Selecting an initial music according to the breathing frequency, wherein the beats per minute of the initial music corresponds to the breathing frequency.
7. The music automatic selection device according to claim 6, characterized in that, The beats per minute of the initial music is approximately equal to twice the breathing frequency.
8. The music automatic selection device according to claim 6, wherein, The beats per minute of the initial music is between twice the breathing frequency and four times the breathing frequency.
9. The music automatic selection device according to any one of claims 6 to 8, characterized in that The processor further reads the plurality of instructions from the memory to perform the following steps: Adjusting the initial music to a target music according to an adjustment signal, wherein the beats per minute of the target music is equal to the beats per minute of the initial music plus a preset number of beats.
10. The music automatic selection device according to any one of claims 6 to 8, characterized in that, The processor further reads the plurality of instructions from the memory to perform the following steps: Adjusting the initial music to a target music according to an adjustment signal, wherein the beats per minute of the target music is equal to the beats per minute of the initial music minus a preset number of beats.