Method and system for meditation and sleep aiding based on brain wave feedback
By dynamically identifying the peaks and troughs of EEG signals and their dominant frequencies, and adjusting for environmental factors, this method solves the problem of feedback mismatch in existing meditation-based sleep aid methods. It achieves precise control of brain state and continuous monitoring and rhythmic guidance of the meditation-based sleep aid process.
Patent Information
- Application Number
- CN202511503380.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-20
- Publication Date
- 2025-12-23
AI Technical Summary
Existing technologies fail to dynamically identify details of brainwave structural changes in meditation-assisted sleep methods, resulting in discontinuous feedback adjustments, difficulty in real-time identification of differences in activity levels between the left and right hemispheres, and a single feedback method. This makes it difficult to construct differentiated intervention strategies for different brain states, leading to a mismatch between feedback and intervention rhythm in meditation guidance and sleep aid applications.
By acquiring frequency band EEG signals from the user's cerebral cortex, identifying the trend of peak and trough changes, dynamically adjusting the detection interval, extracting micro-variable structures and dominant frequency data, adjusting the phase difference between the left and right ear signals in real time, generating directional and coordinated sleep-aid signals, and making multi-dimensional adjustments in conjunction with environmental factors.
It enables precise tracking of changes in brain state, enhances the recognition and feedback of changes in the depth of meditation, and improves the synchronous adaptability and dynamic response capability of meditation guidance and sleep-aid intervention.
Smart Images

Figure CN121177641A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of neural activity detection, in particular to a meditation sleep-aiding method and system based on brain wave feedback. BACKGROUND
[0002] The technical field of neural activity detection relates to the collection, analysis and application of physiological signals of the human nervous system. The core matters include the detection and determination of brain activity states using parameters such as electroencephalogram signals, bioelectric signals and nerve potentials. This technology is widely used in medical diagnosis, psychological assessment, neural rehabilitation, sleep monitoring, mental state intervention and other aspects. In particular, through the means of electroencephalogram signal acquisition and feedback, real-time understanding and regulation of individual brain function states have become an important technical basis in neuroscience, clinical medicine and health management. Among them, the meditation sleep-aiding method based on brain wave feedback refers to acquiring the electroencephalogram signals generated by the user's cerebral cortex through real-time acquisition devices, combining specific electroencephalogram frequency band variation rules, and feeding back the brain wave changes to the user through visual interfaces, sound guidance or environmental stimulation. The user actively adjusts their own state according to the feedback information to achieve the purpose of meditation or sleep assistance. Existing methods of this kind use electroencephalogram sensors to collect signals, analyze specific frequency band electroencephalogram changes, and complete the feedback process with the help of audio playback, visual cues or environmental atmosphere adjustment means.
[0003] The existing technology realizes state regulation through the collection and feedback of specific frequency band electroencephalogram signals, but the processing process is mostly based on static frequency band setting and single feedback path, and is unable to dynamically identify the details of brain wave structure changes. When there is slight fluctuation in the user's brain wave activity, it is difficult to establish a continuous feedback adjustment mechanism, resulting in insufficient perception of marginal changes in the state. In multi-period monitoring, response delays are prone to occur, and the differences in active states between the left and right hemispheres cannot be identified and cooperatively regulated in real time. The feedback method is limited to fixed sound and light signal output, and it is difficult to construct differentiated intervention strategies for different brain states. In actual meditation guidance and sleep-aiding applications, problems such as feedback mismatch and imbalance in intervention rhythm are prone to occur. SUMMARY
[0004] In order to solve the technical problems of the existing technology that the processing process is mostly based on static frequency band setting and single feedback path, and is unable to dynamically identify the details of brain wave structure changes. When there is slight fluctuation in the user's brain wave activity, it is difficult to establish a continuous feedback adjustment mechanism, resulting in insufficient perception of marginal changes in the state. In multi-period monitoring, response delays are prone to occur, and the differences in active states between the left and right hemispheres cannot be identified and cooperatively regulated in real time. The feedback method is limited to fixed sound and light signal output, and it is difficult to construct differentiated intervention strategies for different brain states. In actual meditation guidance and sleep-aiding applications, problems such as feedback mismatch and imbalance in intervention rhythm are prone to occur, the present application provides a meditation sleep-aiding method and system based on brain wave feedback. The technical solution is as follows: On the one hand, it provides a meditation-based sleep aid method based on brainwave feedback, which includes: S1: Obtain the raw data of EEG signals in the frequency band set by the user's cerebral cortex for the meditation state, extract the peak and trough amplitudes, call the amplitude peak positions of adjacent time segments, identify the trend of peak position changes, adjust the upper and lower boundaries of the detection interval, and generate the EEG signal monitoring interval for the meditation state. S2: Using the brainwave signal monitoring interval of the meditation state, extract the weak amplitude change data in continuous time segments, identify the trough position, analyze the direction of trough position change, determine the stable interval of the micro-structure, and obtain the brainwave micro-structure tracking result. S3: Based on the brainwave micro-change structure tracking results, extract the dominant frequency data in the continuous time segment of the alpha and theta wave boundary region of the cerebral cortex, call the dominant frequency change direction of adjacent time segments, count the number of consecutive changes in the change direction, and generate the meditation dominant frequency drift linkage result. S4: Using the results of the meditation-dominant frequency drift linkage, determine whether the transitional state of meditation-assisted sleep is entered, obtain the difference in the activity state of the left and right hemisphere EEG signals, adjust the phase difference and time delay of the left and right ear signals, execute the left and right ear coordinated signal output, and generate a directional coordinated sleep-aid signal.
[0005] As a further aspect of the present invention, the EEG signal monitoring interval includes frequency band interval boundaries, peak trend direction, and interval adjustment coefficient; the brainwave micro-change structure tracking results include trough trajectory lines, number of changes, and micro-change trend indicators; the meditation-dominant frequency drift linkage results include drift direction labels, rate deviation, and linkage strength index; and the directional collaborative sleep aid signal includes phase matching degree, ear-side time delay difference, and output sound wave combination structure.
[0006] As a further aspect of the present invention, the step of obtaining the EEG signal monitoring interval specifically includes: S101: Obtain raw EEG signal data of the frequency band set by the user's cerebral cortex for the meditation state, extract the peak and trough amplitude values within the time segment, record the amplitude position corresponding to the peak and trough based on the difference between the peak and trough amplitude values in the same time segment, and group and organize the amplitude values of multiple consecutive time segments to obtain amplitude extreme value distribution data. S102: Based on the amplitude extreme value distribution data, call the time index position corresponding to the amplitude peak in each time segment, calculate the time interval between peak positions between adjacent time segments, filter sample positions where the time interval change exceeds the average time span of adjacent segments, and generate a wave peak shift position trend sequence. S103: Based on the trend sequence of the peak offset position, determine the consistency of the change direction of the peak position offset in three consecutive time segments, and classify the position indexes with the same change direction in the three consecutive segments into the trend consistency interval range, which serves as the lower and upper boundaries of the detection interval, thereby generating the EEG signal monitoring interval for the meditation state.
[0007] As a further aspect of the present invention, the steps for obtaining the brainwave micro-variation structure tracking results are specifically as follows: S201: Based on the EEG signal monitoring interval of the meditation state, extract the set of amplitude fluctuation values in continuous time segments, remove amplitude points that exceed the boundary of the monitoring interval, retain amplitude change data within the interval, record the low amplitude position and time index in each time segment, mark the trough position in continuous time segments, and generate a weak amplitude trough index sequence. S202: Call the weak amplitude trough index sequence, make directional judgment on the time index of adjacent trough positions, determine the direction of change based on the positive or negative difference of the index value, organize the directional state in the continuous time segment into an ordered symbol sequence, identify the points where the direction changes repeatedly, remove samples that switch directions within the local variation range, and generate a trough offset direction mapping sequence. S203: Based on the trough offset direction mapping sequence, accumulate the number of time segments with the same continuous direction, select time segments with consistent continuous direction, call the trough time index difference in the corresponding segment, calculate the consistency index value of the trough spacing change, mark the continuous segments with stable trough spacing change amplitude, and obtain the brainwave micro-change structure tracking results. The consistency index value of the trough spacing variation is calculated using the following formula: ; in, The consistency index value of the change in the trough spacing within the time interval t. This represents the distance between the i-th trough index and the previous trough index in time interval t. This represents the average value of the trough index spacing values within the time interval t. The length of the j-th consecutive time segment with the same direction in time interval t. represents the average length of consecutive time segments with consistent direction within time interval t, n represents the number of trough index differences within time interval t, and m represents the number of consecutive time segments with consistent direction within time interval t.
[0008] As a further aspect of the present invention, the step of obtaining the meditation-dominant frequency drift linkage result specifically includes: S301: Based on the brainwave micro-variation structure tracking results, extract the continuous time segment corresponding to the boundary region between α waves and θ waves in the cerebral cortex, call the frequency corresponding to the amplitude peak as the dominant frequency, and record the corresponding time index position to generate the dominant frequency sequence of the boundary region. S302: Call the dominant frequency sequence of the boundary region, compare the change relationship of the dominant frequency in adjacent time segments, determine the change direction and mark it as rising or falling, count the number of consecutive changes with the same direction, divide the continuous segments according to the direction switching position, and generate a dominant frequency change direction labeling sequence. S303: Based on the dominant frequency change direction labeling sequence, determine whether the direction state has a consistent direction for consecutive times, count the duration of consecutive direction segments and use it as the basis for judging the frequency drift trend, calculate the intensity value of consecutive segments, calculate the rate of change by combining the frequency difference of the dominant frequency in adjacent time segments, and generate a dominant frequency trend stability parameter set. S304: Based on the dominant frequency trend stability parameter set, determine the consistency of trend direction between the dominant frequency change rate and the meditation degree reference rate, mark the time segment that conforms to the trend consistency relationship, extract the corresponding dominant frequency change pattern sequence as the linkage feature segment, and generate the meditation dominant frequency drift linkage result.
[0009] As a further aspect of the present invention, the intensity value of the continuous section is determined by the formula: ; in, Represents the intensity value of a continuous section. This represents the number of consecutive directional segments within a statistical period. Representing the The directional amplitude of the dominant frequency variation direction within a continuous directional segment Representing the The duration of a continuous directional segment's frame length Representing the Frequency difference of dominant frequency variation within a continuous directional segment Representing the The number of directional state reversals within a continuous directional segment.
[0010] As a further aspect of the present invention, the step of acquiring the directional synergistic sleep-aid signal specifically includes: S401: Based on the results of the meditation-dominant frequency drift linkage, the frequency drift direction within the segment identified as having a consistent dominant frequency trend is matched with the pre-set sleep-aid transition feature direction. The direction matching segments are filtered, and it is determined whether the duration meets the continuity condition. Candidate segments entering the state are marked, and a set of candidate segment markers for the sleep-aid transition state is generated. S402: Call the candidate segment marker set of the sleep-aid transition state, retrieve the synchronous recording data of the EEG signals of the left and right hemispheres within the corresponding time period, respectively count the activity level of the amplitude change of the EEG signals in the left and right channels, adjust the phase difference and time delay value parameters of the signal output of the left and right channels, and generate the left and right ear output adjustment parameter set. S403: Using the set of left and right ear output adjustment parameters, load the adjusted left and right channel signal waveform data respectively within the time segment corresponding to the sleep-aid transition state, perform time synchronization processing and signal synthesis, and generate a directional collaborative sleep-aid signal.
[0011] As a further aspect of the present invention, the method further includes step S5: S5: Based on the directional and coordinated sleep aid signal, monitor the trend of the combined amplitude change of delta wave and theta wave, and combine the continuity of the combined amplitude increase to determine whether the sleep aid state is stable. If stable, adjust the sound pressure level, frequency distribution, light intensity and color temperature in the sleep aid environment, complete the environment mode switch, and generate the sleep aid environment switching execution state. The sleep-aid environment switching execution status includes sound pressure adjustment range, light change parameters, and mode switching label.
[0012] As a further aspect of the present invention, the step of obtaining the sleep-aid environment switching execution state specifically includes: S501: Based on the directional synergistic sleep aid signal, extract the EEG response records of the corresponding frequency bands of delta waves and theta waves under the action of the synergistic signal, calculate the total combined amplitude of delta waves and theta waves within the time segment, record the amplitude change trend according to the time sequence, combine the continuity of the combined amplitude change direction of adjacent segments, screen the segments with consistent change direction and the degree of continuity, and generate a combined amplitude continuous increase identification sequence. S502: Call the joint amplitude continuous amplification identifier sequence to determine whether the amplitude continuous change segment meets the stability characteristics. If it does, adjust the sound pressure level, frequency distribution, light intensity and color temperature parameters respectively, and mark the configuration status output as executed to generate the sleep aid environment switching execution status.
[0013] On the other hand, the brainwave feedback-based meditation-assisted sleep system is used to perform the aforementioned brainwave feedback-based meditation-assisted sleep method, and the system includes: The EEG interval recognition module acquires the raw EEG signal data of the frequency band set by the user's cerebral cortex for the meditation state, records the peak and trough positions corresponding to the amplitude, and updates the boundary information of the meditation detection segment by calling the peak positions of two adjacent time segments, thereby generating the EEG signal monitoring interval for the meditation state. The micro-variation structure extraction module extracts waveform amplitude value points within continuous segments as trough positions based on the EEG signal monitoring interval of the meditation state, compares the difference between the trough positions of the segments to determine the directional change, accumulates the number of times the directional consistency is consistent to determine the micro-variation stable segment, and generates brainwave micro-variation structure tracking results. The dominant frequency tracking module calls the dominant frequency value of the brainwave micro-variation structure tracking result, obtains the frequency change direction of adjacent time periods, counts the number of consecutive directions and judges whether it is stable, and generates the meditation dominant frequency drift linkage result. The linkage signal module obtains the signal activity values of the left and right hemispheres based on the linkage result of the meditation-dominant frequency drift, and adjusts the output signals of the left and right channels by combining the signal phase difference and time delay parameters to generate a directional and coordinated sleep-aiding signal. Based on the directional and coordinated sleep-aid signal, the environmental adjustment response module monitors the continuity of the combined amplitude increase of delta waves and theta waves, and determines whether it stably exceeds the sleep-aid threshold. If it does, it adjusts the sound pressure level, frequency distribution, light intensity, and color temperature value according to the target set range, generating a sleep-aid environment switching execution state.
[0014] The beneficial effects of the technical solutions provided in the embodiments of the present invention include at least the following: By dynamically identifying the peak and trough trends of EEG signals and continuously judging the direction of frequency drift, the system can precisely track changes in brain state. Based on the linkage between dominant frequency and meditation level, it identifies changes in meditation depth. With the real-time perception of hemispheric activity differences and the linkage regulation of auricular acoustic signal parameters, it can effectively achieve targeted neurofeedback intervention. At the same time, it drives multi-dimensional adjustments of sleep-aiding environmental elements in a stable state, forming a closed-loop structure of electrophysiological signal-frequency feedback-environment linkage. This mechanism enables continuous monitoring and rhythmic guidance of the entire process of meditation-induced sleep, enhances the accuracy and feedback effect of brain state regulation, and effectively improves the synchronous adaptability and dynamic response capability of meditation guidance and sleep-aiding intervention. Attached Figure Description
[0015] Figure 1 This is a schematic diagram of the workflow of the present invention; Figure 2 This is a system flowchart of the present invention. Detailed Implementation
[0016] The technical solution of the present invention will now be described with reference to the accompanying drawings.
[0017] In embodiments of the present invention, words such as "exemplarily," "for example," etc., are used to indicate that something is an example, illustration, or description. Any embodiment or design described as "exemplary" in the present invention should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of the word "exemplary" is intended to present the concept in a concrete manner. Furthermore, in embodiments of the present invention, the meaning expressed by "and / or" can be both, or either one.
[0018] To make the technical problems, technical solutions and advantages of the present invention clearer, a detailed description will be given below in conjunction with the accompanying drawings and specific embodiments.
[0019] Please see Figure 1 This invention provides a meditation-based sleep aid method based on brainwave feedback. The processing flow of this method may include the following steps: S1: Obtain the raw data of EEG signals in the frequency band set by the user's cerebral cortex for the meditation state, extract the peak and trough amplitudes, call the amplitude peak positions of adjacent time segments, identify the trend of peak position changes, and adjust the upper and lower boundaries of the detection interval based on the consistency of the change trends of three consecutive time segments to generate the EEG signal monitoring interval for the meditation state. S2: Using the EEG signal monitoring interval in a meditative state, extract weak amplitude change data within a continuous time segment, identify the trough position, analyze the direction of change of the trough position, accumulate the change trend of the time segment, determine the stable interval of the micro-structure, and obtain the brainwave micro-structure tracking results. S3: By tracking the brainwave micro-change structure, extract the dominant frequency data in the continuous time segment of the alpha and theta wave boundary region of the cerebral cortex, call the dominant frequency change direction of adjacent time segments, count the number of consecutive changes in the change direction, judge the directional stability of the dominant frequency drift trend, and combine the dominant frequency change rate with the reference rate of meditation level to identify the linkage characteristics between dominant frequency drift and meditation level in the meditation state, and generate the meditation dominant frequency drift linkage result; S4: Utilize the results of the frequency drift linkage of meditation to determine whether a transitional state of meditation-assisted sleep has been entered, obtain the difference in the activity state of the left and right hemisphere EEG signals, adjust the phase difference and time delay of the left and right ear signals, execute the left and right ear coordinated signal output, and generate a directional coordinated sleep-aid signal. S5: Based on the directional and collaborative sleep aid signal, monitor the trend of the combined amplitude change of delta waves and theta waves, and combine the continuity of the combined amplitude increase to determine whether the sleep aid state is stable. If stable, adjust the sound pressure level, frequency distribution, light intensity and color temperature in the sleep aid environment, complete the environment mode switch, and generate the sleep aid environment switching execution state. The EEG signal monitoring range includes frequency band boundaries, peak trend direction, and range adjustment coefficient. The EEG micro-change structure tracking results include trough trajectory lines, number of changes, and micro-change trend indicators. The meditation-dominant frequency drift linkage results include drift direction labels, rate deviation, and linkage strength index. The directional and coordinated sleep aid signals include phase matching degree, ear-side time delay difference, and output sound wave combination structure. The sleep aid environment switching execution status includes sound pressure adjustment amplitude, light change parameters, and mode switching labels.
[0020] The specific steps for obtaining the EEG signal monitoring region are as follows: S101: Obtain raw EEG signal data of the frequency band set by the user's cerebral cortex for the meditation state, extract the peak and trough amplitude values within the time segment, record the amplitude position corresponding to the peak and trough based on the difference between the peak and trough amplitude values in the same time segment, and group and organize the amplitude values of multiple consecutive time segments to obtain amplitude extreme value distribution data. Raw EEG signal data with a frequency between 140Hz was acquired using EEG acquisition devices (such as NeuroSky and Emotiv). During the meditative state, the focus was on alpha waves (813Hz) and theta waves (4~8Hz). The sampling frequency could be set to 256Hz to meet signal processing accuracy requirements. The data acquisition time segment could be set in 10-second intervals for easier processing. Peak and trough points within each 10-second data segment were extracted. A sliding window method (such as a 5-point moving average) was applied to each sampling point for noise reduction. Then, the slope of the voltage change was calculated using the differential method, and the extreme values of positive and negative changes were identified as peaks and troughs. For example, in a certain segment, peaks and troughs were identified at 2.3 seconds, 3.1 seconds, and 4.0 seconds. The peak amplitude values are 5.1μV, 5.8μV, and 6.2μV, respectively, and the corresponding trough values are 2.9μV, 2.4μV, and 2.7μV. The peak-to-trough differences are 3.1μV, 3.4μV, and 3.5μV. The time indices corresponding to the peak and trough values (e.g., sampling point numbers 590, 796, and 1024) are extracted, and the position of the segment is recorded. The peak and trough values of multiple time segments are grouped into groups of 10 seconds. The DataFrame structure can be organized using the pandas library in Python to form an array containing the peak-to-trough difference in each group, such as [3.1, 3.4, 3.5]μV, which corresponds to the time index array to obtain the amplitude extreme value distribution data.
[0021] S102: Based on the amplitude extreme value distribution data, call the time index position corresponding to the amplitude peak in each time segment, calculate the time interval between peak positions between adjacent time segments, filter sample positions where the time interval change exceeds the average time span of adjacent segments, and generate a wave peak shift position trend sequence. Extract the sampling point index corresponding to the maximum peak value within each group. For example, if the peak indexes within each 10-second segment are 590, 796, and 1024, calculate the sampling point interval Δi between two adjacent peak indices. Set Δi1 = 796 - 590 = 206 points and Δi2 = 1024 - 796 = 228 points. Convert these to time intervals. Set the sampling rate to 256Hz, then Δt1 = 206 / 256 ≈ 0.80 seconds and Δt2 = 228 / 256 ≈ 0.89 seconds. Calculate the mean of the time interval μ = (0 (0.80 + 0.89) / 2 ≈ 0.845 seconds. Using this average as a benchmark, filter the sample positions where the time interval difference between adjacent segments exceeds the average. The judgment criterion is |Δt2 - μ| > σ, where σ can be set as a threshold (e.g., 0.05 seconds). If Δt2 - μ = 0.045 seconds, the condition is not met, so no filtering is performed. If a segment has Δt3 = 1.12 seconds, then Δt3 - μ = 0.275 seconds > 0.05 seconds, and it is marked as a peak offset position. This position is indexed and recorded as an offset event, generating a peak offset position trend sequence.
[0022] S103: Based on the trend sequence of peak position shift, determine the consistency of the change direction of the peak position shift in three consecutive time segments, and classify the position indexes of the three consecutive segments with the same change direction into the trend consistency interval range, which serve as the lower and upper boundaries of the detection interval, and generate the EEG signal monitoring interval for the meditation state. To determine the consistency of the peak position shift direction changes in three consecutive time segments, a sliding window evaluation is performed on the offset Boolean value sequence corresponding to each of the three positions. For example, if the current sequence is [False, False, True, False, True, True], then [False, False, True], [False, True, False], [True, False, True]... are selected and evaluated sequentially. In each group, it is determined whether "all are True" or "all are False". If they are consistent, the window is marked as a trend consistency interval. [True, True, True] is set to correspond to segments 3, 4, and 5. The lower boundary is recorded as the start time of segment 3, and the upper boundary is recorded as the end time of segment 5, forming a trend consistency monitoring interval. If each segment is 10 seconds, then the interval is 30 seconds, corresponding to the consistency feature segment of the peak position shift trend in the EEG signal, generating the EEG signal monitoring interval for the meditation state.
[0023] The specific steps for obtaining the brainwave micro-variation structure tracking results are as follows: S201: Based on the monitoring interval of EEG signals in meditation state, extract the set of amplitude fluctuation values in continuous time segments, remove amplitude points that exceed the boundary of the monitoring interval, retain amplitude change data within the interval, record the low amplitude position and time index in each time segment, mark the trough position in continuous time segments, and generate a weak amplitude trough index sequence. The process involves extracting continuous time segments of 10 seconds each within the EEG signal monitoring interval during meditation. Using previously compiled raw EEG data sampled at 256 times per second, all amplitude points within each segment are evaluated. The monitoring interval is set to start and end indices, such as 1024 to 5632 points. Logical conditions are used to filter the amplitude array of each segment, removing data points outside this range (amplitude values below 1024 or above 5632) using a Boolean mask, retaining only the amplitude sequence within the range. The lowest amplitude point within each segment is then used as the trough. In each 10-second segment of 2560 data points, the point with the lowest voltage value is found. The lowest point in a certain segment is set to appear at the 1310th sampling point, corresponding to a time of 1310 / 256≈5.12 seconds. This point is recorded as the trough position of that segment. The segments are traversed in this way, and the trough time index is recorded to form a time series such as [5.12, 15.68, 25.00, 35.21] seconds. If the amplitude value corresponding to the above index is less than 3μV, it constitutes a weak amplitude feature, which is used for subsequent trough trend direction analysis to generate a weak amplitude trough index sequence.
[0024] S202: Call the weak amplitude trough index sequence, make directional judgment on the time index of adjacent trough positions, determine the direction of change based on the positive or negative difference of the index value, organize the directional state in the continuous time segment into an ordered symbol sequence, identify the points where the direction changes repeatedly, remove samples that switch directions within the local variation range, and generate a trough offset direction mapping sequence. The difference between two adjacent trough index time points is calculated sequentially, and the sign is determined to identify the trough offset direction. The index sequence is set as [5.12, 15.68, 25.00, 24.25, 33.85], then the difference is [10.56, 9.32, -0.75, 9.6] seconds. A positive value indicates the trough is shifted backward, and a negative value indicates the trough is shifted forward. The corresponding direction state can be organized into a symbol sequence such as ["+", "+", "-", "+"]. This symbol sequence is smoothed to exclude repeated changes within a small local area. For example, in a sequence of ["+", "-", "+"], "-" represents a short-term reversal. Combining adjacent symbols and using a window length of 3, it is determined whether the center direction is inconsistent with the two sides. If so, the center sample point is removed. Here, the trough pair represented by "-" is removed, leaving a continuous and consistent direction symbol sequence ["+", "+"]. A trough offset direction mapping sequence is generated.
[0025] S203: Based on the trough offset direction mapping sequence, accumulate the number of time segments with the same continuous direction, select time segments with consistent continuous direction, call the trough time index difference in the corresponding segment, calculate the consistency index value of the trough spacing change, mark the continuous segments with stable trough spacing change amplitude, and obtain the brainwave micro-change structure tracking results. The consistency index value of the trough spacing variation is calculated using the following formula: ; in, The consistency index value of the change in the trough spacing within the time interval t. This represents the distance between the i-th trough index and the previous trough index in time interval t. This represents the average value of the trough index spacing values within the time interval t. The length of the j-th consecutive time segment with the same direction in time interval t. represents the average length of consecutive time segments with the same direction in time interval t, n represents the number of trough index differences in time interval t, and m represents the number of consecutive time segments with the same direction in time interval t. Formula calculation logic explanation: By calculating the difference between each trough spacing value and the average trough spacing, and multiplying it by the standard deviation of the length of a continuous time segment in the same direction, the consistency of the trough spacing variation is reflected. The calculation of each... and The difference reflects the degree of deviation between the individual trough spacing and the average value. (Calculation) The standard deviation reflects the variability of the length of a continuous, uniform time segment. Multiplying the two results in the product of the variation in the spacing between each trough and the variability of the length of the continuous, uniform time segment. Taking the absolute value of the product and averaging it yields the result. As an indicator of the consistency of the variation in the trough spacing; Parameter definition and acquisition methods: Time segment The Middle The interval between the first trough index and its preceding trough index, in milliseconds (ms), is calculated using the difference in timestamps of troughs in the electroencephalogram (EEG) signal. For example, if the first trough index... The first trough occurs at 120ms, and the previous trough occurs at 100ms. ms; Time segment The average value of the mid-wave valley index spacing is calculated by measuring the interval within this segment. The arithmetic mean is obtained; Time segment The Middle The length of a continuous, directionally consistent time segment is measured in milliseconds (ms). By analyzing the mapping sequence of the trough offset direction, segments with continuous, directional consistency are identified, and their durations are calculated. If the duration of a segment with continuous, directional consistency is 50 ms, then... ms; Time segment The average length of a continuous time segment with consistent direction is calculated within that segment. The arithmetic mean is obtained; The number of trough index differences within a time interval, i.e. The total number; Time segment The number of consecutive time segments with consistent directions within the same area, i.e. The total number, Actual data example calculation: Set in a certain time period The following data was collected: Valley timestamps (ms): 100, 120, 140, 160, 180, 200; Calculate: 20, 20, 20, 20, 20; ms; Length of consecutive directionally consistent time segments (ms): 50, 60, 55, 65, 70; ms; calculate ; Standard deviation ms; because ms, and ms, therefore ; Substitute into the formula to calculate: ; The results indicate that the variation in the trough spacing is highly consistent within this time period, and the variation amplitude remains stable.
[0026] Table 1: Data on the Length of Time Segments with Consistent Direction Between Valley Spacing
[0027] As shown in Table 1, the trough spacing remains consistent, while the length of the continuous direction time segment fluctuates slightly, resulting in... A value of 0 indicates that the variation in the trough spacing is highly consistent; The benefits of the formula are: by introducing the standard deviation of the length of continuous directional consistent time segments, it comprehensively considers the changes in the trough spacing and directional consistency, providing a more comprehensive consistency index of the trough spacing changes, and enhancing the ability to track the micro-changes in brainwave structure.
[0028] The specific steps for obtaining the results of the meditation-dominant frequency drift linkage are as follows: S301: Based on the results of brainwave micro-variation structure tracking, extract the continuous time segment corresponding to the boundary region between alpha and theta waves in the cerebral cortex, call the frequency corresponding to the amplitude peak as the dominant frequency, and record the corresponding time index position to generate the dominant frequency sequence of the boundary region. Focusing on the frequency band boundary between alpha waves (8–13 Hz) and theta waves (4–8 Hz), specifically using a frequency range of 8 Hz or fluctuating by 0.5 Hz (e.g., 7.5–8.5 Hz) as the boundary, the corresponding raw EEG signal is extracted from each confirmed micro-variable structural segment. The time-domain signal is converted to the frequency domain using Fast Fourier Transform (FFT). The FFT operation calculates the spectrum of each 2560-point (corresponding to 10-second) segment, and the dominant frequency is obtained by analyzing the frequency point with the largest amplitude in the spectrum. If the FFT analysis of a certain segment shows an amplitude of 6.4 μV at 7.8 Hz, which is higher than the amplitude of the adjacent frequency points, then this frequency is recorded as the dominant frequency of that segment, and its sampling index position is recorded, such as point 2245 (approximately 8.77 seconds). This operation is repeated to traverse the boundary region segments, generating a sequence of dominant frequencies in the boundary region.
[0029] S302: Call the dominant frequency sequence of the boundary region, compare the change relationship of the dominant frequency in adjacent time segments, determine the direction of change and mark it as rising or falling, count the number of consecutive changes with the same direction, divide the continuous segments according to the direction switching position, and generate a dominant frequency change direction labeling sequence. By comparing the changing trends of the dominant frequency within adjacent time intervals, the sequence is set as [7.8Hz, 8.2Hz, 8.0Hz, 7.9Hz]. The direction of change is determined by calculating the difference between adjacent values: Δf1=8.2-7.8=+0.4Hz (increasing), Δf2=8.0-8.2=-0.2Hz (decreasing), Δf3=7.9-8.0=-0.1Hz (decreasing), and the direction sequence is marked as ["↑", "↓", "↓"]. Then, the number of consecutive identical directions is counted. For example, if the second and third segments are both decreasing directions, the number of consecutive directions is 2. The direction state switching point (such as ↑→↓) is used as the dividing node of the continuous segment, dividing the dominant frequency change direction segment as: [↑], [↓, ↓], generating the dominant frequency change direction marking sequence.
[0030] S303: Based on the dominant frequency change direction labeling sequence, determine whether the direction state has a consistent direction for consecutive times, count the duration of consecutive direction segments and use it as the basis for judging the frequency drift trend, calculate the intensity value of consecutive segments, calculate the rate of change by combining the frequency difference of the dominant frequency in adjacent time segments, and generate a set of dominant frequency trend stability parameters. The strength value of a continuous section is calculated using the following formula: ; in, Represents the intensity value of a continuous section. This represents the number of consecutive directional segments within a statistical period. Representing the The directional amplitude of the dominant frequency variation direction within a continuous directional segment Representing the The duration of a continuous directional segment's frame length Representing the Frequency difference of dominant frequency variation within a continuous directional segment Representing the Number of directional state reversals within a continuous directional segment; Formula calculation logic: In this formula, the summation symbol... Indicates the period within the statistical period The cumulative calculation is performed on each continuous directional segment, and the core calculation logic is reflected in three parts: first, the absolute value term. The first is used to uniformly handle differences in the sign of directional amplitude and participate in intensity measurement; the second is the square root term. The scale adjustment of the fluctuation size is achieved by multiplying the duration length and the frequency difference together and then taking the square root; the third is the correction term. For segments with high frequency of directional reversals, a reverse penalty is applied to prevent irrational increases in intensity values. The denominator term... Prevent division by zero errors and adjust the penalty level according to the directional intensity; Parameter meaning and formula calculation: Directional amplitude: Direction is a non-numerical variable. The trend direction is first calculated based on the positive or negative change of the dominant frequency, with a positive value set to +1 and a negative value to -1. This value is obtained by analyzing the dominant frequency of each frame. Calculation of difference with the previous frame Then, the frames are divided into segments. If consecutive frames have the same direction, they form a directional segment. If the frame differences within a segment are all greater than zero, then the corresponding... Conversely, it is -1, and when participating in formulas, it is always introduced by absolute value; : Continuous frame length, the number of frames within each segment. If the direction is kept consistent from frame 102 to frame 108, then this value is... frame; Frequency difference, the starting frame frequency of the segment is The end frame frequency is Then there is If the starting frequency of a certain segment is set to 245.7Hz and the ending frequency to 249.3Hz, then the frequency difference of this segment is... Hz; : Number of direction state reversals. This counts the number of micro-direction reversals within each segment, i.e., the frequency of repeated oscillations based on the main direction. This value is obtained by calculating and accumulating direction changes within a small time window (e.g., 3 frames). Setting it to two micro-reversals within a segment... ; For example, using three consecutive segments in three directions as samples, the data is shown in the table below: Table 2: Parameter Table for Continuous Directional Sections
[0031] Based on the data shown in Table 2, calculate the following indicators: First section: , , ; Single value: ; Second section: , , ; Single value: ; Third section: , , ; Single value: ; Substitute into the formula to calculate: ; The results show that the continuous segment intensity value is 4.37. Compared with the preset segment intensity benchmark value, based on existing literature and practical signal evaluation experience, in continuous frequency drift detection, It belongs to the medium fluctuation range. If it exceeds this range, it is judged as an abnormal trend. The benchmark value is set at 4.0, which indicates that the continuous drift amplitude is high and there is a sudden change in trend. The results indicate that the dominant frequency exhibits a moderately high intensity drift characteristic within continuous directional segments, which can be used as an input feature parameter for judging the stability of the dominant frequency trend. The advantage of the formula lies in introducing the number of direction state reversals. As a penalty factor, the intensity evaluation of segments with high-frequency fluctuations in a short period of time is reduced. At the same time, the square root adjustment is made in combination with the segment length and frequency drift to avoid bias caused by extremely long segments, effectively integrating the four factors of direction, amplitude, persistence and stability.
[0032] S304: Based on the dominant frequency trend stability parameter group, the trend direction consistency between the dominant frequency change rate and the meditation degree reference rate is judged, and the time segment that conforms to the trend consistency relationship is marked. The corresponding dominant frequency change pattern sequence is extracted as the linkage feature segment, and the meditation dominant frequency drift linkage result is generated. The rate of change in each group was compared with the standard frequency drift rate in the meditation state. The standard value, referencing the observation results in the EEG experiment, can be set to ±0.01 Hz / s. If the rate of change falls within this range, the trend is considered stable. A certain group of rate of change was set to [-0.00991, -0.00876] Hz / s. All of them were within the range of [-0.01, 0.01] Hz / s, indicating that the trend of this segment was stable. It was then determined whether the direction was consistent with the meditation state. If the experiment set the frequency trend in the meditation state to be characterized by a slow decrease (direction '↓'), then this segment was marked as a segment with a consistent trend. All segments with consistent trends were screened in this way, and the dominant frequency change pattern in the segment was extracted, such as [8.2→8.0→7.9] Hz, corresponding to the time index [18.88, 29.03, 39.12] seconds, generating the meditation dominant frequency drift linkage result.
[0033] The specific steps for obtaining targeted and synergistic sleep-inducing signals are as follows: S401: Based on the results of the frequency drift linkage of the dominant frequency in meditation, the frequency drift direction in the segment marked as having the same dominant frequency trend is matched with the pre-set sleep-aid transition feature direction, the direction matching segment is filtered, and it is determined whether the duration meets the continuity condition, the candidate segment of entering the state is marked, and a set of candidate segment labels for the sleep-aid transition state is generated. The process involves extracting dominant frequency data from recorded EEG signals using a sliding window. A 5-second window is used, and the frequency with the highest power spectral density within the window is identified as the dominant frequency point. Differential processing is then performed on the dominant frequency sequence within consecutive windows to identify the direction of frequency change. If the frequency change Δf value is negative across consecutive windows, the segment is considered a frequency decline trend segment. A minimum duration requirement (no less than 30 seconds) is set for each segment with a consistent direction to initially screen out interfering segments. Based on the established sleep-inducing transition characteristic direction, a slow frequency decline is set as the standard direction. By matching the Δf of each segment in the dominant frequency sequence with the set direction segment by segment, only the sequence segments that are close to the set direction are retained. At the same time, the duration of these segments is statistically analyzed. When a continuous segment is consistent with the target direction and the duration meets the preset condition, the segment is marked as a candidate segment for entering the state. If it is found that the dominant frequency drops steadily from 6.2Hz to 5.5Hz from the 60th to the 100th second, and the trend of the set target frequency change is consistent with the determination condition of a duration of 40 seconds, then the segment is marked as a candidate segment for the sleep-aid transition state, and a set of candidate segment labels for the sleep-aid transition state is generated.
[0034] S402: Call the candidate segment marker set for sleep transition state, retrieve the synchronous recording data of EEG signals of the left and right hemispheres within the corresponding time period, respectively count the activity level of amplitude changes of EEG signals in the left and right channels, adjust the phase difference and time delay parameters of the signal output of the left and right channels, and generate the left and right ear output adjustment parameter set. EEG signal data from the left and right hemispheres within this time period are extracted. The original waveforms of the left and right channels are acquired and divided into small segments for statistical processing. The left and right channel signals are divided into segments every 1 second. The difference between the maximum and minimum amplitudes within each segment is calculated as the amplitude change value within that second. This is then accumulated across the entire candidate segment to statistically analyze the overall amplitude change trend of the left and right channels. By comparing the accumulated amplitude change values, it is determined which channel is more active. If the accumulated change value of the left channel is 280μV and that of the right channel is 180μV, the left channel is considered more active. Based on the difference in activity between the channels, the phase difference and time delay value between the left and right signals are calculated. A sliding correlation window is used to detect the lag time corresponding to the maximum correlation coefficient as the natural time delay between the left and right channels. Then, during output, the start time of loading the left and right signals and the waveform phase angle are finely adjusted to synchronize the output signals on both sides on the time axis and phase axis, generating a set of left and right ear output adjustment parameters.
[0035] S403: Utilizing the left and right ear output adjustment parameter sets, within the time segment corresponding to the sleep-aid transition state, load the adjusted left and right channel signal waveform data respectively, perform time synchronization processing and signal synthesis, and generate a directional and coordinated sleep-aid signal; Within the corresponding sleep-aid transition candidate time period, the delay and phase information from the parameter set are invoked to load the original signal onto the modulation device. A positive delay is introduced into the left ear signal, and a negative delay is introduced into the right ear signal, so that their center time points coincide. Based on this, the relative phase angle of the left and right ear audio signals is adjusted through the phase correction module. If there is a 90-degree phase difference between the original signals, compensation is performed according to the target phase difference set in the parameter set, so that the signal reaches the target coordinated state at output. After processing, the left and right signals are loaded into the audio output device respectively. During loading, a time axis alignment mechanism is used to ensure that the signal starting point is consistent and to prevent phase interference. At the same time, the processed signals are synthesized and output as an audio data stream of coordinated left and right ear, forming a signal pair that meets the current EEG state regulation requirements. Within a certain sleep-aid state segment, the 5.2Hz waveform signal output from the left ear, after time delay and phase processing, forms effective interference with the 5.2Hz waveform signal output from the right ear, constructing a stable dual-channel coordinated output and generating a directional coordinated sleep-aid signal.
[0036] The specific steps for obtaining the execution state of the sleep-aid environment switching are as follows: S501: Based on the directional synergistic sleep aid signal, extract the EEG response records of the corresponding frequency bands of delta waves and theta waves under the action of synergistic signals, calculate the total combined amplitude of delta waves and theta waves within a time segment, record the amplitude change trend according to the time series, combine the continuity of the direction of the combined amplitude change of adjacent segments, screen segments with the same direction of change and the degree of continuity meet the conditions, and generate a continuous increase in the combined amplitude identification sequence. Extract EEG response signal data within the corresponding time period, focusing on the signal responses of the delta wave (0.5Hz–4Hz) and theta wave (4Hz–8Hz) frequency bands. These two frequency bands can be filtered out using bandpass filters. Energy or amplitude statistics are performed on delta and theta waves within each time segment. The time is divided into equal-length segments, such as 5 seconds each. The average amplitude of delta and theta waves within each segment is calculated, and the combined amplitude is calculated. The combined amplitude Atotal = Aδ + Aθ is set to generate a combined amplitude sequence including timestamps. The amplitude variation trend of this sequence is analyzed, and the combined amplitude of adjacent time periods is compared. The difference is calculated to determine the direction of change (upward or downward). The trend sequence is recorded based on the direction of change. If the direction of change is consistent in multiple consecutive segments (e.g., the combined amplitude continues to rise in five consecutive 5-second segments) and meets the set minimum continuity condition (e.g., at least 4 rises within 25 seconds), then the segment is marked as a segment with continuous increase in combined amplitude. A marker sequence is then generated, which includes the start and end times of each segment and information on the increase in amplitude. If the combined amplitude rises from 10μV to 17μV in the interval from 100 seconds to 150 seconds, increases uniformly, and no downward segments appear, then the segment is marked into the continuous increase in combined amplitude marker sequence.
[0037] S502: Call the joint amplitude continuous amplification identifier sequence to determine whether the amplitude continuous change segment meets the stability characteristics. If it does, adjust the sound pressure level, frequency distribution, light intensity and color temperature parameters respectively, and mark the configuration status output as executed, and generate the sleep aid environment switching execution status. The system iterates through the identified segments and assesses the stability of amplitude changes in each segment. Stability can be analyzed using the mean and standard deviation of amplitude changes. If the mean amplitude change is greater than a set threshold (e.g., 0.5μV / 5s) and the standard deviation is less than a set upper limit (e.g., 0.2μV), the segment is considered to have small fluctuations and stable increases, meeting subsequent control conditions. Once a segment meets the stability characteristics, a multi-parameter synchronous adjustment of the current sleep-aid environment is triggered, including a slight reduction in sound pressure level (set to decrease by 1dB every 5 seconds to a specified lower limit), a slight shift in frequency distribution towards lower frequencies (set to lower the ambient background frequency center from 500Hz to 400Hz), and a reduction in light intensity (e.g., from 30lx). The brightness is adjusted to 15 lx, and the color temperature is adjusted accordingly (e.g., from 4000K to 3200K to simulate dusk). Each parameter adjustment has a set dynamic control function to limit its rate of change and minimum adjustable range to avoid drastic changes. For example, the brightness change adopts a linear gradual decrease of 3 lx per second. Once the above operation is started, the current configuration status is automatically recorded as "executed" and an environment switching status signal is output for external devices to perform corresponding operations. This realizes the time linkage between the EEG response enhancement segment and the environmental status control. If the amplitude increase is detected to be stable at 150 seconds, the light and sound pressure levels will be gradually reduced within 150–180 seconds to generate the sleep-aid environment switching execution status.
[0038] Please see Figure 2 A brainwave feedback-based meditation and sleep aid system, comprising: The EEG interval recognition module acquires the raw EEG signal data of the frequency band set by the user's cerebral cortex for the meditation state, records the peak and trough positions corresponding to the amplitude, and updates the boundary information of the meditation detection segment by calling the peak positions of two adjacent time segments, thereby generating the EEG signal monitoring interval for the meditation state. The micro-variation structure extraction module is based on the monitoring interval of EEG signals in the meditation state. It extracts the waveform amplitude value points in continuous segments as the trough positions, compares the difference of the trough positions of the segments to determine the directional change, accumulates the number of times the direction is consistent to determine the micro-variation stable segment, and generates brainwave micro-variation structure tracking results. The dominant frequency tracking module calls the dominant frequency value of the brainwave micro-variation structure tracking results, obtains the frequency change direction of adjacent time periods, counts the number of consecutive directions and judges whether it is stable, and generates the meditation dominant frequency drift linkage result. The linkage signal module obtains the signal activity values of the left and right hemispheres based on the drift linkage results of the meditation-dominant frequency. Combining the signal phase difference and time delay parameters, it shifts and adjusts the amplitude of the output signals of the left and right channels to generate a directional and coordinated sleep-aiding signal. The environmental adjustment response module monitors the continuity of the combined amplitude increase of delta waves and theta waves based on the directional and coordinated sleep-aid signal, and determines whether it stably exceeds the sleep-aid threshold. If so, it adjusts the sound pressure level, frequency distribution, light intensity, and color temperature value according to the target set range, generating a sleep-aid environment switching execution state.
[0039] The above are merely specific embodiments of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A meditation-based sleep aid method based on brainwave feedback, characterized in that, Includes the following steps: S1: Obtain the raw data of EEG signals in the frequency band set by the user's cerebral cortex for the meditation state, extract the peak and trough amplitudes, call the amplitude peak positions of adjacent time segments, identify the trend of peak position changes, adjust the upper and lower boundaries of the detection interval, and generate the EEG signal monitoring interval for the meditation state. S2: Using the brainwave signal monitoring interval of the meditation state, extract the weak amplitude change data in continuous time segments, identify the trough position, analyze the direction of trough position change, determine the stable interval of the micro-structure, and obtain the brainwave micro-structure tracking result. S3: Based on the brainwave micro-change structure tracking results, extract the dominant frequency data in the continuous time segment of the alpha and theta wave boundary region of the cerebral cortex, call the dominant frequency change direction of adjacent time segments, count the number of consecutive changes in the change direction, and generate the meditation dominant frequency drift linkage result. S4: Using the results of the meditation-dominant frequency drift linkage, determine whether the transitional state of meditation-assisted sleep is entered, obtain the difference in the activity state of the left and right hemisphere EEG signals, adjust the phase difference and time delay of the left and right ear signals, execute the left and right ear coordinated signal output, and generate a directional coordinated sleep-aid signal.
2. The meditation-based sleep aid method according to claim 1, characterized in that, The EEG signal monitoring interval includes frequency band interval boundaries, peak trend direction, and interval adjustment coefficient. The EEG micro-change structure tracking results include trough trajectory lines, number of changes, and micro-change trend indicators. The meditation-dominant frequency drift linkage results include drift direction labels, rate deviation, and linkage strength index. The directional and collaborative sleep aid signal includes phase matching degree, ear-side time delay difference, and output sound wave combination structure.
3. The meditation-based sleep aid method according to claim 1, characterized in that, The specific steps for obtaining the EEG signal monitoring interval are as follows: S101: Obtain raw EEG signal data of the frequency band set by the user's cerebral cortex for the meditation state, extract the peak and trough amplitude values within the time segment, record the amplitude position corresponding to the peak and trough based on the difference between the peak and trough amplitude values in the same time segment, and group and organize the amplitude values of multiple consecutive time segments to obtain amplitude extreme value distribution data. S102: Based on the amplitude extreme value distribution data, call the time index position corresponding to the amplitude peak in each time segment, calculate the time interval between peak positions between adjacent time segments, filter sample positions where the time interval change exceeds the average time span of adjacent segments, and generate a wave peak shift position trend sequence. S103: Based on the trend sequence of the peak offset position, determine the consistency of the change direction of the peak position offset in three consecutive time segments, and classify the position indexes with the same change direction in the three consecutive segments into the trend consistency interval range, which serves as the lower and upper boundaries of the detection interval, thereby generating the EEG signal monitoring interval for the meditation state.
4. The meditation-based sleep aid method according to claim 1, characterized in that, The specific steps for obtaining the brainwave micro-variation structure tracking results are as follows: S201: Based on the EEG signal monitoring interval of the meditation state, extract the set of amplitude fluctuation values in continuous time segments, remove amplitude points that exceed the boundary of the monitoring interval, retain amplitude change data within the interval, record the low amplitude position and time index in each time segment, mark the trough position in continuous time segments, and generate a weak amplitude trough index sequence. S202: Call the weak amplitude trough index sequence, make directional judgment on the time index of adjacent trough positions, determine the direction of change based on the positive or negative difference of the index value, organize the directional state in the continuous time segment into an ordered symbol sequence, identify the points where the direction changes repeatedly, remove samples that switch directions within the local variation range, and generate a trough offset direction mapping sequence. S203: Based on the trough offset direction mapping sequence, accumulate the number of time segments with the same continuous direction, select time segments with consistent continuous direction, call the trough time index difference in the corresponding segment, calculate the consistency index value of the trough spacing change, mark the continuous segments with stable trough spacing change amplitude, and obtain the brainwave micro-change structure tracking results. The consistency index value of the trough spacing variation is calculated using the following formula: ; in, The consistency index value of the change in the trough spacing within the time interval t. This represents the distance between the i-th trough index and the previous trough index in time interval t. This represents the average value of the trough index spacing values within the time interval t. The length of the j-th consecutive time segment with the same direction in time interval t. represents the average length of consecutive time segments with consistent direction within time interval t, n represents the number of trough index differences within time interval t, and m represents the number of consecutive time segments with consistent direction within time interval t.
5. The meditation-based sleep aid method according to claim 4, characterized in that, The specific steps for obtaining the meditation-dominant frequency drift linkage result are as follows: S301: Based on the brainwave micro-variation structure tracking results, extract the continuous time segment corresponding to the boundary region between α waves and θ waves in the cerebral cortex, call the frequency corresponding to the amplitude peak as the dominant frequency, and record the corresponding time index position to generate the dominant frequency sequence of the boundary region. S302: Call the dominant frequency sequence of the boundary region, compare the change relationship of the dominant frequency in adjacent time segments, determine the change direction and mark it as rising or falling, count the number of consecutive changes with the same direction, divide the continuous segments according to the direction switching position, and generate a dominant frequency change direction labeling sequence. S303: Based on the dominant frequency change direction labeling sequence, determine whether the direction state has a consistent direction for consecutive times, count the duration of consecutive direction segments and use it as the basis for judging the frequency drift trend, calculate the intensity value of consecutive segments, calculate the rate of change by combining the frequency difference of the dominant frequency in adjacent time segments, and generate a dominant frequency trend stability parameter set. S304: Based on the dominant frequency trend stability parameter set, determine the consistency of trend direction between the dominant frequency change rate and the meditation degree reference rate, mark the time segment that conforms to the trend consistency relationship, extract the corresponding dominant frequency change pattern sequence as the linkage feature segment, and generate the meditation dominant frequency drift linkage result.
6. The meditation-based sleep aid method according to claim 5, characterized in that, The strength value of the continuous section is calculated using the following formula: ; in, Represents the intensity value of a continuous section. This represents the number of consecutive directional segments within a statistical period. The directional amplitude represents the dominant frequency change direction within the i-th consecutive directional segment. Representing the The duration of a continuous directional segment's frame length Representing the Frequency difference of dominant frequency variation within a continuous directional segment Representing the The number of directional state reversals within a continuous directional segment.
7. The meditation-based sleep aid method according to claim 5, characterized in that, The specific steps for obtaining the targeted and coordinated sleep-aid signal are as follows: S401: Based on the results of the meditation-dominant frequency drift linkage, the frequency drift direction within the segment identified as having a consistent dominant frequency trend is matched with the pre-set sleep-aid transition feature direction. The direction matching segments are filtered, and it is determined whether the duration meets the continuity condition. Candidate segments entering the state are marked, and a set of candidate segment markers for the sleep-aid transition state is generated. S402: Call the candidate segment marker set of the sleep-aid transition state, retrieve the synchronous recording data of the EEG signals of the left and right hemispheres within the corresponding time period, respectively count the activity level of the amplitude change of the EEG signals in the left and right channels, adjust the phase difference and time delay value parameters of the signal output of the left and right channels, and generate the left and right ear output adjustment parameter set. S403: Using the set of left and right ear output adjustment parameters, load the adjusted left and right channel signal waveform data respectively within the time segment corresponding to the sleep-aid transition state, perform time synchronization processing and signal synthesis, and generate a directional collaborative sleep-aid signal.
8. The meditation-based sleep aid method according to claim 1, characterized in that, The method further includes step S5: S5: Based on the directional and coordinated sleep aid signal, monitor the trend of the combined amplitude change of delta wave and theta wave, and combine the continuity of the combined amplitude increase to determine whether the sleep aid state is stable. If stable, adjust the sound pressure level, frequency distribution, light intensity and color temperature in the sleep aid environment, complete the environment mode switch, and generate the sleep aid environment switching execution state. The sleep-aid environment switching execution status includes sound pressure adjustment range, light change parameters, and mode switching label.
9. The meditation-based sleep aid method according to claim 8, characterized in that, The specific steps for obtaining the execution state of the sleep-aid environment switching are as follows: S501: Based on the directional synergistic sleep aid signal, extract the EEG response records of the corresponding frequency bands of delta waves and theta waves under the action of the synergistic signal, calculate the total combined amplitude of delta waves and theta waves within the time segment, record the amplitude change trend according to the time sequence, combine the continuity of the combined amplitude change direction of adjacent segments, screen the segments with consistent change direction and the degree of continuity, and generate a combined amplitude continuous increase identification sequence. S502: Call the joint amplitude continuous amplification identifier sequence to determine whether the amplitude continuous change segment meets the stability characteristics. If it does, adjust the sound pressure level, frequency distribution, light intensity and color temperature parameters respectively, and mark the configuration status output as executed to generate the sleep aid environment switching execution status.
10. A meditation-based sleep aid system based on brainwave feedback, characterized in that, The system is used to implement the brainwave feedback-based meditation-assisted sleep method according to any one of claims 1-9, the system comprising: The EEG interval recognition module acquires the raw EEG signal data of the frequency band set by the user's cerebral cortex for the meditation state, records the peak and trough positions corresponding to the amplitude, and updates the boundary information of the meditation detection segment by calling the peak positions of two adjacent time segments, thereby generating the EEG signal monitoring interval for the meditation state. The micro-variation structure extraction module extracts waveform amplitude value points within continuous segments as trough positions based on the EEG signal monitoring interval of the meditation state, compares the difference between the trough positions of the segments to determine the directional change, accumulates the number of times the directional consistency is consistent to determine the micro-variation stable segment, and generates brainwave micro-variation structure tracking results. The dominant frequency tracking module calls the dominant frequency value of the brainwave micro-variation structure tracking result, obtains the frequency change direction of adjacent time periods, counts the number of consecutive directions and judges whether it is stable, and generates the meditation dominant frequency drift linkage result. The linkage signal module obtains the signal activity values of the left and right hemispheres based on the linkage result of the meditation-dominant frequency drift, and adjusts the output signals of the left and right channels by combining the signal phase difference and time delay parameters to generate a directional and coordinated sleep-aiding signal. Based on the directional and coordinated sleep-aid signal, the environmental adjustment response module monitors the continuity of the combined amplitude increase of delta waves and theta waves, and determines whether it stably exceeds the sleep-aid threshold. If it does, it adjusts the sound pressure level, frequency distribution, light intensity, and color temperature value according to the target set range, generating a sleep-aid environment switching execution state.
Citation Information
Patent Citations
Device for regulating a depressed mood through musical feedback based on an electroencephalogram signal.
CH717003A2
Sleeping state detection method and system in sleeping state analysis
CN106377249A
Sound sleep control system with sleep state feedback in closed loop path and method thereof
CN107715276A
A sleep-aid music control system
CN110585554B
Ideal control virtual-real fusion feedback method based on non-invasive brain-computer interface
CN114003129A