Identify rising and falling edges
13 次查看(过去 30 天)
显示 更早的评论
I have the following line of code
load eeg.txt
fs = 200;
time = 0:1/fs:(length(eeg)-1)*1/fs;
%plot(time,eeg);
[coef,lev]=wavedec(eeg,6,'haar');
approx_coef = wrcoef('a',coef,lev,'haar',6);
app_max = max(approx_coef);
app_min = min(approx_coef);
disp(app_max);
disp(app_min);
plot(approx_coef);
The EOG contaminated EEG is decomposed up to 6 levels using Haar wavelet. The approximation coefficients at level 6 are reconstructed. The maximum of the rising and falling edges are found. Now I would like to apply following algorithm to identify ARTIFACTS ZONE.
ALGORITHM:
- Reconstructed signal samples are compared with its successive samples to identify the edges.
- The edges are classified into Artifact Rising Edge (ARE), Artifact Falling Edge (AFE), Rising Edge (RE) and Falling Edge (FE) depending on whether the edges correspond to eye blinks and those that do not correspond to eye blinks, based on their relative amplitude.
- The identified edges ARE, AFE, RE and FE are scaled using four integers 3, 2, 1 and 5 respectively and summed up so as to get the edges information in a single array.
- After scaling, the values of ARE, AFE, RE and FE are 4, 7, 1 and 5 respectively. The edges and the instants at which they occur are stored in separate arrays.
- The arrays containing the edges are traversed sequentially to identify unique patterns which correspond to the OA zones. For example, 47 (which is nothing but a OA rising edge followed by OA falling edge) corresponds to OA zone.
- Once the patterns are identified, the time instants at which the artifacts occur can be obtained and the OA zone can be identified.
please help me with a code for this!!!
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 EEG/MEG/ECoG 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!