A personalized music therapy system based on brainwave modulation
By collecting and decomposing brainwave signals, a five-dimensional emotional feature vector and a three-dimensional emotional dynamic feature are constructed to generate personalized music therapy signals. This solves the problem of real-time adjustment in existing technologies, achieves highly personalized and real-time emotional guidance, and enhances the effect of music therapy.
Patent Information
- Application Number
- CN202411664154.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-20
- Publication Date
- 2025-12-02
- Estimated Expiration
- 2044-11-20
AI Technical Summary
Existing music therapy techniques cannot be personalized according to the user's real-time emotional state, lack an emotional feedback mechanism, and are difficult to adjust the music content in a timely manner when emotions change, resulting in poor therapeutic effects.
By collecting and decomposing brainwave signals, a five-dimensional emotional feature vector and a three-dimensional emotional dynamic feature are constructed to generate personalized music therapy signals. The frequency, rhythm and harmonic structure of the music are adjusted in real time to match the user's emotional state at different times.
It achieves highly personalized and real-time emotional guidance, providing adaptive musical feedback instantly when the user's emotions change, enhancing the effect and duration of music therapy, and meeting the individualized needs of users.
Smart Images

Figure CN119607362B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to, but is not limited to, the field of signal processing technology, and in particular to a personalized music therapy system based on brainwave modulation. Background Technology
[0002] This invention, "A Personalized Music Therapy System Based on Brainwave Regulation," aims to provide users with highly personalized music therapy services by utilizing real-time acquisition and analysis of brainwave signals to meet their needs for relaxation, regulation, and soothing in different emotional states. Currently, music therapy, as a non-drug intervention, is widely used to reduce stress, improve mood, and enhance concentration. Existing music therapy techniques mainly focus on standard music playback, frequency resonance therapy, and music for emotional self-regulation. However, significant shortcomings remain in existing technologies, primarily in terms of real-time performance, personalization, and dynamic emotional adaptation.
[0003] Firstly, regarding standard music playback, the market offers numerous music therapy products designed for specific emotions or psychological states. For example, some apps provide playlists with different functions such as relaxation, meditation, and calming. However, most of these systems rely on pre-recorded music content and cannot generate or adjust music content in real time based on the user's current emotional state. Users still need to choose suitable music based on personal preferences, past experiences, or human recommendations. However, emotional states are dynamic, and the effectiveness of music therapy may be affected by changes in the user's environment and psychological reactions. Existing standard music therapy methods often lack specificity when facing subtle changes in a user's emotions, making it difficult to achieve optimal therapeutic effects. Furthermore, fixed music content is poorly adaptable to changes in user emotions and lacks an emotional feedback mechanism, making it impossible to adjust the music content in a timely manner to maintain the continuity of the therapeutic effect. Secondly, frequency resonance therapy, as another popular music therapy method, introduces specific frequency sounds into the user's auditory or physical resonance system to relieve anxiety and relax the mind and body. This type of therapy is typically based on specific frequencies, such as alpha waves and theta waves, which are associated with the brain's natural fluctuations and are believed to help people enter a state of relaxation or deep meditation through resonance. While such therapies do have a certain relaxing effect, they often target specific frequencies and do not comprehensively consider the user's real-time emotional state and fluctuations. Furthermore, frequency resonance therapy relies heavily on continuous input of a specific frequency, making it difficult to adjust to the user's individual emotional needs. For users with significant emotional fluctuations, a single frequency may be effective in one emotional state, but may be ineffective or lacking in other emotional states. Summary of the Invention
[0004] This disclosure provides a personalized music therapy system based on brainwave modulation. Through real-time, personalized, intelligent, and refined design, this system achieves more efficient, stable, and effective music therapy results. The system can dynamically adjust the frequency, rhythm, and harmonic structure of music using brainwave signals as input to match the user's emotional state at different times, thereby providing continuous and deep emotional guidance and soothing effects.
[0005] To solve the above problems, the technical solution of the present invention is implemented as follows:
[0006] A personalized music therapy system based on brainwave modulation is disclosed. The system comprises: a brainwave signal acquisition and decomposition unit, an emotion feature processing unit, and a music therapy signal generation unit. The brainwave signal acquisition and decomposition unit acquires brainwave signals, performs multi-scale decomposition by combining the brainwave signals with wavelet basis functions of different brainwave signal frequency bands, obtains the signal decomposition results, and calculates a standardized brainwave energy density based on the signal decomposition results. The emotion feature processing unit constructs a five-dimensional emotion feature vector based on the signal decomposition results and the standardized brainwave energy density; extracts dynamic emotion features based on the five-dimensional emotion feature vector to obtain three-dimensional dynamic emotion features. The music therapy signal generation unit maps music fundamental parameters based on the five-dimensional emotion feature vector and the three-dimensional dynamic emotion features to generate a music fundamental parameter vector; generates a harmonic structure based on the three-dimensional dynamic emotion features to obtain a harmonic frequency response; and generates a music temporal structure based on the harmonic frequency response to obtain the final generated therapy music signal.
[0007] Furthermore, brainwave signal frequency bands include: delta band, theta band, alpha band, beta band, and gamma band.
[0008] Furthermore, the brainwave signal acquisition and decomposition unit performs multi-scale decomposition of the brainwave signal using the following formula to obtain the signal decomposition result X(f,t):
[0009]
[0010] Where n is the integer subscript index; t′ is the time integration variable; t is time; a n The time scale factor corresponds to the period of the brainwave signal frequency band; a1 = 0.5 seconds, corresponding to the delta band; a2 = 0.167 seconds, corresponding to the theta band; a3 = 0.1 seconds, corresponding to the alpha band; a4 = 0.05 seconds, corresponding to the beta band; a5 = 0.025 seconds, corresponding to the gamma band; f nHere are the center frequencies of each brainwave signal band: f1 = 2 Hz, corresponding to the center frequency of the delta band; f2 = 6 Hz, corresponding to the center frequency of the theta band; f3 = 10 Hz, corresponding to the center frequency of the alpha band; f4 = 2 Hz, corresponding to the center frequency of the beta band; f5 = 40 Hz, corresponding to the center frequency of the gamma band; σ n σt represents the energy attenuation width of each brainwave signal frequency band; σ1 = 1 Hz, corresponding to the energy attenuation width of the delta band; σ2 = 2 Hz, corresponding to the energy attenuation width of the theta band; σ3 = 2.5 Hz, corresponding to the energy attenuation width of the alpha band; σ4 = 8.5 Hz, corresponding to the energy attenuation width of the beta band; σ5 = 20 Hz, corresponding to the energy attenuation width of the gamma band; S(t) is the brainwave signal, S(t′) is the brainwave signal in integral form; f is the frequency; ψ n (·) represents the wavelet basis function of the nth frequency band.
[0011] Furthermore, the brainwave signal acquisition and decomposition unit calculates the standardized brainwave energy density D(f, t) based on the signal decomposition results using the following formula:
[0012]
[0013] Where Δf is the width of the frequency integration window, ranging from 1Hz to 3Hz; f′ is the frequency integration variable; and |·| is the amplitude operator.
[0014] Furthermore, the emotion feature processing unit, based on the signal decomposition results and standardized brainwave energy density, constructs a five-dimensional emotion feature vector E(t), which is expressed as follows:
[0015]
[0016] Among them, E1(t) is the relaxation-tension dimension element; E2(t) is the focus-distraction dimension element; E3(t) is the stability-fluctuation dimension element; E4(t) is the coordination-chaos dimension element; E5(t) is the harmony-imbalance dimension element; Phase(·) is the phase extraction function; Sync(·) is the synchronicity calculation function.
[0017] Furthermore, the emotion feature processing unit extracts the dynamic emotion features using the following formula to obtain the dynamic emotion feature Φ(t):
[0018]
[0019] Where Φ1(t) is the cumulative amount of emotion intensity; Φ2(t) is the rate of change of emotion; Φ3(t) is the rate of change of emotion complexity; ||·||1 is the L1 norm operation; ||·||2 is the L2 norm operation; and E(t′) is the integral form of the five-dimensional emotion feature vector E(t).
[0020] Furthermore, the music therapy signal generation unit generates a music fundamental parameter vector M(t) by mapping music fundamental parameters based on a five-dimensional emotion feature vector and three-dimensional emotion dynamic features using the following formula:
[0021]
[0022] Among them, f b A(t) is the fundamental frequency, based on the standard pitch of 440Hz; A(t) is the amplitude envelope; T(t) is the velocity, in BPM, ranging from 60 to 180.
[0023] Furthermore, the music therapy signal generation unit generates a harmonic structure based on the three-dimensional emotional dynamic characteristics using the following formula, to obtain the harmonic frequency response H(f,t):
[0024]
[0025] B(t) = B 0· (1+Φ2(t));
[0026] σ h (t)=2+3Φ3(t);
[0027] Among them, c j (t) represents the j-th harmonic coefficient; B(t) represents the harmonic bandwidth function; σ h (t) represents the harmonic broadening factor; B0 is the harmonic fundamental bandwidth, which is a set value; j is the integer subscript index.
[0028] Furthermore, the music therapy signal generation unit generates a music temporal structure based on the harmonic frequency response using the following formula to obtain the final generated therapy music signal:
[0029]
[0030] Where S(t) is the final generated healing music signal; W(f,t) is the time-varying modulation window function; g i (·) represents the Sigmoid modulation function; i is the integer subscript index; k i denoted as the modulation slope coefficient, where k1 = 2.0, k2 = 1.5, k3 = 1.0; x0 is the modulation midpoint with a value of 0.5.
[0031] This invention discloses a personalized music therapy system based on brainwave modulation, which has the following beneficial effects: Firstly, this invention boasts extremely high real-time performance. Through the acquisition and multi-dimensional analysis of brainwave signals, the system can quickly and accurately acquire the user's immediate emotional state information. Unlike traditional music therapy techniques that require users to actively select music or rely on pre-set music content, this system, by monitoring brainwave signals such as delta waves, theta waves, and alpha waves in real time, can complete the identification and analysis of emotional states in a very short time. Combining multi-dimensional emotional feature vectors and dynamic emotional feature extraction algorithms, the system can accurately capture emotional fluctuations, allowing the generated music content to be adjusted in real time according to the user's emotional changes, achieving a closed-loop feedback between "emotion" and "music," thus providing adaptive music feedback the moment the user's emotions change. Through this real-time design, users can immediately receive emotional guidance and relief from music when experiencing emotional fluctuations or changes in psychological state, helping to reduce anxiety, relax the mind, and alleviate stress, among other psychological therapeutic effects. Secondly, this invention possesses the advantage of high personalization. Traditional music therapy is often based on fixed music playlists or simple frequency adjustments, making it difficult to fully consider each user's unique emotional responses and individual needs. This invention generates unique emotional feature maps for each user through multidimensional feature extraction and analysis based on brainwave signals. Whenever a user enters a different emotional state, the system generates personalized music content based on that state, including real-time adjustments to key parameters such as fundamental frequency, rhythm, and amplitude envelope, ensuring a high degree of match between the music and the user's emotion. Simultaneously, the system further refines the control over the sonic quality by dynamically adjusting the bandwidth, broadening factor, and center frequency of the harmonic frequency response. This allows the music to not only meet the user's emotional needs in terms of frequency and rhythm but also provide more nuanced emotional support in terms of sound texture and atmosphere. Such personalized settings help users enter a deeper healing state, thereby enhancing the effectiveness and longevity of music therapy. Attached Figure Description
[0032] Figure 1 This is a schematic diagram of the system structure of a personalized music therapy system based on brainwave modulation, provided as an embodiment of the present invention. Detailed Implementation
[0033] To make the technical problems, technical solutions, and beneficial effects to be solved by this disclosure clearer and more understandable, the disclosure will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of this disclosure and are not intended to limit this disclosure.
[0034] Example 1, Reference Figure 1A personalized music therapy system based on brainwave modulation is disclosed. The system comprises: a brainwave signal acquisition and decomposition unit, an emotion feature processing unit, and a music therapy signal generation unit. The brainwave signal acquisition and decomposition unit acquires brainwave signals, performs multi-scale decomposition by combining the brainwave signals with wavelet basis functions of different brainwave signal frequency bands, obtains the signal decomposition results, and calculates a standardized brainwave energy density based on the signal decomposition results. The emotion feature processing unit constructs a five-dimensional emotion feature vector based on the signal decomposition results and the standardized brainwave energy density; extracts dynamic emotion features based on the five-dimensional emotion feature vector to obtain three-dimensional dynamic emotion features. The music therapy signal generation unit maps music fundamental parameters based on the five-dimensional emotion feature vector and the three-dimensional dynamic emotion features to generate a music fundamental parameter vector; generates a harmonic structure based on the three-dimensional dynamic emotion features to obtain a harmonic frequency response; and generates a music temporal structure based on the harmonic frequency response to obtain the final generated therapy music signal.
[0035] Specifically, this personalized music therapy system based on brainwave modulation accurately converts the user's emotional state into a personalized music therapy plan by collecting the user's brainwave signals in real time, achieving meticulous regulation of the user's emotions. The system comprises a brainwave signal acquisition and decomposition unit, an emotional feature processing unit, and a music therapy signal generation unit. Each unit is responsible for the core steps from brainwave signal acquisition to emotional feature extraction and music therapy signal generation, ultimately forming a real-time adaptive music therapy system. The system is first activated by the brainwave signal acquisition and decomposition unit, which collects the user's raw brainwave signals through an EEG sensor device. Brainwave signals are complex time-series data containing many frequency bands, such as δ, θ, α, β, and γ, which correspond to different psychological and physiological states of the user. Therefore, to accurately extract emotional information, the system performs multi-band decomposition of the brainwave signal using specific wavelet basis functions, separating the raw signal into components of different frequency bands, thus preserving its temporal and frequency characteristics. In this process, the application of wavelet basis functions is the core technology. Traditional signal processing often relies on Fourier transform, which loses time information when extracting frequency domain features. Wavelet transform, on the other hand, has excellent time-frequency localization characteristics, allowing for flexible adjustment of the time scale for different frequency bands, thus capturing signal features more accurately in frequency bands such as δ, θ, and α. Specifically, the system selects wavelet basis functions that match the characteristics of each frequency band. By controlling the time scale factor of the wavelet basis functions, it maximizes their response capability in specific frequency bands, thereby ensuring the accuracy and stability of signal decomposition.
[0036] Furthermore, the system further reduces interference from non-target frequency band signals through spectral energy smoothing. A Gaussian attenuation function is used to attenuate frequency features, concentrating the energy of each frequency band primarily near the center frequency, while signal energy further away from the center frequency gradually decreases. After this processing, the system obtains signal decomposition results with concentrated frequency characteristics, providing a solid foundation for subsequent emotion feature extraction. Next, the system calculates the energy density of the decomposition results and standardizes it to obtain standardized brainwave energy density. Standardization ensures that the energy density of each frequency band can participate fairly in the emotion feature extraction process. Through normalization, the system can effectively eliminate interference caused by uneven energy distribution across frequency bands, thereby improving the accuracy and robustness of emotion recognition. Based on the standardized brainwave energy density, the emotion feature processing unit further constructs a five-dimensional emotion feature vector. The five dimensions of this emotion feature vector correspond to the user's main emotional states, including relaxed-tense, focused-distracted, stable-fluctuating, coordinated-disorganized, and harmonious-unbalanced. These dimensions are constructed through comprehensive analysis of frequency and temporal features, thereby extracting key emotional features from complex brainwave data.
[0037] For example, in a relaxed state, users typically exhibit enhanced delta and theta waves, while in a tense state, they exhibit higher beta and gamma waves. By combining these frequency band features, the system can derive accurate emotional characteristics. Constructing an emotional feature vector is not limited to the static features of the signal; the system also considers the dynamic changes in user emotions. Therefore, based on the emotional feature vector, the system further extracts dynamic emotional features. The emotional dynamic feature vector contains three main components: the cumulative intensity of emotion, the rate of change of emotion, and the rate of change of emotion complexity. These three components respectively characterize the cumulative intensity, rate of change, and complexity changes of the user's emotion within the current time period. This design fully considers the dynamic attributes of emotions, enabling the system to respond to changes in user emotions in real time. For example, when detecting a continuous accumulation of emotional intensity, the system can gradually alleviate the user's emotions by adjusting parameters such as music volume and rhythm, thereby achieving a deep healing effect. The emotional feature processing unit not only statically models the user's emotional state but also further captures the dynamic trends of user emotions, enabling the system's music generation to adapt to subtle emotional fluctuations in real time. After acquiring emotional and dynamic features, the music therapy signal generation unit maps them to fundamental music parameters. These parameters, including frequency, amplitude, and tempo, are crucial for matching music to emotions. To better suit emotional needs, the system maps emotional feature vectors and emotional dynamic feature vectors to frequency, rhythm, and volume, respectively. For example, when a user is tense and unstable, the system automatically reduces the music's tempo and adjusts its frequency to make the music softer and more relaxing.
[0038] In this parameter mapping process, the system transforms information in the emotional dimension into specific parameters of the music signal through a certain mapping function, ensuring a synchronous match between emotional state and music attributes. After generating the basic music parameters, the system further generates a harmonic structure. Harmonic structure generation is based on different harmonic frequency responses, using multi-layered frequency superposition to give the music signal rich harmony in frequency and time. This multi-harmonic frequency response not only enhances the layering of the music but also enables it to generate deep resonance, strengthening the user's healing experience. Harmonic structure generation, by superimposing multiple harmonic components, gives the music signal higher frequency resolution and can automatically adjust the harmonic distribution under different emotional states, providing users with a continuous emotional regulation effect. Finally, based on the generated harmonic structure, the system uses a temporal structure generation module to form the final music therapy signal. Temporal structure generation, through a time-varying modulation function, ensures the continuity of the music signal in time and frequency, allowing the music to smoothly transition and remain adapted to the user's current emotional state. Through a series of adjustments to frequency, time, and amplitude, the music signal generation process not only follows the guidance of emotional characteristics but also possesses adaptability. This allows for smooth parameter control of the music amidst dynamic emotional changes, avoiding discomfort caused by sudden rhythm or volume changes. In summary, the personalized music therapy system based on brainwave modulation, using brainwave signals as its foundation, achieves accurate identification and real-time response to user emotions through multi-step decomposition, feature extraction, and dynamic parameter generation. Unlike traditional music therapy systems, this system not only achieves higher resolution in emotion recognition but also closely links emotional changes with music attributes through multi-level parameter mapping, achieving personalized and real-time music therapy effects. This innovative brainwave modulation method breaks through the limitations of traditional therapy systems that rely solely on static music for relaxation, truly dynamically adjusting the music according to the user's real-time emotional state, thereby providing a deeper emotional healing experience.
[0039] Example 2: Brainwave signal frequency bands include: delta band, theta band, alpha band, beta band and gamma band.
[0040] Specifically, the delta wave band typically refers to the frequency range of 0.5 to 4 Hz. Brainwave activity in this band is usually associated with deep sleep and recovery processes. High-intensity delta wave activity is common in unconscious states, such as deep sleep or coma, representing rest and recovery of the body and brain. Therefore, when the system detects high delta waves, it may indicate that the user is in a state of deep relaxation or unconsciousness, suitable for generating soothing, low-frequency music to maintain relaxation. The theta wave band is typically between 4 and 8 Hz. Brainwave activity in this band is associated with meditation, light sleep, and relaxation. High-intensity theta wave activity indicates a relaxed but alert state, often occurring during dreaming or deep meditation. This state suggests that the user may be emotionally relaxed but not fully conscious, suitable for soft, gradual music to maintain this calm state. The alpha wave band ranges from 8 to 13 Hz and is associated with relaxed, calm, and stable emotional states. Alpha waves typically appear when resting with eyes closed, meditating, or in a relaxed state, indicating that the user is in a state of conscious relaxation. When high alpha waves are detected, it indicates that the user may be in a balance between relaxation and focus. The generated music can be adjusted to a moderate tempo and volume to help the user maintain a comfortable state. Beta waves typically refer to the frequency range between 13 and 30 Hz and are associated with daily alertness, focus, and high-intensity mental activity. High-intensity beta waves indicate that the user is alert, focused, or anxious. Increased beta waves are usually accompanied by improved focus but may also lead to increased anxiety or stress. When high beta waves are detected, the system can generate soothing music to help the user relax and reduce tension and anxiety. Gamma waves are frequencies above 30 Hz and are typically associated with high levels of cognitive processing, complex thinking, and conscious activity. Gamma waves represent the brain's active state when processing complex information, commonly seen during high-intensity learning, information integration, or rapid decision-making. Increased gamma wave activity may indicate that the user is in a state of high concentration and cognitive activity. The system can use relatively high-frequency, slightly faster-paced music to maintain or enhance the user's cognitive abilities.
[0041] Example 3: The brainwave signal acquisition and decomposition unit performs multi-scale decomposition on the brainwave signal using the following formula to obtain the signal decomposition result X(f,t):
[0042]
[0043] Where n is the integer subscript index; t′ is the time integration variable; t is time; a n The time scale factor corresponds to the period of the brainwave signal frequency band; a1 = 0.5 seconds, corresponding to the delta band; a2 = 0.167 seconds, corresponding to the theta band; a3 = 0.1 seconds, corresponding to the alpha band; a4 = 0.05 seconds, corresponding to the beta band; a5 = 0.025 seconds, corresponding to the gamma band; f nHere are the center frequencies of each brainwave signal band: f1 = 2Hz, corresponding to the center frequency of the delta band; f2 = 6Hz, corresponding to the center frequency of the theta band; f3 = 10Hz, corresponding to the center frequency of the alpha band; f4 = 20Hz, corresponding to the center frequency of the beta band; f5 = 40Hz, corresponding to the center frequency of the gamma band; σ n σt represents the energy attenuation width of each brainwave signal frequency band; σ1 = 1 Hz, corresponding to the energy attenuation width of the delta band; σ2 = 2 Hz, corresponding to the energy attenuation width of the theta band; σ3 = 2.5 Hz, corresponding to the energy attenuation width of the alpha band; σ4 = 8.5 Hz, corresponding to the energy attenuation width of the beta band; σ5 = 20 Hz, corresponding to the energy attenuation width of the gamma band; S(t) is the brainwave signal, S(t′) is the brainwave signal in integral form; f is the frequency; ψ n (·) represents the wavelet basis function of the nth frequency band.
[0044] Specifically, in the formula, the time integral variable t′ represents the sampling time point of the brainwave signal S(t′), while t, as the current output time point, reflects the system's real-time response to the brainwave signal at a specific time. This is achieved through the wavelet basis function ψ. n The system can localize signals to different time scales, enabling feature extraction from bands such as δ, θ, and α. (Time scale factor a) n The function of this method is to stretch or compress the wavelet basis function to adapt it to the periodic characteristics of different frequency bands. For example, for the low-frequency delta band, a larger time scale factor (e.g., a1 = 0.5 seconds) allows the wavelet basis function to cover a longer time window, thus capturing changes in low-frequency components. Conversely, for the high-frequency gamma band, a smaller time scale factor (e.g., a5 = 0.025 seconds) allows the wavelet basis function to capture rapidly changing high-frequency components with greater detail. This design ensures that the system can dynamically adjust the decomposition process according to the frequency characteristics of each band during multi-band decomposition, thereby preserving the rich details of the brainwave signal. The center frequency f in the formula... n This is used to locate the main frequency components of each brainwave band, allowing the system to concentrate the signal characteristics of different bands within their corresponding frequency regions. The center frequency of the delta band is 2Hz, representing a deep relaxation state, while the center frequency of the gamma band is 40Hz, indicating high-intensity cognitive activity. By setting the center frequency, the system can ensure that the decomposition of each band is concentrated within a specific frequency range, facilitating the capture of the psychological state reflected by that band. Simultaneously, to reduce interference from other bands on the target band signal, the formula introduces the frequency attenuation width σ. n Using Gaussian decay function The frequency characteristics are smoothed. The Gaussian function maximizes signal energy near the center frequency of each frequency band, with energy gradually decreasing as the distance from the center frequency increases. This smoothing not only enhances the stability of features within a frequency band but also reduces interference from other frequency bands, improving the accuracy of signal decomposition. The time-frequency distribution X(f,t) generated by this multi-scale decomposition formula is actually the characteristic distribution of brainwave signals at time t and frequency f. By transforming S(t) into X(f,t), the system can observe the energy changes of brainwaves at different time and frequency components. Thus, the system can further analyze the multi-band characteristics of brainwaves to form a feature vector reflecting the user's psychological state. The final generated emotion feature vector has a five-dimensional structure, which the system uses to identify and track the real-time dynamics of the user's emotions. Therefore, the system does not merely passively collect the user's brainwave data but, through multi-band decomposition using the formula, forms a detailed "emotion map" at the data level. This map not only provides a static snapshot of the current emotional state but also provides a basis for the system to flexibly adjust music parameters during music therapy signal generation.
[0045] Example 4: The brainwave signal acquisition and decomposition unit calculates the standardized brainwave energy density D(f, t) based on the signal decomposition results using the following formula:
[0046]
[0047] Where Δf is the width of the frequency integration window, ranging from 1Hz to 3Hz; f′ is the frequency integration variable; and |·| is the amplitude operator.
[0048] Specifically, in this formula, |X(f,t)| 2 This represents the energy intensity of the signal decomposition result at a specific frequency *f* and time *t*. Calculating this value reflects the energy information carried by the frequency component *f* of the brainwave signal at a given time. However, since the energy distribution of brainwave signals is not uniform across the frequency spectrum, a standardization method is needed to ensure greater comparability of the overall relative energy intensity. To achieve this, the denominator integrates the energy within a frequency window to obtain the total energy value. Specifically, the integration range is limited to *f-Δf* to *f+Δf* by the width of the frequency integration window Δf, ensuring that the energy integration is confined to the specified frequency band. This allows the system to achieve local normalization within each frequency band, resulting in a relatively balanced energy density *D(f, t)* across bands, preventing excessively high or low energy levels in specific frequency bands from affecting the accuracy of emotion feature extraction. In addition to the standardization process described above, the formula also incorporates a Gaussian decay function. This step is used to smooth the spectral distribution of brainwave signals by adjusting the center frequency f in each frequency band. nThe energy density is maximized in the vicinity, and the energy gradually decays towards the region farther from the center frequency. This smooth decay effect is determined by the parameter σ. n The system employs control techniques, selecting different attenuation widths for different frequency bands based on their characteristics. For example, the attenuation width for low-frequency delta waves is smaller to ensure that signal energy is mainly concentrated near the center frequency, while the attenuation width for high-frequency gamma waves is larger to accommodate the wider energy distribution in high-frequency signals. Through smoothing processing using a Gaussian attenuation function, the system ensures that only representative spectral components are processed in each frequency band, while reducing interference from non-target frequency bands, thereby improving the feature extraction accuracy of brainwave signals.
[0049] Example 5: The emotion feature processing unit, based on the signal decomposition results and standardized brainwave energy density, constructs a five-dimensional emotion feature vector E(t) as follows:
[0050]
[0051] Among them, E1(t) is the relaxation-tension dimension element; E2(t) is the focus-distraction dimension element; E3(t) is the stability-fluctuation dimension element; E4(t) is the coordination-chaos dimension element; E5(t) is the harmony-imbalance dimension element; Phase(·) is the phase extraction function; Sync(·) is the synchronicity calculation function.
[0052] Specifically, the first element E1(t) of the emotion feature vector represents the relaxation-tension emotional dimension, calculated based on the logarithmic transformation of the delta band energy density and signal amplitude. Delta waves are typically associated with deep relaxation; therefore, the system can identify the user's level of relaxation by logarithmically processing the delta band energy. The logarithmic transformation not only amplifies subtle changes at low energy levels but also avoids over-amplification at high energy levels. This method accurately captures changes in relaxation or tension, providing a basis for generating relaxing music. The second element E2(t) of the emotion feature vector describes the focus-distraction state. The system determines this feature value by calculating the frequency gradient of the theta band. Theta waves often appear in a relaxed but somewhat focused state; by analyzing changes in their frequency, the system can determine the user's level of focus. For example, an increasing theta wave frequency gradient indicates that the user may be gradually shifting towards a focused state, while a low frequency gradient shows a more scattered emotional state. Accurate identification of the focus-distraction dimension helps adjust the rhythm and melody of the music to suit the user's needs when concentrating or distracted. The third dimension, E3(t), is used to identify stable-fluctuating emotional states. The system calculates this feature by integrating the temporal gradient of the alpha band signal. The alpha band typically appears in states of mild focus or relaxation, and changes in the temporal gradient indicate the signal's stability over time. When the temporal gradient is small, the user's emotions are relatively stable; while when the temporal gradient is large, the user's emotions may be fluctuating or unstable. The system can use this feature to generate smooth or gradually changing music, allowing the music to harmonize during emotional fluctuations and guide the user back to a more stable state. The coordination-disorder dimension is represented by the fourth element of the feature vector, E4(t), which the system calculates by analyzing the phase characteristics of the beta band signal. The beta band is typically associated with states of focus and alertness, and phase consistency indicates the degree of temporal synchronization of the signal. When the phase characteristics show high synchronicity, the user's emotions are in a coordinated state; while low phase synchronicity indicates that the user's emotions may be inclined towards disorder. Identifying this dimension allows the system to generate music with a more coordinated rhythm, providing guidance for emotional balance. The fifth element, E5(t), represents the harmony-imbalance dimension, identified through the synchronicity characteristics of the gamma band. The gamma band is generally associated with higher cognitive activities and information integration states; higher synchronicity indicates emotional harmony, while lower synchronicity represents an imbalance. When a user's gamma band synchronicity is high, the system can generate upbeat music to maintain emotional harmony; conversely, when synchronicity is low, the rhythm and frequency of the music can be adjusted to a more subdued state to help the user restore balance.
[0053] Example 6: The emotion feature processing unit extracts dynamic emotion features using the following formula to obtain the dynamic emotion feature Φ(t):
[0054]
[0055] Where Φ1(t) is the cumulative amount of emotion intensity; Φ2(t) is the rate of change of emotion; Φ3(t) is the rate of change of emotion complexity; ||·||1 is the L1 norm operation; ||·||2 is the L2 norm operation; and E(t′) is the integral form of the five-dimensional emotion feature vector E(t).
[0056] Specifically, the first element Φ1(t) of the emotional dynamic feature vector represents the cumulative amount of emotional intensity. To enable the system to reflect the cumulative changes in user emotions, this feature is calculated by integrating the L2 norm of the five-dimensional emotional feature vector and incorporating an exponential decay term. Specifically, this integral is performed by progressively adding the L2 norm value of E(t′) from time 0 to the current time t, and multiplying it by an exponential decay factor e at each time step. -0.1(t-t′)Through this exponential decay, the system can assign higher weights to more recent emotional states while gradually reducing the influence of more distant emotional states, thus achieving a "memory decay" effect. This design allows the system to focus on the user's current emotions while also retaining historical information about emotional intensity, providing an overall accumulated value of emotional fluctuations. This feature not only helps the system identify the user's emotional trends but also allows the system to generate more continuous music based on the user's accumulated emotional states, making the music's rhythm and melody conform to the accumulated emotional trend, enhancing the user's healing experience. The second element Φ2(t) of the emotional dynamic feature vector is used to describe the rate of change of emotions. This feature captures the volatility of emotions at a specific point in time by calculating the time derivative of the five-dimensional emotional feature vector E(t). The sum of the squares of this derivative represents the instantaneous intensity of the emotional state in different dimensions. To ensure that this feature is not limited to instantaneous changes, the product of the L2 norm of the emotional feature vector and the weighting factor 0.5 is further introduced, giving the rate of change of emotions a more refined characterization between stable and fluctuating states. A high rate of emotion change indicates unstable emotional fluctuations. In this case, the system can adjust the rhythm and melody of the music to make it smoother, subtly calming the user's emotional fluctuations. Conversely, a low rate of emotion change indicates a relatively stable emotional state, allowing the music to maintain its current state without frequent changes. This feature extraction method of emotion change rate enables the system to sensitively detect the speed of changes in the user's emotions and adjust the music style in real time, ensuring that the music is always synchronized with the user's emotional changes and providing dynamic support. The third element, Φ3(t), represents the rate of change of emotional complexity. Emotional complexity is an indicator that measures the diversity and complexity of emotional states. This complexity characteristic is described by the ratio of the L1 norm to the L2 norm of the five-dimensional emotional feature vector. The system can capture the distribution characteristics of emotional states across different dimensions and characterize the rate of change of complexity using the derivative of the arctangent function. When the complexity of emotional states changes significantly, it means that the user's emotions have fluctuated significantly across different feature dimensions. In this case, the system can generate richer and more layered music to adapt to complex emotional states, helping users find balance amidst emotional diversity. When the rate of change in emotional complexity is small, it indicates that the user's emotional changes are relatively consistent or singular. In this case, music with a simpler structure can be chosen to avoid overly complex melodies from disturbing the user's calm emotional state. The introduction of the rate of change in emotional complexity allows the system to respond more subtly to the user's emotional characteristics at the level of musical style, enabling the generated music to switch freely between emotional diversity and singularity, thereby making the therapeutic effect more profound.
[0057] Example 7: The music therapy signal generation unit generates a music fundamental parameter vector M(t) by mapping music fundamental parameters based on a five-dimensional emotion feature vector and three-dimensional emotion dynamic features using the following formula:
[0058]
[0059] Among them, f b A(t) is the fundamental frequency, based on the standard pitch of 440Hz; A(t) is the amplitude envelope; T(t) is the velocity, in BPM, ranging from 60 to 180.
[0060] Specifically, in this formula, the fundamental frequency f b (t) is the fundamental frequency of the entire music. The formula adds the relaxation-tension dimension E1(t) and the focus-distraction dimension E2(t) of the user's emotional characteristics, and adjusts the frequency by combining the cumulative emotional intensity Φ1(t). The formula for the fundamental frequency is: Using 440Hz as the base frequency, representing the standard pitch of the music, the addition of emotional characteristics causes the frequency to fluctuate with changes in emotion. When the user is highly tense or focused, the base frequency increases accordingly, making the music pitch higher and brighter, thus synchronizing with the user's state of tension to some extent. Conversely, when the user is more relaxed or distracted, the base frequency decreases, making the music pitch lower and more peaceful. By using a factor in the form of the square root of emotional intensity, the amplitude of frequency adjustment is reasonably controlled, ensuring that the frequency adjustment is not too extreme and that the music remains within a gentle adjustment range. This base frequency setting allows the music pitch to gradually rise when the user is tense, become clearer when focused, and fall back when the user is relaxed, thus naturally guiding the user's emotions back to peace. The amplitude envelope A(t) determines the dynamic range and volume changes of the music, directly affecting the user's auditory experience. The amplitude is calculated as the ratio of the cumulative emotional intensity to the rate of emotional change, multiplied by the hyperbolic tangent function of the L2 norm of the five-dimensional emotional characteristics, i.e. This design allows for higher volume when emotional intensity is high and the rate of change is low, thus enhancing the expressiveness of the emotion. Conversely, as the rate of emotional change increases, the amplitude envelope decreases to prevent overly intense musical dynamics caused by emotional fluctuations, resulting in smoother volume changes and reduced emotional stimulation for the user. The hyperbolic tangent function provides a non-linear transformation, enabling the volume to gradually increase when emotional fluctuations are small, ensuring a gentle volume. Through this dynamic adjustment mechanism, the system can appropriately increase the volume under stress to guide the user's emotions towards relaxation, while appropriately smoothing volume changes when emotions are more volatile, making the music more continuous and gentle, preventing excessive volume from stimulating emotions, and ensuring the stability of the emotional healing process. The tempo T(t) represents the beats per minute (BPM), controlling the rhythm and overall speed of the music. This parameter directly affects the music's adaptability to changes in the user's emotions. The formula calculates the tempo using the Sigmoid function combined with the rate of change of emotion Φ2(t) and the rate of change of emotional complexity Φ3(t), with a final value ranging from 60 to 180 BPM. The tempo is calculated as T(t) = 60 + 120·sigmoid(Φ2(t) + Φ3(t)), where the sigmoid function provides a non-linear response, allowing the tempo to be sensitively adjusted according to emotional fluctuations and changes in complexity. When the rate of change in emotional change and the rate of change in emotional complexity are large, the tempo increases rapidly, and the rhythm of the music becomes more active to meet the needs of users with high emotional activity; conversely, when the rate of change in emotional change and the rate of change in complexity are small, the rhythm of the music slows down, allowing the user's mood to return to a stable state, suitable for a more peaceful emotional state. The non-linear effect of the sigmoid function ensures that the increase or decrease in tempo is not too abrupt, but rather a gradual transition, allowing users to achieve natural emotional regulation in accordance with the changes in music during emotional fluctuations.
[0061] Example 8: The music therapy signal generation unit generates a harmonic structure based on the three-dimensional emotional dynamic characteristics using the following formula, obtaining the harmonic frequency response H(f, t):
[0062]
[0063] B(t) = B0·(1+Φ2(t));
[0064] σ h (t)=2+3Φ3(t);
[0065] Among them, c j (t) represents the j-th harmonic coefficient; B(t) represents the harmonic bandwidth function; σ h (t) represents the harmonic broadening factor; B0 is the harmonic fundamental bandwidth, which is a set value; j is the integer subscript index.
[0066] Specifically, in this formula, the harmonic frequency response H(f,t) is composed of the superposition of harmonic signals of different orders. The harmonic coefficient c of each order... j A(t) is a time-varying function that distributes the energy and width of each harmonic to different frequencies by allocating the amplitude envelope A(t) and adjusting the broadening coefficient. The harmonic coefficient c... j The calculation method for (t) is as follows: That is, by gradually attenuating the amplitude envelope A(t) according to order j, and adding a harmonic broadening coefficient σ. h (t) The related exponential decay term. This design ensures that higher-order harmonics gradually decay, thus constructing a harmonic frequency response with gradually decreasing characteristics, making the musical structure richer while maintaining harmony. Broadening factor σ h The bandwidth function (t) dynamically adjusts based on the emotional complexity change rate Φ3(t). A larger Φ3(t) indicates higher user emotional complexity, thus increasing the broadening factor of the harmonic structure, resulting in a wider harmonic frequency response and a more complex and three-dimensional sound effect. Conversely, a lower emotional complexity leads to a smaller broadening factor, making the harmonic distribution more concentrated and resulting in a simpler, more harmonious sound quality. The bandwidth function B(t) controls the frequency coverage of the harmonic structure and dynamically changes based on the fundamental harmonic bandwidth B0 and the emotional change rate Φ2(t). The bandwidth function is calculated as B0·(1+Φ2(t)), which amplifies the fundamental bandwidth B0 based on the magnitude of the emotional change rate Φ2(t). A higher emotional change rate indicates greater user emotional fluctuation, leading to a corresponding increase in bandwidth and a wider frequency range covered by the music's harmonic structure, resulting in richer sound layers. A lower emotional change rate results in a narrower bandwidth, a more concentrated harmonic structure, and a simpler, calmer sound quality. Adjusting the bandwidth delivers a more complex sound experience during periods of intense emotional fluctuation, while providing a pure timbre during periods of calm, allowing users to receive appropriate sonic guidance in different emotional states. The entire harmonic frequency response is achieved through the superposition of each harmonic component, as shown in the formula. To control the frequency distribution of each harmonic frequency, f b The fundamental frequency f(t) determines the frequency center of the harmonics, while the bandwidth function B(t) ensures the range of frequency distribution. This design allows the harmonic structure of music to have both a sense of layering in frequency and the ability to dynamically adjust with changes in the fundamental frequency and bandwidth. For example, when the user is in a state of high tension or concentration, the fundamental frequency f(t)... b(t) increases, and the bandwidth expands, making the music brighter and broader, thus synchronizing the sound frequencies with the user's emotions; while when the user is in a lower emotional state, the fundamental frequency decreases and the bandwidth narrows, making the music softer and more focused, creating a relaxing auditory experience. This dual regulation of the fundamental frequency and harmonic bandwidth ensures that the musical structure remains consistent with emotional fluctuations.
[0067] Example 9: The music therapy signal generation unit generates a music temporal structure based on the harmonic frequency response using the following formula to obtain the final generated therapy music signal:
[0068]
[0069] Where S(t) is the final generated healing music signal; W(f,t) is the time-varying modulation window function; g i (·) represents the Sigmoid modulation function; i is the integer subscript index; k i denoted as the modulation slope coefficient, where k1 = 2.0, k2 = 1.5, k3 = 1.0; x0 is the modulation midpoint with a value of 0.5.
[0070] Specifically, the first part of the formula defines the final generated healing music signal S(t), which consists of the harmonic frequency response H(f,t), the time-varying modulation window function W(f,t), and the complex exponential function e^(-t / t). j2πft The product of these components is formed by integrating over frequency f. This integration process integrates the corresponding characteristics of each frequency component into a single time-domain signal S(t), resulting in a comprehensive audio signal. Through the frequency characteristics of the harmonic frequency response, the system can capture changes in the user's emotional state when generating the music signal. The complex exponential function allows the phase and amplitude of each frequency component to change dynamically over time, achieving a smooth transition in the music and thus improving its continuity and listening experience. The resulting music signal is not merely a simple frequency superposition, but rather further optimized in terms of temporal structure, enabling the music to adjust accordingly to real-time changes in the user's emotional state. The introduction of the time-varying modulation window function W(f,t) plays a crucial role in generating therapeutic music signals. This function, through a combination of Gaussian distribution and the Sigmoid function, achieves temporal control over each frequency component. Specifically, the Gaussian distribution term of the window function... This causes the frequency response to be mainly concentrated at the fundamental frequency f. bWithin a frequency range near (t), the bandwidth B(t) controls the width of the response range. The bandwidth B(t) is influenced by the dynamic characteristics of the user's emotions. When emotions fluctuate significantly, the bandwidth increases, resulting in a wider frequency response coverage and a richer frequency structure; when emotions are stable, the bandwidth narrows, making the frequency distribution more concentrated and creating a softer auditory effect. This bandwidth control mechanism ensures that the frequency distribution of the music signal changes with emotional fluctuations under different emotional states, providing users with more precise emotional guidance.
[0071] Additionally, the Sigmoid modulation function g in the time-varying modulation window function W(f,t) i (Φ i (t) further enhances the personalization of the music signal. Modulation function g i (·) The characteristics of the audio signal are dynamically adjusted by each component in the three-dimensional emotional dynamic features, reflecting the influence of the cumulative emotional intensity, the rate of emotional change, and the rate of change of emotional complexity on the music signal. Each modulation function has the following form: Where k i The modulation slope coefficient controls the rate of change of the sigmoid function, with x0 being the modulation midpoint. The modulation slope k... i The modulation function is set to 2.0, 1.5, and 1.0 to reflect the influence of different emotional characteristics on music modulation. A high-slope modulation function produces a faster response, allowing the music to adapt more quickly to strong emotional fluctuations; while a low-slope modulation function provides a smoother adjustment effect, allowing the music to gradually adjust when emotions are stable, maintaining its stability. This modulation function setting enables the music signal to have corresponding adaptability and response speed under different emotional states, thus making the music more auditoryally close to the user's inner state. Based on this, the system's complex exponential function e j2πft This ensures a continuous transition of frequency components over time, avoiding the disharmony caused by abrupt frequency changes in the music signal. This complex exponential term, through gradual temporal adjustments to the frequency components, maintains a smooth transition in the music signal, allowing users to enjoy a stable and comfortable musical experience regardless of their emotional state. The resulting therapeutic music signal not only maintains harmony in pitch, volume, and rhythm but also consistency in frequency distribution and temporal structure, allowing the music to resonate with the user's emotional fluctuations, thus achieving a more effective emotional healing effect.
[0072] The preferred embodiments of this disclosure have been described above with reference to the accompanying drawings, but this does not limit the scope of the claims of this disclosure. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and substance of this disclosure shall be within the scope of the claims of this disclosure.
Claims
1. A personalized music therapy system based on brainwave modulation, characterized in that, The system includes: a brainwave signal acquisition and decomposition unit, an emotion feature processing unit, and a music therapy signal generation unit. The brainwave signal acquisition and decomposition unit acquires brainwave signals, performs multi-scale decomposition by combining the brainwave signals with wavelet basis functions of different brainwave signal frequency bands, obtains the signal decomposition results, and calculates a standardized brainwave energy density based on the signal decomposition results. The emotion feature processing unit constructs a five-dimensional emotion feature vector based on the signal decomposition results and the standardized brainwave energy density; and extracts dynamic emotion features based on the five-dimensional emotion feature vector. The three-dimensional emotional dynamic features; the music therapy signal generation unit is used to map music basic parameters based on the five-dimensional emotional feature vector and the three-dimensional emotional dynamic features to generate a music basic parameter vector; based on the three-dimensional emotional dynamic features, it generates a harmonic structure to obtain a harmonic frequency response; based on the harmonic frequency response, it generates a music temporal structure to obtain the final generated therapy music signal; the brainwave signal frequency bands include: delta band, theta band, alpha band, beta band, and gamma band; the brainwave signal acquisition and decomposition unit performs multi-scale decomposition of the brainwave signal using the following formula to obtain the signal decomposition result. : ; in, Integer subscript index; For time integration variables; For time; It is a time scale factor, corresponding to the period of the brainwave signal frequency band; Seconds correspond to the delta band; Seconds correspond to the theta band; Seconds correspond to the alpha band; Seconds correspond to the beta band; Seconds correspond to the gamma band; The center frequency of each brainwave signal band; Hz, corresponding to the center frequency of the delta band; Hz, corresponding to the center frequency of the theta band; Hz, corresponding to the center frequency of the α band; Hz, corresponding to the center frequency of the β band; Hz, corresponding to the center frequency of the γ band; The energy attenuation width of each brainwave signal frequency band; Hz, corresponding to the energy attenuation width of the delta band; Hz, corresponding to the energy attenuation width of the θ band; Hz, corresponding to the energy attenuation width of the α band; Hz, corresponding to the energy attenuation width of the β band; Hz, corresponding to the energy attenuation width of the γ band; Brainwave signals The brainwave signal is in integral form; For frequency; For the first Wavelet basis functions for each frequency band; the brainwave signal acquisition and decomposition unit calculates the standardized brainwave energy density based on the signal decomposition results using the following formula. : ; in, This is the width of the frequency integration window, with a value ranging from 1Hz to 3Hz; For frequency integral variables; The amplitude operator is used; the emotion feature processing unit constructs a five-dimensional emotion feature vector based on the signal decomposition results and standardized brainwave energy density. Represented as: ; in, For the relaxation-tension dimension elements; For focused-dispersed dimension elements; For stable-fluctuation dimension elements; For elements of the coordinated-chaotic dimension; Elements of the Harmony-Imbalance Dimension; This is the phase extraction function; The synchronization calculation function is used; the emotion feature processing unit extracts dynamic emotion features using the following formula to obtain the dynamic emotion features. : ; in, This represents the cumulative intensity of emotions. For the rate of change in mood; The rate of change of emotional complexity; L1 norm operations; L2 norm operations; Five-dimensional emotion feature vector The integral form.
2. The personalized music therapy system based on brainwave modulation as described in claim 1, characterized in that, The music therapy signal generation unit generates a music basic parameter vector by mapping music basic parameters based on a five-dimensional emotion feature vector and three-dimensional emotion dynamic features using the following formula. : ; in, The fundamental frequency is based on the standard pitch of 440Hz. The amplitude envelope; The speed is measured in BPM and ranges from 60 to 180.
3. The personalized music therapy system based on brainwave modulation as described in claim 2, characterized in that, The music therapy signal generation unit generates a harmonic structure based on three-dimensional emotional dynamics using the following formula to obtain the harmonic frequency response. : ; ; ; ; in, For the first First harmonic coefficient; It is a harmonic bandwidth function; This is the harmonic broadening factor; The fundamental harmonic bandwidth is a set value. Integer subscript index.
4. The personalized music therapy system based on brainwave modulation as described in claim 3, characterized in that, The music therapy signal generation unit generates the music temporal structure based on the harmonic frequency response using the following formula to obtain the final generated therapy music signal: ; ; ; in, The final generated healing music signal; It is a time-varying modulation window function; It is the Sigmoid modulation function; Integer subscript index; Here, is the modulation slope coefficient, where, , , ; The modulation midpoint has a value of 0.5.
Citation Information
Patent Citations
Music recommendation method and system
CN113139079A
Virtual human emotion interaction system and method based on five-dimensional emotion model
CN115543089A