Multi-channel electroencephalogram signal compression method and system based on compressed sensing theory and Huffman coding
Through the multi-channel EEG signal compression method based on compression perception theory and Huffman encoding, the Gaussian random measurement matrix is optimized using multi-channel decorrelation algorithm and Gabor dictionary sparse basis, the problem of low compression efficiency of multi-channel EEG signal is solved and high efficiency is achieved Compression and high compression ratios meet the needs of portable acquisition systems.
Patent Information
- Application Number
- CN202411398223.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-09
- Publication Date
- 2024-12-20
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The prior art has low efficiency and redundant signals in multi-channel compression of EEG signals, resulting in low compression ratio, making it difficult to meet the data processing, storage and transmission requirements of portable acquisition systems.
Using the multi-channel EEG signal compression method based on compression perception theory and Huffman encoding, the Gaussian random measurement matrix is optimized through multi-channel decorrelation algorithm processing and Gabor dictionary sparse basis, and combining compression perception algorithm and Huffman encoding to achieve high efficiency of multi-channel EEG signal compression.
It realizes efficient compression of multi-channel EEG signals, significantly reduces data storage requirements and wireless transmission energy consumption, extends the usage time of portable devices, and improves the compression ratio.
Smart Images

Figure CN119157492A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of data compression and storage, and in particular relates to a multi-channel electroencephalogram signal compression method and system based on compressed sensing theory and Huffman coding. Background Art
[0002] With the gradual research on portable and high-precision EEG signal acquisition systems, it has broad application prospects in the fields of telemedicine, real-time health detection, and brain-computer interface (BCI). However, it also faces the problem of difficulty in processing, storing and transmitting large amounts of data. The efficient compression of EEG signals can not only significantly reduce the demand for data storage, but also reduce the energy consumption during wireless transmission, extend the use time of wearable devices, enable the development of portable acquisition systems, and make research and application in the fields of telemedicine, real-time monitoring, and BCI possible, while also providing subjects with a more convenient and comfortable experience. At present, in order to solve the problems of low efficiency of real-time compression of EEG signals and low compression ratio caused by redundant signals between channels when compressing multi-channel EEG signals, a multi-channel EEG signal compression method and system based on compressed sensing theory and Huffman coding is proposed. Summary of the invention
[0003] In view of the deficiencies in the prior art, the present invention provides a multi-channel EEG signal compression method and system based on compressed sensing theory and Huffman coding to achieve efficient compression of multi-channel EEG signals.
[0004] To achieve the above object, the present invention provides the following solutions:
[0005] The multi-channel EEG signal compression method based on compressed sensing theory and Huffman coding includes the following steps:
[0006] Collecting multi-channel EEG signals, processing the multi-channel EEG signals based on a multi-channel decorrelation algorithm, and obtaining decorrelated multi-channel EEG signals;
[0007] Using a compressed sensing algorithm, compressing the decorrelated multi-channel EEG signal to obtain a compressed EEG signal;
[0008] The compressed EEG signal is Huffman encoded to obtain a Huffman-encoded compressed EEG signal, thereby completing multi-channel EEG signal compression based on compressed sensing theory and Huffman encoding.
[0009] Preferably, the method for obtaining the decorrelated multi-channel EEG signal is:
[0010] Calculate the cross-correlation function of the multi-channel EEG signal, and based on the cross-correlation function, obtain the cross-correlation function C of the two-channel signal 1,2 ;
[0011] Define the differential signal and the cross-correlation function C of the two channel signals 1,2 Calculate the energy difference of the differential signal;
[0012] Based on the energy difference of the differential signal, dividing the reference channel and the differential channel;
[0013] Calculate the difference between the multi-channel signal and the corresponding reference channel signal to obtain a residual signal;
[0014] When no loop is formed between the reference channel and the differential channel, the energy difference between the obtained residual signal and the original multi-channel EEG signal is minimal, and the decorrelation processing of the multi-channel EEG signal is completed.
[0015] Preferably, the method for obtaining the compressed EEG signal is:
[0016] The Gabor dictionary is used to analyze the sparsity of the decorrelated multi-channel EEG signal and obtain the Gabor dictionary sparse basis.
[0017] Constructing a Gaussian random measurement matrix, and optimizing the Gaussian random measurement matrix using the Gabor dictionary sparse basis;
[0018] Based on the optimized Gaussian random measurement matrix, the decorrelated multi-channel EEG signal is compressed to obtain the compressed EEG signal.
[0019] Preferably, the method of optimizing the Gaussian random measurement matrix using the Gabor dictionary sparse basis is:
[0020] Constructing a random Gaussian random measurement matrix, performing singular value decomposition on the Gaussian random measurement matrix to obtain a decomposition result;
[0021] Based on the decomposition result, obtaining new singular values;
[0022] Based on the new singular values, a new Gaussian random measurement matrix is constructed;
[0023] The correlation between the new Gaussian random measurement matrix and the Gabor dictionary sparse basis is reduced to obtain the optimized Gaussian random measurement matrix.
[0024] Preferably, the maximum mutual coherence coefficient between the column vectors of the measurement matrix composed of the Gaussian random measurement matrix and the Gabor dictionary sparse basis is used to measure the correlation between the new Gaussian random measurement matrix and the Gabor dictionary sparse basis. The specific measurement method is:
[0025] The maximum value of the non-diagonal elements of the Gram matrix of the measurement matrix is used to represent the maximum mutual interference coefficient between the column vectors of the measurement matrix;
[0026] The problem of reducing the maximum mutual interference coefficient between the column vectors of the measurement matrix is transformed into the problem of minimizing the non-diagonal elements of the Gram matrix, and the optimized Gaussian random measurement matrix is obtained.
[0027] The present invention also provides a multi-channel EEG signal compression system based on compressed sensing theory and Huffman coding, which is used to implement a compression method, including:
[0028] A multi-channel decorrelation module is used to collect multi-channel EEG signals, process the multi-channel EEG signals based on a multi-channel decorrelation algorithm, and obtain decorrelated multi-channel EEG signals;
[0029] A compressed sensing module, used to compress the decorrelated multi-channel EEG signal using a compressed sensing algorithm to obtain a compressed EEG signal;
[0030] The Huffman coding module is used to perform Huffman coding on the compressed EEG signal to obtain the compressed EEG signal after Huffman coding, and complete the multi-channel EEG signal compression based on compressed sensing theory and Huffman coding.
[0031] Preferably, the multi-channel decorrelation module comprises:
[0032] The cross-correlation function calculation unit is used to calculate the cross-correlation function of the multi-channel EEG signal, and based on the cross-correlation function, obtain the cross-correlation function C of the two-channel signal 1,2 ;
[0033] An energy difference calculation unit is used to define a differential signal and to calculate the energy difference based on the cross-correlation function C of the two channel signals. 1,2 Calculate the energy difference of the differential signal;
[0034] A reference channel division unit, used for dividing a reference channel and a differential channel based on the energy difference of the differential signal;
[0035] Calculate the difference between the multi-channel signal and the corresponding reference channel signal to obtain a residual signal;
[0036] The decorrelation unit is used to minimize the energy difference between the residual signal and the original multi-channel EEG signal when no loop is formed between the reference channel and the differential channel, thereby completing the decorrelation processing of the multi-channel EEG signal.
[0037] Preferably, the compressed sensing module includes:
[0038] A sparse basis acquisition unit, used for analyzing the sparsity of the decorrelated multi-channel EEG signal using a Gabor dictionary to obtain a Gabor dictionary sparse basis;
[0039] A measurement matrix optimization unit, used for constructing a Gaussian random measurement matrix and optimizing the Gaussian random measurement matrix using the Gabor dictionary sparse basis;
[0040] The EEG signal compression unit is used to compress the decorrelated multi-channel EEG signal based on the optimized Gaussian random measurement matrix to obtain the compressed EEG signal.
[0041] Compared with the prior art, the beneficial effects of the present invention are as follows: the present invention collects multi-channel EEG signals, processes the multi-channel EEG signals based on the multi-channel decorrelation algorithm according to the characteristics of multi-channel EEG data, and obtains the decorrelated multi-channel EEG signals; compresses the decorrelated multi-channel EEG signals using the compressed sensing algorithm to obtain compressed EEG signals; and performs Huffman encoding on the compressed EEG signals to complete the multi-channel EEG signal compression based on the compressed sensing theory and Huffman encoding. The present invention provides a new solution for multi-channel EEG data compression. Finally, the effectiveness of the multi-channel decorrelation algorithm is verified on the data set, and it is also verified that its combination with the compressed sensing theory and Huffman can complete the efficient compression of multi-channel EEG signals. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the technical solution of the present invention, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0043] Figure 1 This is a flow chart of a multi-channel EEG signal compression method based on compressed sensing theory and Huffman coding according to an embodiment of the present invention;
[0044] Figure 2 Optimizing the measurement matrix flow chart for the embodiment of the present invention;
[0045] Figure 3 This is a flow chart of the OMP reconstruction algorithm according to an embodiment of the present invention;
[0046] Figure 4 Flow chart of multi-channel decorrelation algorithm according to an embodiment of the present invention
[0047] Figure 5 The present invention provides a sparse representation of EEG signals based on Gabor dictionary.
[0048] Figure 6 This is a first set of data compression and reconstruction comparison diagrams according to an embodiment of the present invention;
[0049] Figure 7 This is a second set of data compression and reconstruction comparison diagrams according to an embodiment of the present invention;
[0050] Figure 8 This is a schematic diagram of the amplitude of the original multi-channel EEG signal according to an embodiment of the present invention;
[0051] Fig. 9 The embodiment of the present invention is to obtain the amplitude of the residual signal after decorrelating the original multi-channel EEG signal. DETAILED DESCRIPTION
[0052] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0053] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0054] Embodiment 1
[0055] like Figure 1 As shown, the multi-channel EEG signal compression method based on compressed sensing theory and Huffman coding includes the following steps:
[0056] S1: Collect multi-channel EEG signals, process the multi-channel EEG signals based on a multi-channel decorrelation algorithm, and obtain decorrelated multi-channel EEG signals.
[0057] A further implementation method is that the method for obtaining the decorrelated multi-channel EEG signal is:
[0058] Calculate the cross-correlation function of multi-channel EEG signals, and based on the cross-correlation function, obtain the cross-correlation function C of the two-channel signals 1,2 ;
[0059] In this embodiment, it is first determined whether the EEG signal is a random signal or a power signal:
[0060] Depending on whether the discrete-time signal energy is bounded, it can be divided into energy signal and power signal. For any signal x(n), its instantaneous power is defined as Then the energy expression of the signal is shown as (1).
[0061]
[0062] The expression of average power is shown in (2).
[0063]
[0064] N represents the number of signal samples.
[0065] If the energy of the signal is bounded and the average power approaches 0, the discrete time signal is called an energy signal. If the energy of the signal approaches infinity, but the average power is bounded, the signal is called a power signal. EEG signals cannot be predicted by a definite expression at any time, so they are random signals. On an infinite time scale, the signal energy approaches infinity, and the instantaneous energy of each sampled signal is a finite value, so EEG signals are power signals.
[0066] After determining that the EEG signal is a random signal or a power signal, the correlation function of the random signal is calculated:
[0067] If the signal x(n) is a power signal, its autocorrelation function expression is shown in (3).
[0068]
[0069] Autocorrelation function r x The value of (m) represents the similarity between the random signal x(n) and the signal x(nm) after a specific time delay. If the value is large, it means that the similarity between the two signals is high. In particular, when the time delay is zero, the autocorrelation function value is equal to the energy of the signal itself.
[0070] If any two discrete-time signals x(n) and y(n) are both power signals, then the cross-correlation function between them is expressed as shown in (4).
[0071]
[0072] Cross-correlation function r xy The value of (m) describes the similarity between the signal x(n) and the signal y(nm), r xy The larger the (m) value, the greater the similarity between the two signals.
[0073] Let the sample signal composed of N observations of the random signal x(n) be x N (1),x N (2),...x N (N), y N The sample signal composed of N observations of (n) is y N (1),y N (2),...y N(N), and their temporal autocorrelation function expressions are shown in (5).
[0074]
[0075] The expression of the time cross-correlation function is shown in (6).
[0076]
[0077] In actual signal processing, time averaging methods are often used to estimate the digital characteristics of signals.
[0078] For a two-channel EEG signal without time delay, the two channel sample signals x N (n) and y N The cross-correlation function of (n) is defined as shown in formula (7).
[0079]
[0080] Assuming that the signal value of channel 1 is x1(n), n=1,2,...,N, and the signal value of channel 2 is x2(n), n=1,2,...,N, the signal energy of x1(n) is defined as shown in equation (8).
[0081]
[0082] The signal energy of x2(n) is defined as shown in formula (9).
[0083]
[0084] The cross-correlation function of the two-channel signals is defined as shown in formula (10).
[0085]
[0086] For the convenience of expression and calculation, it can be defined as shown in formula (11).
[0087]
[0088] Among them, C 1,2 Represents the cross-correlation function of the two channel signals.
[0089] In EEG signals, if the correlation between the signals of two channels is strong, the difference between them is usually small. In this case, differential lossless coding technology can be used to process the signals between these channels, thereby effectively eliminating the correlation between them and achieving signal compression.
[0090] Define the differential signal and the cross-correlation function C of the two channel signals 1,2 Calculate the energy difference of the differential signal;
[0091] Based on the energy difference of the differential signal, the reference channel and the differential channel are divided;
[0092] Calculate the difference between the multi-channel signal and the corresponding reference channel signal to obtain a residual signal;
[0093] When no loop is formed between the reference channel and the differential channel, the energy difference between the obtained residual signal and the original multi-channel EEG signal is minimal, and the decorrelation processing of the multi-channel EEG signal is completed.
[0094] In this embodiment, before the correlation between channels is removed, the energy sum between the two channels is E1+E2. When channel 1 is defined as the reference channel, the differential signal is defined as At this time, the energy of the differential signal x1(n) and Total Energy
[0095] When channel 2 is set as the reference channel, the differential signal At this time, the differential signal energy x2(n) and Total Energy
[0096] Comparing the total energy of the two, we can see from the symmetry that C 1,2 =C 2,1 , so when E1<E2, the total energy Therefore, in order to minimize energy, the channel with smaller energy should be selected as the reference channel.
[0097] When the number of channels is greater than two, let the number of channels be K, the Lth channel be the reference channel, channel p(j) be the reference channel of channel j, and the total differential energy of all channels be expressed as shown in formula (12).
[0098]
[0099] Channel j cannot use itself as a reference channel, so the above formula satisfies the condition p(j)1j.
[0100] In order to maximize the compression rate, based on the above conditions, it is known that the total energy of the differential signal should be minimized. Because the sum of all channel energies unchanged, making K-1 E p(j) -2C j,p(j)The sum of the energy values of is minimized as much as possible. Based on this condition, a reference channel p(j) can be found. Except for the initial reference channel L, all channels j have only this reference channel p(j). And when all reference channels p(j) and their differential channels j do not form a loop, the energy difference between the residual signal and the original signal is is the smallest.
[0101] As shown in Figure 4, calculate all E p(j) -2C j,p(j) , and store them in the vector G. The total number of channels is K. Sort the K′(K-1) elements in G in ascending order. The counter cnt=1. The process ends when K=1. Otherwise, determine whether the channel j corresponding to the element gcnt already has a reference channel. If not, determine whether the connection from channel j to p(j) forms a loop with the existing connection. If not, set the reference channel of channel j to p(j), set K=(K-1), and the counter cnt+1 will cycle again. Determine whether the channel j corresponding to the element gcnt already has a reference channel. If yes, the counter cnt+1 will cycle again.
[0102] S2: Using the compressed sensing algorithm, compress the decorrelated multi-channel EEG signal to obtain a compressed EEG signal;
[0103] A further implementation method is that the method for obtaining the compressed EEG signal is:
[0104] S21: Use the Gabor dictionary to analyze the sparsity of the multi-channel EEG signal after decorrelation, and obtain the Gabor dictionary sparse basis; in this embodiment, the Gabor atom is a complex signal composed of two core parameters, center time and center frequency, and adjustable modulation width and phase. Without changing the modulation width and phase, a series of Gabor atoms can be generated by adjusting the center time and center frequency. These atoms are arranged according to a specific rule to form a Gabor dictionary. The Gabor dictionary can be used to sparsely represent the signal. When using the Gabor dictionary to represent the signal, that is, through a method called "sparse coding", a set of the minimum number of Gabor atoms is found so that the signal obtained by their linear combination has the smallest error with the original signal.
[0105] The Gabor dictionary is composed of a series of atoms generated by changing the parameters of the Gabor function, and these atoms have a certain degree of redundancy. Specifically, the one-dimensional real-valued Gabor function can be expressed by formula (13).
[0106]
[0107] In formula (1), K(γ) represents the normalization factor, the parameter s represents the position of the atom, u represents the scale, ω represents the frequency, and φ represents the phase characteristic.
[0108] When performing sparsity analysis on discrete signals, we usually use a discretized Gabor dictionary. This dictionary consists of a series of discrete Gabor atoms, each of which captures the local frequency and spatial characteristics of the signal through specific parameter settings. The discretized Gabor atom can be expressed as formula (14).
[0109]
[0110] In the above formula, N represents the dimension of the discrete signal, and p and k are both integers, and the range of variation is given by (p, k) ∈ [0, N-1] 2 ,j∈[0,log a N], usually a = 2; at the same time, in order to improve the matching accuracy of atoms to structures of different scales, is the number of intermediate scales in each band; the phase φ can be selected in the sparse decomposition optimization process, and the discrete Gabor dictionary generated by this has the characteristics of time and frequency shift invariance. The sparse representation of the EEG signal on the Gabor dictionary is as follows Figure 5 shown.
[0111] The absolute value of the result obtained by the sparsity analysis of EEG signals under different sparse bases is taken, and the maximum and minimum value normalization method is used to normalize the data. The calculation process is shown in formula (15).
[0112]
[0113] The normalization threshold is set to 0.005, and any result with a value lower than this threshold will be reset to 0. At the same time, the sparsity of the signal (the number of non-zero elements) is counted. The sparsity results are shown in Table 1 (the sparse results of EEG signals on various sparse bases).
[0114] Table 1
[0115]
[0116] It can be clearly seen from the statistical results that the effect of sparse decomposition using Gabor dictionary is significantly better than other sparse bases. This is because Gabor dictionary can be constructed according to the structural characteristics of EEG signals and can well reflect the structural characteristics of EEG signals.
[0117] S22: Construct a Gaussian random measurement matrix and optimize it using the Gabor dictionary sparse basis. In compressed sensing theory, Gaussian random measurement matrices are widely used to process compressed signals. In order to further improve the performance of the measurement matrix, the Gaussian random measurement matrix is optimized by combining the two key factors of singular value decomposition and minimizing the mutual interference coefficient. The optimized measurement matrix should have two characteristics:
[0118] 1. The observation matrix (consisting of the measurement matrix and the sparse basis) must follow the RIP criterion.
[0119] 2. The column vectors of the measurement matrix must satisfy randomness and ensure independence.
[0120] like Figure 2 As shown in , the singular values of the matrix are closely related to the correlation of the column vectors. The smaller the minimum singular value, the weaker the independence of the column vectors and the higher the correlation. Therefore, the purpose of optimizing the measurement matrix is to increase its minimum singular value to enhance the independence of the column vectors.
[0121] A further implementation method is to use the Gabor dictionary sparse basis to optimize the Gaussian random measurement matrix:
[0122] Construct a random Gaussian random measurement matrix, perform singular value decomposition on the Gaussian random measurement matrix, and obtain a decomposition result;
[0123] Based on the decomposition results, new singular values are obtained; in this embodiment, a random Gaussian random measurement matrix Φ∈R is first constructed M×N (M<N), and then perform singular value decomposition on the matrix to obtain the corresponding decomposition result as shown in formula (16).
[0124]
[0125] In the above formula (16), D represents an M×N semi-positive definite matrix, the matrices U and V represent M×N and N×N unitary matrices respectively, ∑=diag(σ1,σ2,...,σ M ), where σ i are the non-zero singular values of the matrix, σ1≥σ2≥...≥σ M , and the largest singular value σ is obtained max =σ1, at this time, let ∑'=diag(σ1',σ2',...,σ M '), i 'Assign value to σ i '=σ max =σ1.
[0126] Based on the new singular value (maximum singular value), a new Gaussian random measurement matrix Φ1 is constructed, and its representation is shown in formula (17).
[0127]
[0128] On the basis of satisfying the above conditions, the singular values of the measurement matrix Φ1 are improved, thereby also enhancing the independence of its column vectors.
[0129] The correlation between the new Gaussian random measurement matrix Φ1 and the Gabor dictionary sparse basis is reduced to obtain an optimized Gaussian random measurement matrix.
[0130] A further implementation method is that the maximum mutual coherence coefficient between the column vectors of the measurement matrix composed of the Gaussian random measurement matrix and the Gabor dictionary sparse basis is used to measure the correlation between the new Gaussian random measurement matrix and the Gabor dictionary sparse basis. The specific measurement method is:
[0131] The new measurement matrix Φ1 is further optimized by minimizing the mutual interference coefficient. Reducing the correlation between the measurement matrix Φ and the sparse basis Ψ can effectively improve the performance of compressed sensing, which is also a way to verify that it meets the isometric constraint criterion (RIP). The measurement matrix A = Θ = ΦΨ∈R M×N The maximum mutual correlation coefficient between column vectors can be used to measure the correlation between them. The maximum mutual correlation coefficient can be expressed by formula (18).
[0132]
[0133] In formula (18), A' represents the matrix after the column vector is normalized, a i Represents a column vector. The Gram matrix of the observation matrix A can be expressed as formula (19).
[0134] D=A' T A'=Ψ T Φ T ΨΦ (19)
[0135] The mutual interference coefficient between its column vectors can be obtained by using the off-diagonal elements g of the Gram matrix ij The maximum value of is expressed as shown in formula (20):
[0136]
[0137] The problem of reducing the maximum mutual interference coefficient between the column vectors of the measurement matrix is transformed into the problem of minimizing the non-diagonal elements of the Gram matrix, and the optimized Gaussian random measurement matrix is obtained. Specifically, the mutual interference coefficient has a lower limit, which is called the Welch bound. When the mutual interference coefficient between the measurement matrix and the sparse basis is close to the Welch bound, it can be ensured that the measurement matrix has better performance. The mathematical expression definition of the Welch bound is shown in formula (21).
[0138]
[0139] The optimization objective function is defined as shown in formula (22).
[0140]
[0141] In the above formula, G ideal is an ideal target matrix, which should satisfy the following condition (23):
[0142]
[0143] Where G_ideal ij are the elements of the target matrix.
[0144] The objective function is iteratively optimized through the above steps, and when the iteration termination condition is met, the optimal measurement matrix Φ' is finally obtained.
[0145] In this embodiment, the optimization results of the Gaussian random measurement matrix are analyzed:
[0146] The performance of the optimized measurement matrix is measured based on the average mutual interference coefficient, and the calculation method of the average mutual interference coefficient is shown in (24).
[0147]
[0148] Table 2 below records the average values of the normalized mutual coherence coefficients μ for the four different measurement matrices: av and the maximum value μ max .
[0149] Table 2
[0150]
[0151] The four types of measurement matrices are: Gaussian random measurement matrix (Gauss), measurement matrix optimized by singular value decomposition (Gauss+SVD), measurement matrix optimized by minimizing mutual interference coefficient (Gauss+Minmize), and the new optimized Gaussian random measurement matrix proposed in the present invention.
[0152] It can be seen from Table 2 that the mean and maximum values of the mutual coherence coefficient of the Gaussian random measurement matrix after optimization in this paper are significantly reduced, indicating that the optimization method proposed in this invention can effectively reduce the coherence of the measurement matrix and improve the performance of the measurement matrix for compressing EEG signals based on compressed sensing theory.
[0153] S23: Based on the optimized Gaussian random measurement matrix, compress the decorrelated multi-channel EEG signal to obtain a compressed EEG signal.
[0154] S3: Perform Huffman encoding on the compressed EEG signal to obtain a Huffman-encoded compressed EEG signal, thereby completing multi-channel EEG signal compression based on compressed sensing theory and Huffman encoding.
[0155] Huffman is an important prefix code, and the number of coded bits for each symbol is approximately equal to the information content of the symbol. After the EEG signal has been processed by compressed sensing, Huffman coding is performed on it to reduce redundant information. However, EEG signals are highly random, and some have large amplitudes. During the encoding process, signals with these characteristics will increase the types and number of symbols in the code table, which will reduce the efficiency of Huffman coding to a certain extent. In EEG data statistics, they are all represented in integer form. Based on the characteristics of integers, each 16-bit signal value can be split into two bytes, high and low, to represent it. In this way, the code table contains at most 256 (2 8 ) different symbols, effectively avoiding the interference of signals with larger amplitudes on the data. It reduces the redundancy between data.
[0156] Embodiment 2
[0157] The publicly available EEG dataset from the University of Bonn was used to verify the method of optimizing the Gaussian random measurement matrix using the Gabor dictionary sparse basis.
[0158] First, the Orthogonal Matching Pursuit (OMP) algorithm is selected to reconstruct the compressed EEG signal. After the EEG signal is compressed according to the compressed sensing theory, the accurate reconstruction of the signal is also an important issue. Efficient reconstruction technology can restore the original signal more accurately, thereby reducing the errors that may occur in the reconstruction process.
[0159] like Figure 3 As shown in Figure 1, the OMP algorithm is started by first initializing the sparse vector S and inputting parameters such as the measurement sequence, the sensing matrix, and the iteration limit. In each iteration, the residual update is calculated, r t =Y-Φ*β t-1 Where Y is the measurement sequence, Φ is the measurement matrix, β t-1is the sparse coefficient vector obtained in the previous iteration. Then find the position of the maximum term of the inner product of all column vectors in the perception matrix and the current residual, and determine the most relevant column vector. Update the incremental matrix and position set, and solve the reconstructed signal. The formula is z = S, where S is a sparse matrix. Then find the sparse coefficient corresponding to the atomic index and update the sparse vector S. If the iteration termination condition is met, the algorithm ends and outputs the reconstructed signal; otherwise, continue to the next round of iteration.
[0160] The OMP algorithm is a widely used compressed sensing reconstruction method. Its core is to orthogonalize each iteration in each iteration process to ensure that each iteration can obtain the best result, so as to improve the convergence speed and reduce the number of iterations. The specific method is to calculate the absolute value of the inner product between the measurement matrix Φ and each atom in the signal residual to obtain the correlation coefficient u, which is expressed as shown in formula (25).
[0161]
[0162] Then, the signal is fitted using the least squares method and the residual r of the signal is updated. new The corresponding formulas are shown in equations (26) and (27).
[0163]
[0164]
[0165] Where Y represents the measurement sequence; represents the expression solved by the least squares method; Φ ^ represents the feature matrix; X represents the original matrix.
[0166] The data used in this embodiment is the public EEG data of the University of Bonn. A set of data in the data set is selected and the EEG signal with a length of 512 is intercepted, and the sparse decomposition is performed using the Gabor dictionary sparse basis. Subsequently, the sparse coefficient vector is observed using the optimized Gaussian random measurement matrix to obtain the measurement data, and the original Gaussian random measurement matrix is compared. Among them, K represents the number of non-zero elements in the sparse coefficient vector.
[0167] When K takes different values, we obtain the corresponding (CR) and Percentage Root Mean Square Error (PRD). The original signal is represented by u, and u(i) represents the amplitude of the i-th sampling point of the original signal. v represents the reconstructed signal. Similarly, v(i) represents the amplitude of the i-th sampling point of the reconstructed signal. The specific calculation expression of PRD is shown in the following formula (28).
[0168]
[0169] In the case of the same Gabor dictionary sparse basis, the CR obtained by using the optimized Gaussian random matrix as the measurement matrix and the initial Gaussian matrix as the measurement matrix is shown in Table 3.
[0170] Table 3
[0171]
[0172] The PRD obtained by using the optimized Gaussian random matrix as the measurement matrix and the initial Gaussian matrix as the measurement matrix is shown in Table 4.
[0173] Table 4
[0174]
[0175] According to the data in Table 3 and Table 4, it can be seen that when the K value is the same, the compression ratio (CR) of the optimized Gaussian random measurement matrix is higher than that of the original Gaussian random measurement matrix and the root mean square error (PRD) is lower. Combined with the data, it is specifically proved that the Gaussian random measurement matrix optimized based on the Gabor dictionary sparse basis is effective in compressing EEG signals.
[0176] Different data verification:
[0177] In order to further verify the stability of the proposed compression method for EEG signals, 5 groups of different EEG signals with a truncation length of 512 sampling points were selected for experimental analysis when the compression ratio was unified as 8. The root mean square error (PRD) data of each data is shown in Table 5 below.
[0178] Table 5
[0179]
[0180] The experimental results show that for different EEG data, at a certain compression ratio, although the root mean square errors of different data are different, the fluctuation range is small, which also proves that the improved compression method has good stability.
[0181] Data visualization verification:
[0182] The similarity between the waveform of the reconstructed data and the waveform of the original data is the most intuitive evaluation indicator to measure the quality of the compression algorithm and the reconstruction algorithm. According to the compression algorithm of the present invention combined with the orthogonal matching pursuit (OMP) reconstruction algorithm, the two sets of data are compressed and reconstructed, and the results are as follows Figure 6-Figure 7 shown.
[0183] From the results, it can be seen that the comparative selection of Gabor dictionary sparse bases based on the compressed sensing theory and the effectiveness of optimizing the Gaussian random measurement matrix based on the Gabor dictionary sparse base are proved. At the same time, it also proves the adaptability of the OMP reconstruction algorithm to the compressed sensing theory algorithm optimized by the present invention.
[0184] Embodiment 3
[0185] Verify the effectiveness of the multi-channel EEG signal decorrelation algorithm proposed in the present invention and the efficiency of the multi-channel EEG signal compression algorithm constructed in combination with compressed sensing theory and Huffman coding.
[0186] In order to test the effect of the multi-channel decorrelation algorithm in improving the compression of multi-channel EEG signals, a specific set of data was selected from the data set for experiment. This set of data contains 64 signal channels, and the signal length of each channel is 160 data points, which are tested. The sample signal is input into the multi-channel decorrelation processing module to generate the corresponding residual signal (decorrelated multi-channel EEG signal). In order to clearly show the effect of decorrelation, the amplitude and frequency of occurrence in the original signal and the residual signal are analyzed in detail, and the results are as follows Figure 8-Figure 9 shown.
[0187] For the original signal Figure 8 As shown in the results, the signal amplitude is mostly between -150 and 150; the residual signal amplitude is as follows Fig. 9 As shown in the figure, most of its amplitude distribution is between -60 and 60. The results show that the residual signal after multi-channel decorrelation processing has a smaller value range and the frequency of small amplitude signals is higher, which proves the effectiveness of the multi-channel decorrelation algorithm and is conducive to the compression of multi-channel EEG data in the later stage.
[0188] Verification and analysis of decorrelation algorithms with different channel numbers:
[0189] The difference in the number of channels will have a corresponding impact on the decorrelation algorithm. To verify the effect, the EEG data with a length of 1920 in the data set were selected, and the number of channels was 8, 16, 32, and 64. The proposed multi-channel decorrelation algorithm was used for analysis. The results of the amplitude ratio of the original signal and the processed residual signal with different numbers of channels are shown in Table 6 below.
[0190] Table 6
[0191]
[0192] From the data in the table, we can see that when the number of channels is 8 and 16, the amplitude ratio of the original signal and the residual signal after decorrelation is relatively close. When the number of channels increases to 32 and 64, the amplitude ratio is significantly improved. The results show that when the number of channels increases, the distance between channels will become smaller, and the correlation between channels will be enhanced compared to when the number of channels is small. It also shows that the performance of the multi-channel decorrelation algorithm is affected by the number of channels.
[0193] Combined with the verification and analysis of compressed sensing theory algorithm:
[0194] This simulation experiment selected a set of 14 multi-channel EEG data for completing action tasks in the data set. The two methods of compressing multi-channel EEG signals by combining multi-channel decorrelation algorithm with compressed sensing theory and Huffman coding and compressing multi-channel EEG signals without using multi-channel decorrelation algorithm were compared. The CR of the two schemes was calculated respectively, and then the ratio of the two was calculated to obtain the improvement of compression ratio. The results are shown in Table 7 (EEG signal compression ratio of the two schemes) and Table 8 (improvement of compression ratio by multi-channel decorrelation).
[0195] Table 7
[0196]
[0197] Table 8
[0198]
[0199] From the data in Tables 7 and 8, it can be seen that the combination of multi-channel decorrelation algorithm with compressed sensing theory and Huffman coding can significantly improve the compression efficiency of multi-channel EEG signals. This proves the effectiveness of combining multi-channel decorrelation algorithm with compressed sensing theory and Huffman coding for multi-channel EEG data compression.
[0200] Embodiment 4
[0201] The present invention also provides a multi-channel EEG signal compression system based on compressed sensing theory and Huffman coding, which is used to implement a compression method, including:
[0202] A multi-channel decorrelation module is used to collect multi-channel EEG signals, process the multi-channel EEG signals based on a multi-channel decorrelation algorithm, and obtain decorrelated multi-channel EEG signals;
[0203] A compressed sensing module is used to compress the decorrelated multi-channel EEG signal using a compressed sensing algorithm to obtain a compressed EEG signal;
[0204] The Huffman coding module is used to perform Huffman coding on the compressed EEG signal to obtain the compressed EEG signal after Huffman coding, and complete the multi-channel EEG signal compression based on compressed sensing theory and Huffman coding.
[0205] In a further embodiment, the multi-channel decorrelation module comprises:
[0206] The cross-correlation function calculation unit is used to calculate the cross-correlation function of the multi-channel EEG signal, and based on the cross-correlation function, obtain the cross-correlation function C of the two-channel signal 1,2 ;
[0207] The energy difference calculation unit is used to define the differential signal and is based on the cross-correlation function C of the two channel signals. 1,2 Calculate the energy difference of the differential signal;
[0208] A reference channel division unit, used for dividing the reference channel and the differential channel based on the energy difference of the differential signal;
[0209] Calculate the difference between the multi-channel signal and the corresponding reference channel signal to obtain a residual signal;
[0210] The decorrelation unit is used to minimize the energy difference between the residual signal and the original multi-channel EEG signal when no loop is formed between the reference channel and the differential channel, thereby completing the decorrelation processing of the multi-channel EEG signal.
[0211] In a further embodiment, the compressed sensing module comprises:
[0212] A sparse basis acquisition unit, used for analyzing the sparsity of the decorrelated multi-channel EEG signal using a Gabor dictionary to obtain a Gabor dictionary sparse basis;
[0213] A measurement matrix optimization unit, used for constructing a Gaussian random measurement matrix and optimizing the Gaussian random measurement matrix using a Gabor dictionary sparse basis;
[0214] The EEG signal compression unit is used to compress the decorrelated multi-channel EEG signal based on the optimized Gaussian random measurement matrix to obtain a compressed EEG signal.
[0215] The embodiments described above are only descriptions of the preferred embodiments of the present invention and are not intended to limit the scope of the present invention. Without departing from the design spirit of the present invention, various modifications and improvements made to the technical solutions of the present invention by ordinary technicians in this field should all fall within the protection scope determined by the claims of the present invention.
Claims
1. A multi-channel EEG signal compression method based on compressed sensing theory and Huffman coding, characterized in that: The following steps are involved: Collecting multi-channel EEG signals, processing the multi-channel EEG signals based on a multi-channel decorrelation algorithm, and obtaining decorrelated multi-channel EEG signals; Using a compressed sensing algorithm, compressing the decorrelated multi-channel EEG signal to obtain a compressed EEG signal; The compressed EEG signal is Huffman encoded to obtain a Huffman-encoded compressed EEG signal, thereby completing multi-channel EEG signal compression based on compressed sensing theory and Huffman encoding.
2. The multi-channel EEG signal compression method based on compressed sensing theory and Huffman coding according to claim 1 is characterized in that: The method for obtaining decorrelated multi-channel EEG signals is: Calculate the cross-correlation function of the multi-channel EEG signal, and based on the cross-correlation function, obtain the cross-correlation function C of the two-channel signal 1,2 ; Define the differential signal and the cross-correlation function C of the two channel signals 1,2 Calculate the energy difference of the differential signal; Based on the energy difference of the differential signal, dividing the reference channel and the differential channel; Calculate the difference between the multi-channel signal and the corresponding reference channel signal to obtain a residual signal; When no loop is formed between the reference channel and the differential channel, the energy difference between the obtained residual signal and the original multi-channel EEG signal is minimal, and the decorrelation processing of the multi-channel EEG signal is completed.
3. The multi-channel EEG signal compression method based on compressed sensing theory and Huffman coding according to claim 1 is characterized in that: The method to obtain compressed EEG signals is: The Gabor dictionary is used to analyze the sparsity of the decorrelated multi-channel EEG signal and obtain the Gabor dictionary sparse basis. Constructing a Gaussian random measurement matrix, and optimizing the Gaussian random measurement matrix using the Gabor dictionary sparse basis; Based on the optimized Gaussian random measurement matrix, the decorrelated multi-channel EEG signal is compressed to obtain the compressed EEG signal.
4. The multi-channel EEG signal compression method based on compressed sensing theory and Huffman coding according to claim 3 is characterized in that: The method of optimizing the Gaussian random measurement matrix using the Gabor dictionary sparse basis is: Constructing a random Gaussian random measurement matrix, performing singular value decomposition on the Gaussian random measurement matrix to obtain a decomposition result; Based on the decomposition result, obtaining new singular values; Based on the new singular values, a new Gaussian random measurement matrix is constructed; The correlation between the new Gaussian random measurement matrix and the Gabor dictionary sparse basis is reduced to obtain the optimized Gaussian random measurement matrix.
5. The multi-channel EEG signal compression method based on compressed sensing theory and Huffman coding according to claim 4 is characterized in that: The maximum mutual coherence coefficient between the column vectors of the measurement matrix composed of the Gaussian random measurement matrix and the Gabor dictionary sparse basis is used to measure the correlation between the new Gaussian random measurement matrix and the Gabor dictionary sparse basis. The specific measurement method is: The maximum value of the non-diagonal elements of the Gram matrix of the measurement matrix is used to represent the maximum mutual interference coefficient between the column vectors of the measurement matrix; The problem of reducing the maximum mutual interference coefficient between the column vectors of the measurement matrix is transformed into the problem of minimizing the non-diagonal elements of the Gram matrix, and the optimized Gaussian random measurement matrix is obtained.
6. A multi-channel EEG signal compression system based on compressed sensing theory and Huffman coding, used to implement the compression method according to any one of claims 1 to 5, characterized in that: include: A multi-channel decorrelation module is used to collect multi-channel EEG signals, process the multi-channel EEG signals based on a multi-channel decorrelation algorithm, and obtain decorrelated multi-channel EEG signals; A compressed sensing module, used to compress the decorrelated multi-channel EEG signal using a compressed sensing algorithm to obtain a compressed EEG signal; The Huffman coding module is used to perform Huffman coding on the compressed EEG signal to obtain the compressed EEG signal after Huffman coding, and complete the multi-channel EEG signal compression based on compressed sensing theory and Huffman coding.
7. The multi-channel EEG signal compression system based on compressed sensing theory and Huffman coding according to claim 6 is characterized in that: The multi-channel decorrelation module comprises: The cross-correlation function calculation unit is used to calculate the cross-correlation function of the multi-channel EEG signal, and based on the cross-correlation function, obtain the cross-correlation function C of the two-channel signal 1,2 ; An energy difference calculation unit is used to define a differential signal and to calculate the energy difference based on the cross-correlation function C of the two channel signals. 1,2 Calculate the energy difference of the differential signal; A reference channel division unit, used for dividing a reference channel and a differential channel based on the energy difference of the differential signal; Calculate the difference between the multi-channel signal and the corresponding reference channel signal to obtain a residual signal; The decorrelation unit is used to minimize the energy difference between the residual signal and the original multi-channel EEG signal when no loop is formed between the reference channel and the differential channel, thereby completing the decorrelation processing of the multi-channel EEG signal.
8. The multi-channel EEG signal compression system based on compressed sensing theory and Huffman coding according to claim 6 is characterized in that: The compressed sensing module comprises: A sparse basis acquisition unit, used for analyzing the sparsity of the decorrelated multi-channel EEG signal using a Gabor dictionary to obtain a Gabor dictionary sparse basis; A measurement matrix optimization unit, used for constructing a Gaussian random measurement matrix and optimizing the Gaussian random measurement matrix using the Gabor dictionary sparse basis; The EEG signal compression unit is used to compress the decorrelated multi-channel EEG signal based on the optimized Gaussian random measurement matrix to obtain the compressed EEG signal.
Citation Information
Patent Citations
Multi-channel electroencephalogram signal compression method based on correlation function
CN111407268A
Spindle wave extraction method and system, computer equipment, storage medium and program product
CN114569140A
Non-iterative electroencephalogram signal compressed sensing rapid reconstruction method based on deep learning
CN115414055A
