Attach some signals so we can play with them.
Assuming the "tall" parts of the signal are not uniformly spaced (in which case you could extract them trivially with indexing at fixed indexes), then you need to find the center of the quiet parts. I'd start by thresholding the absolute value of the signal to find the low/quiet parts. You should have 9 of them, unless your tall signal parts hit the edge of your range. If you don't have 9, then I'd call imdilate repeatedly until you get exactly 9 quiet regions. Then I'd call regionprops() to get the centroid (middle index) of the quiet parts, and then I'd loop over the regions extracting the tall regions into cells. They need to be in cells because each region might have a different number of elements. Something like (untested)
quietParts = abs(signal) < threshold;
[~, numRegions] = bwlabel(quietParts);
while numRegions > 9
quietParts = imdilate(quietParts, [1,1,1]);
[~, numRegions] = bwlabel(quietParts);
end
props = regionprops(quietParts, 'Centroid');
for k = 1 : length(props)-1
index1 = round(props(k).Centroid;
index2 = round(props(k+1).Centroid;
individualSignals{k} = signal(index1:index2);
end
Note, the code above requires the Image Processing Toolbox.
2 件のコメント
このコメントへの直接リンク
https://jp.mathworks.com/matlabcentral/answers/378207-automatic-signal-segmentation-for-feature-extraction#comment_526850
このコメントへの直接リンク
https://jp.mathworks.com/matlabcentral/answers/378207-automatic-signal-segmentation-for-feature-extraction#comment_526850
このコメントへの直接リンク
https://jp.mathworks.com/matlabcentral/answers/378207-automatic-signal-segmentation-for-feature-extraction#comment_526851
このコメントへの直接リンク
https://jp.mathworks.com/matlabcentral/answers/378207-automatic-signal-segmentation-for-feature-extraction#comment_526851
サインインしてコメントする。