Alpha brainwave music generation method, product, medium and device
By collecting and processing multi-channel EEG signals, multi-track Alpha brainwave music is generated, which solves the problem of insufficient musicality and listenability in existing technologies and achieves the effects of rich variation in note length, clear rhythm and reasonable chord structure.
Patent Information
- Application Number
- CN202411224796.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-02
- Publication Date
- 2025-12-09
- Estimated Expiration
- 2044-09-02
AI Technical Summary
Existing brainwave music generation methods struggle to produce multi-track Alpha brainwave music with good musicality and listenability. Direct translation methods lack musicality in the generated audio, while parameter mapping methods suffer from unclear chord structures and a lack of meaningful connections between notes. These are problems that current technologies cannot solve, making it difficult to generate multi-track Alpha brainwave music with good musicality and listenability.
By collecting multi-channel EEG signals, preprocessing them, extracting Alpha band signals and segmenting them into segments, mapping them to note feature parameters, grouping them to generate multi-track candidate note sequences, adjusting the pitch and filtering pitch combinations, and generating multi-track Alpha brainwave music.
The generated Alpha brainwave music features rich variations in note length, distinct rhythms, a clear overall structure, reasonable chord selection, and harmonious harmony among all parts, thus enhancing its musicality and listenability.
Smart Images

Figure CN119015567B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of healthcare, in particular to an Alpha brain wave music generation method, product, medium and equipment. BACKGROUND
[0002] Electroencephalogram (EEG) plays a vital role in the field of clinical medicine. Generally speaking, electroencephalogram is usually presented in the form of waveform and other visual forms, so as to realize in-depth analysis of the characteristics of electroencephalogram signal. Some studies point out that converting electroencephalogram signal into sound or even music in the form of brain wave music has the effect of awakening consciousness, reducing stress and effectively improving the sleep quality of patients with insomnia. Among them, the Alpha wave with a frequency range of 8-12Hz is the first choice for making brain wave music because it can reflect the state of the brain to a certain extent and is easy to adjust.
[0003] In the existing research work, the generation scheme of brain wave music mainly includes two categories. The first method is direct translation method. Since the frequency of brain wave signal is often outside the audible range of human ear, this method directly multiplies the frequency domain of the original brain wave signal by a fixed coefficient to raise its frequency within the audible threshold (20-20000Hz) of human ear. However, since the original brain wave signal contains a large amount of background noise and does not have the structure and characteristics of general music works, the audio generated by this method lacks musicality and is difficult to convey meaningful information. The second method is the most widely used parameter mapping method. This method uses the original value of the data or extracts a part of the characteristic parameters to control the important parameters such as pitch and intensity of music synthesis. The parameter mapping method can generate more reasonable music works than the direct translation method, but when applied to multi-channel brain wave signals, the multi-track music produced lacks meaningful chord structure between notes and notes, the rhythm is unclear, the melody interferes with each other, and it is difficult to bring good auditory experience. SUMMARY
[0004] The purpose of the present application is to provide an Alpha brain wave music generation method, product, medium and equipment, which can automatically generate multi-track Alpha brain wave music by extracting Alpha wave band brain wave signal and improve the musicality and audibility of the generated brain wave music.
[0005] To achieve the above purpose, the present application provides the following scheme.
[0006] On the one hand, the present application provides an Alpha brain wave music generation method, comprising:
[0007] collecting multi-channel electroencephalogram signals according to the standard electroencephalogram collection method;
[0008] The electroencephalogram signals of each channel are preprocessed to obtain preprocessed electroencephalogram signals of each channel;
[0009] The Alpha band brain wave signals in the preprocessed electroencephalogram signals are extracted by a band-pass filter and cut into brain wave signal segments of a preset length;
[0010] Each brain wave signal segment is divided into multiple brain wave signal segments;
[0011] The brain wave feature parameters of each brain wave signal segment are mapped to the note feature parameters of the corresponding candidate notes, so that the brain wave signal segments of each channel are converted into candidate note sequences composed of multiple candidate notes; the brain wave feature parameters include the length, amplitude and average power of each brain wave signal segment; the note feature parameters include the duration, pitch and intensity of the candidate notes;
[0012] The multiple channels of the electroencephalogram signals are grouped, and multiple-track candidate note sequences of different voices are generated for each group;
[0013] The pitches of the candidate notes in the multiple-track candidate note sequences are adjusted according to a preset mode to obtain optimized candidate note sequences;
[0014] The pitch combinations in the optimized candidate note sequences are filtered through the pitch combinations in a large symbolic music dataset to obtain a multiple-track note sequence to be converted;
[0015] The multiple-track note sequence is converted into an audio file of a preset format to generate a multiple-track Alpha brain wave music.
[0016] Optionally, the preprocessing of the electroencephalogram signals of each channel to obtain preprocessed electroencephalogram signals of each channel specifically includes:
[0017] The electroencephalogram signals of each channel are respectively subjected to high-pass filtering, power line noise suppression and artifact rejection to obtain preprocessed electroencephalogram signals of each channel.
[0018] Optionally, the extraction of the Alpha band brain wave signals in the preprocessed electroencephalogram signals by a band-pass filter and the cutting into brain wave signal segments of a preset length specifically include:
[0019] The Alpha band brain wave signals in the preprocessed electroencephalogram signals are extracted by a band-pass filter set to 8.0-13.0 Hz;
[0020] The Alpha band brain wave signals are cut into brain wave signal segments E(t) of 3-5 minutes in length, where t is the sampling time, and the last sampling time is recorded as t max .
[0021] Optionally, the step of segmenting the brainwave signal of each channel into multiple brainwave signal segments specifically includes:
[0022] The brainwave signal of each channel is segmented into N+1 brainwave signal segments of length p to q: E0(t), E1(t), ..., E... N (t), these N+1 brainwave signal segments E0(t), E1(t), ..., E N The sampling times of E(t) are t0-t1, t1-t2, ..., tt1-t2, respectively. N-1 -t N t N -t max Among them, brainwave signal segment E n The length of (t) is T4(t) n ), n∈{0,1,2,…,N}; p is the preset shortest note length; q is the preset longest note length.
[0023] Optionally, the step of mapping the brainwave feature parameters of each brainwave signal segment to the note feature parameters of the corresponding candidate note, thereby converting the brainwave signal of each channel into a candidate note sequence composed of multiple candidate notes, specifically includes:
[0024] brainwave signal segment E n The length of (t) is T4(t) n Mapped to candidate note K n The duration of the note (n);
[0025] brainwave signal segment E n The amplitude Amp(n) of (t) is mapped to the candidate note K. n The pitch Pitch(n) and the mapping relationship between them are Pitch(n) = m * lg(Amp(n)) + r; where m and r are predetermined constants.
[0026] brainwave signal segment E n The average power AP(n) of (t) is mapped to the candidate note K. n The mapping relationship between the intensity MI(n) and AP(n) is MI(n) = k * lg(AP(n)) + l; where k and l are predetermined constants.
[0027] E of each brainwave signal segment n The length, amplitude, and average power of (t) are mapped one-to-one to the corresponding candidate note K. n After determining the duration, pitch, and intensity of the notes, the brainwave signal segment E(t) of each channel is converted into N+1 candidate notes K1, K2, ..., K... NThe candidate note sequence is composed of a plurality of channel-derived candidate note sequences.
[0028] Optionally, the plurality of channels of the electroencephalogram signal is grouped, and the multi-track candidate note sequence of different voices is generated for each group, specifically comprising:
[0029] The plurality of channels of the electroencephalogram signal is divided into a plurality of groups, and the electroencephalogram signal segments of different groups are different n (t) Different m and r parameters are applied respectively, so that the multi-track candidate note sequence of different voices is generated for each group.
[0030] Optionally, the multi-track note sequence is converted into a preset format audio file to generate a multi-track Alpha brain wave music, specifically comprising:
[0031] The multi-track note sequence to be converted is converted into a MIDI format symbolic music, and the MIDI format symbolic music is synthesized into a preset format audio file; the preset format includes a wav format and an mp3 format.
[0032] In another aspect, the present application provides a computer program product comprising a computer program which, when executed by a processor, implements the Alpha brain wave music generation method.
[0033] In another aspect, the present application further provides a computer readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the Alpha brain wave music generation method.
[0034] In still another aspect, the present application provides a computer device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor executes the computer program to implement the Alpha brain wave music generation method.
[0035] According to the specific embodiments of the present application, the following technical effects are achieved:
[0036] The method of the present application segments and divides the alpha band brain wave signals of each channel into multiple brain wave signal segments of different lengths according to the trend of the multi-channel electroencephalogram signals; then maps the brain wave feature parameters (length, amplitude and average power) of each brain wave signal segment into the note feature parameters (note length, pitch and sound intensity) of the corresponding candidate notes, so that the generated alpha brain wave music is rich in note length and has clear rhythm; further grouping the multiple channels of the electroencephalogram signals, generating multiple audio track candidate note sequences of different voices for each group, which can make the overall structure of the generated alpha brain wave music clearer; adjusting the pitch of the candidate notes in the multi-audio track candidate note sequence according to the preset mode, which can make it more consistent with human auditory perception in pitch combination; filtering the pitch combination in the optimized candidate note sequence through the pitch combination in the large symbolic music dataset, which can fully utilize the prior knowledge of general music works to optimize the generated candidate note sequence, make the chord selection more reasonable, and the voices consistent, which can bring better auditory perception and effectively improve the musicality and audibility of the generated brain wave music. In addition, the method of the present application can automatically extract alpha band brain wave signals to generate multi-audio track alpha brain wave music, effectively improving the efficiency of brain wave music generation. BRIEF DESCRIPTION OF DRAWINGS
[0037] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some of the embodiments of the present application, and for those skilled in the art, other drawings can be obtained without creative labor on the basis of these drawings.
[0038] Figure 1 The flowchart of the alpha brain wave music generation method provided by the present application. DETAILED DESCRIPTION
[0039] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, not all. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.
[0040] The purpose of the present application is to provide an alpha brain wave music generation method, product, medium and equipment, which can automatically generate multi-audio track alpha brain wave music by extracting alpha band brain wave signals, and improve the musicality and audibility of the generated brain wave music.
[0041] In order to make the above objectives, characteristics and advantages of the present application more obvious and easy to understand, the present application will be further described in detail below with reference to the drawings and specific embodiments.
[0042] As shown in Figure 1 The present application provides an Alpha brain wave music generation method, which comprises the following steps 1 to step 9.
[0043] Step 1: Collecting multi-channel electroencephalogram signals according to standard electroencephalogram acquisition mode.
[0044] The present application is a method for generating multi-track Alpha brain wave music by extracting Alpha band brain wave signals from collected multi-channel electroencephalogram signal data. Therefore, multi-channel electroencephalogram signals need to be collected according to standard electroencephalogram acquisition mode first.
[0045] Step 2: Preprocessing the electroencephalogram signals of each channel to obtain the preprocessed electroencephalogram signals of each channel.
[0046] For the electroencephalogram signals of each channel in the multi-channel, the original electroencephalogram record is processed in detail, including high-pass filtering, power line noise suppression and artifact rejection, to obtain the preprocessed electroencephalogram signals of each channel.
[0047] Among them, the high-pass filter processing filters the slow potential drift phenomenon in the multi-channel electroencephalogram signal data by setting a high-pass filter of 1.0 Hz, thereby improving the signal quality.
[0048] The power line noise suppression processing eliminates the power line noise interference in the electroencephalogram signals by setting a notch filter function of 50 Hz.
[0049] The artifact rejection processing automatically distinguishes and removes artifact signals introduced by external factors such as muscle activity through independent component analysis (ICA) technology.
[0050] Step 3: Extracting the Alpha band brain wave signals in the preprocessed electroencephalogram signals through a band-pass filter and dividing them into brain wave signal segments of a preset length.
[0051] The Alpha band brain wave signals in the preprocessed electroencephalogram signals are extracted through a band-pass filter set to 8.0-13.0 Hz; the extracted Alpha band brain wave signals are divided into brain wave signal segments E(t) of a preset length; wherein t is the sampling time; the total length of E(t), i.e. the time of the last sampling, is denoted as t max The length of a single brain wave signal segment E(t) is generally set to 3-5 minutes, which is similar to the length of a general popular music work, and different lengths can also be freely selected according to needs.
[0052] Step 4: segmenting the brain wave signal of each channel into multiple brain wave signal segments.
[0053] In a music piece, the durations of different notes usually have a multiple relationship, for example, the duration of a quarter note is twice that of an eighth note, and four times that of a sixteenth note, so that the music has a distinct rhythm. In order to make the finally generated Alpha brain wave music have the rhythm characteristics of a general music piece, a reference duration is set in advance, that is, the shortest duration of a note in the generated Alpha brain wave music is p, in seconds. And a maximum duration is also set in advance, that is, the longest duration of a note in the generated Alpha brain wave music is q, in seconds, and q is an integer multiple of p.
[0054] Polynomial fitting is performed on the brain wave signal segment E(t) of the specified channel in the Alpha band, that is, a polynomial fitting algorithm (such as the least squares method) is used to calculate the best fitting polynomial function T1(t) for E(t). T1(t) reflects a certain basic or dominant pattern in the brain wave signal segment E(t), such as a certain physiological rhythm or long-term change in neural activity.
[0055] The derivative T2(t) of T1(t) at each sampling point (i.e. sampling time) t is calculated, and T2(t) at all sampling points is normalized, that is, linearly transformed to the range of [0, 1], to obtain T3(t), T3(t) = (T2(t) - min(T2)) / (max(T2) - min(T2)); where min(T2) and max(T2) represent the minimum and maximum values of T2(t), respectively.
[0056] T4(t) = p + (q - p)^T3(t) is calculated, where T4(t) is the length of the brain wave signal segment divided from the sampling time t.
[0057] Starting from the sampling time t0 = 0, the above algorithm is repeatedly applied to recursively calculate t1 = t0 + T4(t0), t2 = t1 + T4(t1), …, tN = tN-1 + T4(tN-1). Where tN is the sampling point position of the brain wave signal segment E(t) after segmentation. N is the value of i that makes tN-1 less than tN and tN greater than or equal to tN-1 in the process of recursively calculating the increasing sequence t0, t1, t2, …, tN-1, tN. Thus, E(t) can be segmented into sampling times t0-t1, t1-t2, …, tN-1-tN in the original brain wave signal segment E(t), respectively. N N-1 N-1 i i i max i+1 max N-1 -t N , t N -t max E0(t), E1(t),..., EN(t) of N+1 segments of length between p and q. N The lengths of these segments are not necessarily equal. The length of the segment E n (t) is T4(t n ).
[0058] Step 5: mapping the brainwave feature parameters of each brainwave signal segment to the note feature parameters of the corresponding candidate note, so as to convert the brainwave signal segmentation of each channel into a candidate note sequence composed of multiple candidate notes.
[0059] Each brainwave signal segment E n (t) segmented in step 4 is in one-to-one correspondence with a candidate note K n . The brainwave feature parameters (such as length, amplitude and average power) of E n (t) are mapped to the note feature parameters (such as note length, pitch and intensity) of K n in the following steps. The step 5 specifically includes:
[0060] Step 5.1: mapping the length T4(t n ) of the brainwave signal segment E n (t) to the note length Length(n) of the candidate note K n .
[0061] Let the note length of the candidate note K n be Length(n), which is equal to the length T4(t n ) of the brainwave signal segment E n (t), i.e. Length(n) = T4(t n ).
[0062] Step 5.2: mapping the amplitude Amp(n) of the brainwave signal segment E n (t) to the pitch Pitch(n) of the candidate note K n , and the mapping relationship therebetween is Pitch(n) = m*lg(Amp(n))+r; where m and r are predetermined constants.
[0063] Let the pitch of the candidate note K n be Pitch(n), and the value of Pitch(n) is a numerical value representing the pitch in the Musical Instrument Digital Interface (MIDI), i.e. an integer between 1 and 127. The length of the brainwave signal segment E nThe amplitude of (t) is denoted as Amp(n), representing the distance from the wave base to the wave crest within an event. A mapping relationship is established between the two: Pitch(n) = m * lg(Amp(n)) + r. Here, m and r are predetermined constants to map the pitch to a suitable distribution range [Pitch]. min Pitch max The values of m and r can be freely adjusted as needed. (Pitch) min The minimum value among Pitch(0), Pitch(1), ..., Pitch(N); max It is the maximum value among Pitch(0), Pitch(1), ..., Pitch(N).
[0064] Step 5.3: Transfer brainwave signal segment E n The average power AP(n) of (t) is mapped to the candidate note K. n The intensity MI(n) is the same as the intensity MI(n), and the mapping relationship between them is MI(n)=k*lg(AP(n))+l; where k and l are predetermined constants.
[0065] Note the candidate note K n The intensity is MI(n), where MI(n) is a numerical value representing intensity in MIDI, an integer ranging from 1 to 127. (Brainwave signal segment E) n The average power of (t) is denoted as AP(n). Based on the scaling property, a mapping relationship is established between the two: MI(n) = k * lg(AP(n)) + l. Here, k and l are predetermined constants to map the sound intensity to a suitable distribution interval [MI]. min MI max The values of k and l can be freely adjusted as needed. MI min MI is the minimum value among MI(0), MI(1), ..., MI(N); max It is the maximum value among MI(0), MI(1), ..., MI(N).
[0066] Based on steps 4 and 5, the Alpha band brainwave signal of the specified channel is first segmented into segments E(t) into E0(t), E1(t), ..., E... N (t), and then each brainwave signal segment E n The length, amplitude, and average power of (t) are mapped one-to-one to the corresponding candidate note K. n The characteristics of note duration, pitch, and intensity were used to ultimately transform the brainwave signal segment E(t) of each channel into N+1 candidate notes K1, K2, ..., K... NThe candidate note sequence is composed of a plurality of candidate notes. For the EEG signal data composed of a plurality of channels, steps 4 to 5 are applied to the alpha band brain wave signals of each channel respectively to obtain a multi-track candidate note sequence composed of a plurality of candidate note sequences.
[0067] Step 6: Grouping the plurality of channels of the EEG signal, and generating multi-track candidate note sequences of different voices for each group.
[0068] In order to be more consistent with the characteristics that a general music work is composed of multiple voices, the plurality of channels of the EEG signal is divided into a plurality of groups, and the brain wave signal segments E n (t) Different m and r parameters are applied respectively to form a plurality of different voices, so as to generate multi-track candidate note sequences of different voices for each group. Taking the EEG signal data of 20 channels as an example, it can be divided into 4 groups, each group containing 5 channels, and each group is given different parameters m and r, and the generated candidate note sequence is a multi-track candidate note sequence of four voices.
[0069] Step 7: Adjusting the pitch of the candidate notes in the multi-track candidate note sequence according to a preset mode, to obtain an optimized candidate note sequence.
[0070] The multi-track candidate note sequence generated by the above steps often does not fully meet the human auditory perception in terms of pitch combination, and therefore the following method is used to optimize it: adjusting the pitch of the candidate notes K n according to a preset mode to obtain an optimized candidate note sequence. Taking the C major scale as an example, it contains seven basic pitch levels of C, D, E, F, G, A and B. If the pitch of the candidate note sequence belongs to one of them, it remains unchanged, otherwise it is adjusted according to the stability order of C, G, E, F, A, D and B in the major scale, according to the nearest neighbor and the most stable principle. For example, if the calculated pitch of the candidate note is #D, it needs to be adjusted according to the C major scale, since #D is not in the seven basic pitch levels. According to the nearest neighbor principle, the nearest pitch levels to #D are D and E, which are a half tone lower and a half tone higher than #D respectively. According to the most stable principle, since E is more stable, #D is adjusted to E.
[0071] Step 8: Filtering the pitch combination in the optimized candidate note sequence by the pitch combination in the large-scale symbolic music dataset to obtain a multi-track note sequence to be converted.
[0072] Step 8 is a filtering process of the candidate note sequence, aiming to filter out a series of notes that best fit the music theory and human auditory perception from the optimized candidate note sequence to form a multi-track note sequence, and then proceed to the next step of conversion. Specifically, the multi-track candidate note sequence generated by all channels can be regarded as a mixture of a part of meaningful note events and noise. By analyzing a large symbolic music dataset (such as the large-scale open-source dataset GiantMIDI-Piano), the usage rate of all different pitch combinations in the dataset is obtained, where a pitch combination at a certain time point refers to the combination of the pitches of all notes present at that time point; for example, if there are two notes at a certain time point, and their respective pitches are C4 and #D4, then (C4, #D4) is the pitch combination at that time point. The usage rate of a pitch combination is the proportion of the time length of the occurrence of the pitch combination in the total time length of the selected symbolic music dataset.
[0073] The more different pitch types an pitch combination contains, the more complex and unique it appears in terms of hearing, but correspondingly, it is less likely to appear in the dataset and in actual use; on the contrary, pitch combinations containing fewer pitch types often have a very high usage rate, but repeated appearance in the same work can easily make the listener feel bored. Therefore, from the list of usage rates of different pitch combinations obtained by analysis, the pitch combinations containing more than a certain threshold (for example, more than 10) of pitch types are removed, as well as the pitch combinations containing less than a certain threshold (for example, less than 3) of pitch types. Subsequently, the remaining pitch combinations are sorted according to the number of pitch types they contain in descending order, and for the pitch combinations containing the same number of pitch types, they are sorted according to the usage rate in descending order. Through the above method, a list of pitch combinations arranged in descending order of the number of pitch types and descending order of the usage rate is obtained, and these pitch combinations are respectively denoted as sets PC1, PC2, …, PC H , where H is the total number of pitch combinations in the list, and the elements in the set are the pitch types it contains.
[0074] For the multi-track candidate note sequence adjusted in step 7, the pitch combination at sampling point t is denoted as set PC(t), and the elements in the set are the pitch types it contains. Search from top to bottom in the above pitch combination list according to the arrangement order until the first pitch combination that satisfies h∈{0,1,2,…,H} is found. h Then it is denoted as PCR(t), i.e. PCR(t) = PC h If no pitch combination that meets the requirements is found after searching the entire pitch combination list, then The above method is applied to all sampling points, and the obtained pitch combination PCR(t) is used to replace the original pitch combination PC(t) to generate a multi-track note sequence filtered by the pitch combination list analyzed from the large symbolic music dataset, which is used as the multi-track note sequence to be converted. The filtered multi-track note sequence is composed of pitch combinations with relatively high usage rate and relatively reasonable structure, which can bring better auditory experience. At the same time, all the filtered pitch combinations are subsets of the original pitch combinations before filtering, which to some extent preserves the characteristics of the original brain wave signal.
[0075] Step 9: converting the multi-track note sequence into an audio file in a preset format to generate a multi-track Alpha brain wave music.
[0076] The multi-track note sequence obtained in step 8 is converted into a MIDI format symbolic music by using a related tool (such as the Python programming language-based mne toolkit), and the MIDI format symbolic music is synthesized into an audio file in a specified format (such as a wav format or an mp3 format) by using a related tool (such as the Python programming language-based midi2audio toolkit), so as to obtain the required multi-track Alpha brain wave music.
[0077] Compared with the prior art, the multi-track Alpha brain wave music generated by the method of the present application has higher audibility and is more in line with human aesthetic experience. In step 4, the EEG signal is segmented into segments of different lengths according to the trend of the EEG signal, and in step 5, the segmented EEG signal segments are mapped into notes, which can make the generated Alpha brain wave music rich in note length and clear in rhythm. In step 6, the multi-channel brain wave signal is grouped, and different parameters are used to form parts, which can make the overall structure of the generated Alpha brain wave music clearer. In step 7, the pitch of the candidate note in the multi-track candidate note sequence is adjusted according to a preset mode, so that the pitch combination is more in line with human auditory perception. In step 8, the multi-track candidate note sequence is filtered according to the pitch combination weight calculated from the large symbolic music dataset, which can make full use of the prior knowledge of general music works to optimize the generated candidate note sequence, make the chord selection more reasonable, and make the parts consistent and harmonious, which can bring better auditory experience and effectively improve the musicality and audibility of the generated brain wave music.
[0078] In some embodiments, the present application also provides a computer program product comprising a computer program which, when executed by a processor, implements the Alpha brain wave music generation method.
[0079] In some embodiments, the present application also provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the Alpha brain wave music generation method.
[0080] In some embodiments, the present application also provides a computer device, which comprises a processor, a memory, an input / output interface (I / O) and a communication interface. Wherein, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Wherein, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device comprises a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operating system and the computer program in the non-volatile storage medium to run. The database of the computer device is used to store to-be-processed transactions. The input / output interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with external terminals through network connection. The computer program is executed by the processor to implement the Alpha brain wave music generation method.
[0081] The principles and implementation manners of the present application are described by applying specific examples in the present application, and the above examples are only used to help understand the method of the present application and its core idea; meanwhile, for the general technical personnel in the art, according to the idea of the present application, the specific implementation manners and application ranges will be changed. In conclusion, the content of the present specification should not be understood as the limitation of the present application.
Claims
1. An Alpha brain wave music generation method, characterized by, The method comprises the following steps: Collecting multi-channel electroencephalogram signals according to a standard electroencephalogram collection mode; Pretreating the electroencephalogram signals of each channel to obtain pretreated electroencephalogram signals of each channel; For the electroencephalogram signals of each channel in the multi-channel, performing high-pass filtering, power line noise suppression and artifact rejection and other pretreatments to obtain pretreated electroencephalogram signals of each channel; The high-pass filtering is performed by setting a high-pass filter with a frequency of 1.0 Hz to filter the slow potential drift phenomenon in the multi-channel electroencephalogram signal data; The power line noise suppression is performed by setting a notch filter function with a frequency of 50 Hz to eliminate the power line noise interference in the electroencephalogram signals; The artifact rejection is performed by independent component analysis technology to automatically distinguish and remove the artifact signals introduced by external factors; Extracting the alpha wave band brain wave signals in the pretreated electroencephalogram signals by a band-pass filter and cutting them into brain wave signal segments with a preset length; The Alpha wave band brain wave signal in the preprocessed electroencephalogram signal is extracted by setting a band-pass filter of 8.0-13.0 Hz; the extracted Alpha wave band brain wave signal is cut into brain wave signal segments E(t) of a preset length; wherein t is a sampling time; the total length of E(t), i.e. the time of the last sampling, is recorded as t max ; the length of a single brain wave signal segment E(t) is preset to 3-5 minutes; Segmenting the brain wave signal segments of each channel into multiple brain wave signal segments; Predefining a reference sound length, i.e., setting the shortest sound length of the generated alpha brain wave music as p, in seconds; and predefining a maximum sound length, i.e., setting the longest sound length of the generated alpha brain wave music as q, in seconds, which is an integer multiple of p; Performing polynomial fitting on the alpha wave band brain wave signal segments E(t) of the specified channel, calculating the best fitting polynomial function T1(t) for E(t) by using a polynomial fitting algorithm; T1(t) reflects a certain basic or dominant mode in the brain wave signal segments E(t); Calculating the derivative T2(t) of T1(t) at each sampling point, i.e., sampling time t, and performing normalization processing on T2(t) at all sampling points to linearly transform it to the range of [0, 1] to obtain T3(t), T3(t) = (T2(t)-min(T2)) / (max(T2)-min(T2)); wherein min(T2) and max(T2) represent the minimum value and the maximum value of T2(t), respectively; Calculating T4(t) = p+(q-p)^T3(t), T4(t) being the length of the brain wave signal segment divided from the sampling time t; Starting from sampling time t0 = 0, the above algorithm is repeatedly applied to recursively calculate t1 = t0 + T4(t0), t2 = t1 + T4(t1), ..., t N =t N-1 +T4(t N-1 ); where t i The sampling point locations are used to segment the brainwave signal E(t); N represents the number of sampling points for the increasing sequence t during the recursive calculation process. i Just enough to make t i Less than t max And t i+1 Greater than or equal to t max The value of i; thus, E(t) is divided into sampling times t0-t1, t1-t2, ..., t in the original brainwave signal segment E(t). N-1 -t N t N -t max N+1 segments of length between p and q: E0(t), E1(t), ..., E N (t); the lengths of these segments are not necessarily equal; segment E n The length of (t), n∈{0,1,2,…,N} is T4(t) n ); Mapping the brain wave feature parameters of each brain wave signal segment to the note feature parameters of the corresponding candidate notes, so as to convert the brain wave signal segments of each channel into candidate note sequences composed of multiple candidate notes; the brain wave feature parameters include the length, amplitude and average power of each brain wave signal segment; the note feature parameters include the sound length, pitch and intensity of the candidate notes; The mapping of the brain wave feature parameters of each brain wave signal segment to the note feature parameters of the corresponding candidate notes, so as to convert the brain wave signal segments of each channel into candidate note sequences composed of multiple candidate notes, specifically comprises: The brain wave signal segment E n The length T4(t n ) of (t) is mapped to the length Length(n) of the candidate note K n . The brain wave signal segment E n The amplitude Amp(n) of the brain wave signal segment E n The pitch Pitch(n) of the brain wave signal segment E, and the mapping relationship between them is Pitch(n)=m*lg(Amp(n))+r; wherein, m and r are predetermined constants The brain wave signal segment E n The average power AP(n) of (t) is mapped to the candidate musical note K n The musical intensity MI(n) of (t), and the mapping relationship between them is MI(n)=k*lg(AP(n))+l; wherein, k and l are predetermined constants; E of each brainwave signal segment n The length, amplitude, and average power of (t) are mapped one-to-one to the corresponding candidate note K. n After determining the duration, pitch, and intensity of the notes, the brainwave signal segment E(t) of each channel is converted into N+1 candidate notes K1, K2, ..., K... N A candidate note sequence is formed; several candidate note sequences obtained from multiple channels are combined to form a multi-track candidate note sequence; Grouping the multiple channels of the electroencephalogram signals, and generating multiple-track candidate note sequences of different voices for each group; Adjusting the pitches of the candidate notes in the multiple-track candidate note sequences according to a preset mode to obtain optimized candidate note sequences. Filtering the pitch combination in the optimized candidate note sequence through the pitch combination in the large symbolic music dataset to obtain a multi-track note sequence to be converted; Converting the multi-track note sequence into an audio file in a preset format to generate multi-track Alpha brain wave music.
2. The alpha brain wave music generation method of claim 1, wherein, The method further comprises: dividing the plurality of channels of the electroencephalogram signal into a plurality of groups, different groups of the electroencephalogram signal segments E n (t) applying different m and r parameters, respectively, to generate a plurality of candidate note sequences for different voices for each grouping.
3. The alpha brain wave music generation method of claim 1, wherein, The method further comprises: The method further comprises:
4. A computer program product comprising a computer program, characterized in that, The multi-track note sequence to be converted is converted into a MIDI format symbolic music, and the MIDI format symbolic music is synthesized into an audio file in a preset format; the preset format includes a wav format and an mp3 format.
5. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by a processor to implement the Alpha brain wave music generation method of any one of claims 1-3.
6. A computer device comprising: The computer program is executed by a processor to implement the Alpha brain wave music generation method of any one of claims 1-3. A memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor executes the computer program to implement the Alpha brain wave music generation method of any one of claims 1-3.
Citation Information
Patent Citations
Music brain electricity analytical method
CN101015451A
Brain wave music generation method
CN102999701A
Method and electronic device for matching musical imaginary electroencephalogram with musical pitch values
US20230351987A1