annotate aux/finddouble.m @ 0:4fd284285159

Adding listening test plus some helpful functions and scripts.
author Brecht <b.deman@qmul.ac.uk>
date Thu, 24 Apr 2014 23:53:31 +0100
parents
children 5e72201496c8
rev   line source
b@0 1 function finddouble(foldername)
b@0 2 % FINDDOUBLE spots doubles of audio files in the same folder
b@0 3 %
b@0 4 % by Brecht De Man at Centre for Digital Music on 15 July 2013
b@0 5
b@0 6 list = dir([foldername '\*.wav']);
b@0 7 sums = length(list)-1;
b@0 8 for i = 1:length(list)
b@0 9 audio = audioread([foldername '\' list(i).name]);
b@0 10 sums(i) = sum(sum(audio.^2));
b@0 11 % find doubles in this list (method or manual)
b@0 12 % find corresponding audio files; print their names
b@0 13 end
b@0 14
b@0 15 for i = 1:length(list)
b@0 16 for j = i+1:length(list)
b@0 17 if sums(i) == sums(j)
b@0 18 disp(['ERROR: ' list(i).name ' = ' list(j).name])
b@0 19 end
b@0 20 end
b@0 21 end
b@0 22
b@0 23 end
b@0 24
b@0 25 % TODO: expand to more folders