facing problem in combining EEG data

6 visualizaciones (últimos 30 días)
Vandana
Vandana el 20 de Nov. de 2023
Comentada: Sanju el 30 de Nov. de 2023
EEG.srate = 500; % sampling rate in Hz
EEG.pnts = 1500;
EEG.trials = 30;
EEG.nbchan = 23;
noiseamp=0.3;
% time vector
EEG.times = (0:EEG.pnts-1)/EEG.srate;
I have simulated EEG data with above details.
then I added a pink noise to contaminate it
I want to denoise it using wdenoise function.
But im getting error while concatenating the eeg data which is available in EEG.data?
can Someone help me, how to concatenate EEG.data
  1 comentario
Mathieu NOE
Mathieu NOE el 20 de Nov. de 2023
you need to provide your data (as mat file) along with your code

Iniciar sesión para comentar.

Respuesta aceptada

Sanju
Sanju el 27 de Nov. de 2023
To concatenate the EEG data in the EEG.data field, you can use the “cat” function, In the below code, EEG.data is the simulated EEG data with pink noise added, and eeg_concat is the concatenated EEG data. You can then denoise the concatenated data using the "wdenoise" function.
% define EEG structure
EEG.srate = 500; % sampling rate in Hz
EEG.pnts = 1500;
EEG.trials = 30;
EEG.nbchan = 23;
% time vector
EEG.times = (0:EEG.pnts-1)/EEG.srate;
% generate simulated EEG data
noiseamp = 0.3;
eeg_data = noiseamp * randn(EEG.nbchan, EEG.pnts, EEG.trials);
% add pink noise
eeg_data = eeg_data + pinknoise(size(eeg_data(:,:,1)), 'like', eeg_data(:,:,1), EEG.srate);
% concatenate EEG data
eeg_concat = cat(2, eeg_data(:,:,1), eeg_data(:,:,2), eeg_data(:,:,3));
% denoise using wdenoise
eeg_denoised = wdenoise(eeg_concat, 'Wavelet', 'db4');
In this updated code, the 'like' parameter is used to specify the data type of the output as 'double', which is the same data type as the input data. The third input argument is also specified as eeg_data(:,:,1) to ensure that the output has the same size and shape as the input.
eeg_concat is the concatenated EEG data, and 'Wavelet' is set to 'db4', which specifies the Daubechies 4 wavelet. The “wdenoise” function can be used to remove noise from signals while preserving important features of the signal, such as sharp edges and peaks.
Hope this Helps!
Thanks.
  3 comentarios
Vandana
Vandana el 28 de Nov. de 2023
Does the sample size matters for EEG denoising? If I want to use any open source EEG data set for denoising proces, should we considerthe minimum sample size?. when does this sample size matters?
Sanju
Sanju el 30 de Nov. de 2023
Yes, the sample size can matter for EEG denoising. Generally, a larger sample size can lead to more accurate denoising results. However, the specific sample size required can depend on the denoising method being used and the characteristics of the EEG data. It is important to consult the literature and/or consult with experts in the field to determine an appropriate sample size for your specific denoising project.
Regarding open source EEG datasets, it is important to consider the quality of the data and whether it is appropriate for your denoising project. It is also important to ensure that you have the necessary permissions and/or licenses to use the data.
The sample size can matter in EEG denoising when using certain methods that require a certain amount of data to be effective. Additionally, a larger sample size can help to reduce the impact of noise and artifacts in the data.
Hope this Helps!
Thanks.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre EEG/MEG/ECoG en Help Center y File Exchange.

Productos


Versión

R2023b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by