Deleting overlapping segments between two vectors
Afficher commentaires plus anciens
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?
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Signal Processing Toolbox dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!