facing problem in combining EEG data

조회 수: 5 (최근 30일)
Vandana
Vandana 2023년 11월 20일
댓글: Sanju 2023년 11월 30일
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
Mathieu NOE
Mathieu NOE 2023년 11월 20일
you need to provide your data (as mat file) along with your code

댓글을 달려면 로그인하십시오.

채택된 답변

Sanju
Sanju 2023년 11월 27일
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
Vandana
Vandana 2023년 11월 28일
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 2023년 11월 30일
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.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 EEG/MEG/ECoG에 대해 자세히 알아보기

제품


릴리스

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by