facing problem in combining EEG data

5 Ansichten (letzte 30 Tage)
Vandana
Vandana am 20 Nov. 2023
Kommentiert: Sanju am 30 Nov. 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 Kommentar
Mathieu NOE
Mathieu NOE am 20 Nov. 2023
you need to provide your data (as mat file) along with your code

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Sanju
Sanju am 27 Nov. 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 Kommentare
Vandana
Vandana am 28 Nov. 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 am 30 Nov. 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.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu EEG/MEG/ECoG finden Sie in Help Center und File Exchange

Produkte


Version

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by