Deleting overlapping segments between two vectors
이전 댓글 표시
Hi all,
I have two speech signals represented as two logical vectors where 1 = speech and 0 = no speech. I want to find places where both channels contain speech and delete those segments in both arrays.
As a test script, I have the following:
a = zeros(1,20);
b = zeros(1,20);
a(1:3) = 1; a(7:10) = 1; a(18:20) = 1;
b(4:6) = 1; b(9:12) = 1; b(15:17) = 1;
for i = 1:numel(a)
if a(1,i)==1 && b(1,i)==1
crossval(1,i) = true;
else
crossval(1,i) = false;
end
end
% Positions where both channels are = 1
idx = find(crossval==1)
From this example code, I want to remove the segment in position 7-10 in vector a and segment in position 9-12 in vector b since they are overlapping, and I want to keep the other segments.
Does anybody have a good idea on how to do this?
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Signal Processing Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!