필터 지우기
필터 지우기

take out small signals represented in binary vector

조회 수: 4 (최근 30일)
Miriam
Miriam 2013년 11월 20일
편집: Image Analyst 2013년 11월 20일
Hi everyone,
I have the following problem: I have a huge binary columnvector which is representing datapoints in a signal. Every datapoint is one Milisecond and the "ones" in the vector represent signal events above a certain threshold. Now I want to exclude events which are shorter than 500ms and assign them to zero.
I thought of doing this with a for-loop including an if-clause which checks if there are 500 or more "ones" in a row and if not put them to "zero", but obviously I will run into problems at the end of the vector and also it seems to be incredibly inconvenient to solve the problem like this!
Anyone has an easy idea how to solve this? Thanks very much in advance!

답변 (1개)

Image Analyst
Image Analyst 2013년 11월 20일
편집: Image Analyst 2013년 11월 20일
If you have the Image Processing Toolbox, you can use bwareaopen() to remove regions smaller than the size you specify.
cleanedVector = bwareaopen(yourVector, 500);

카테고리

Help CenterFile Exchange에서 Multirate Signal Processing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by