Mercurial > hg > ape
diff aux/autoaligntest.m @ 3:1f7b986dab05
Added autoalign.m: aligns audio by zero-padding before the signal to align the peak of the crosscorrelation function
author | Brecht De Man <b.deman@qmul.ac.uk> |
---|---|
date | Mon, 17 Nov 2014 23:01:09 +0000 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/aux/autoaligntest.m Mon Nov 17 23:01:09 2014 +0000 @@ -0,0 +1,14 @@ +% autoalign test +% generate files to test autoalign.m + +[fragment,fs] = audioread('../../AUDIO/SR1/pro.wav', [10*96000, 20*96000]); % from 0:10 to 0:20 + +% files with increasing leading zeros - end result should be all same file +N = 5; +spacing = 45678; % samples + +for i = 1:N + audiowrite(['autoaligntest' num2str(i) '.wav'], ... % file name + [zeros(i*spacing, size(fragment, 2)); fragment], ... % audio + fs, 'BitsPerSample', 24); % format +end \ No newline at end of file