MATLAB Answers


Automatic Signal segmentation for feature extraction

さんによって質問されました 2018 年 1 月 21 日
最新アクティビティ Hristo Zhivomirov さんによって 回答されました 2019 年 10 月 13 日
Does anyone know how to do signal segmentation on the raw signal? I need to segment the raw signal into 8 different segments so that i can do feature extraction on individual segments.

  2 件のコメント

What is the corresponding time vector that corresponds to those samples, or the sampling frequency?
It is sampled at 1Khz

サインイン to comment.

3 件の回答

Image Analyst
Answer by Image Analyst
on 21 Jan 2018
 Accepted Answer

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);
% Now we should have the quiet parts. Find the centroids.
props = regionprops(quietParts, 'Centroid');
% Extract each tall signal part into a cell
for k = 1 : length(props)-1
index1 = round(props(k).Centroid;
index2 = round(props(k+1).Centroid;
individualSignals{k} = signal(index1:index2);
Note, the code above requires the Image Processing Toolbox.

  11 件のコメント

Just threshold each chunk at 0.01 or whatever is just above the noise level, like this:
thisSignal = individualSignals{k}
index1 = find(thisSignal > 0.01, 1, 'first');
index2 = find(thisSignal > 0.01, 1, 'last');
croppedSignal = thisSignal(index1:index2);
hmm. i actually have 35 other signals that does not have the same threshold. For example, if my noise threshold for the 1st signal is 0.02, the 2nd signal can be 0.01. So if i were to threshold it at a fixed value, say 0.02, then the 2nd signal will have some of the 'active' signal getting cut off. Any idea how to fix that?
You can try sgolayfilt with a shorter window to smooth it, then perhaps use findchangepts() to identify where it starts climbing.

サインイン to comment.

Jehad Ali
Answer by Jehad Ali on 30 Mar 2019

Can any one help me how to write code segmentation for arterial blood pressure pulse in matlab ?

  1 件のコメント

Yours is a new question, not an "Answer" to Radons question. Start a new thread.

サインイン to comment.

Answer by Hristo Zhivomirov on 13 Oct 2019

Hi, Radons!
I think that this the most suitable, easy-to-use and straightforward way.
Also, you can use the example.m file as reference.
All best,

  0 件のコメント

サインイン to comment.

Translated by