Mercurial > hg > ape
comparison aux/finddouble.m @ 4:b28ffd29e6e1
Audio file preparation for listening test
author | Brecht De Man <b.deman@qmul.ac.uk> |
---|---|
date | Wed, 19 Nov 2014 18:59:51 +0000 |
parents | 5e72201496c8 |
children |
comparison
equal
deleted
inserted
replaced
3:1f7b986dab05 | 4:b28ffd29e6e1 |
---|---|
2 % FINDDOUBLE spots doubles of audio files in the same folder | 2 % FINDDOUBLE spots doubles of audio files in the same folder |
3 % | 3 % |
4 % by Brecht De Man at Centre for Digital Music on 15 July 2013 | 4 % by Brecht De Man at Centre for Digital Music on 15 July 2013 |
5 | 5 |
6 | 6 |
7 list = dir([foldername '\*.wav']); % find wav file names in folder | 7 list = dir([foldername '/*.wav']); % find wav file names in folder |
8 sums = zeros(length(list)); % array for every file (don't count '.') | 8 |
9 % remove hidden files from list | |
10 % see http://www.mathworks.co.uk/matlabcentral/newsreader/view_thread/258220 | |
11 for k = length(list):-1:1 | |
12 fname = list(k).name; | |
13 if fname(1) == '.' | |
14 list(k) = [ ]; | |
15 end | |
16 end | |
17 | |
18 sums = zeros(length(list)); % number for every file | |
9 | 19 |
10 for i = 1:length(list) | 20 for i = 1:length(list) |
11 audio = audioread([foldername '\' list(i).name]); | 21 audio = audioread([foldername '/' list(i).name]); |
12 sums(i) = sum(sum(audio.^2)); | 22 sums(i) = sum(sum(audio.^2)); |
13 end | 23 end |
14 | 24 |
15 for i = 1:length(list) | 25 for i = 1:length(list) |
16 for j = i+1:length(list) | 26 for j = i+1:length(list) |