annotate misc/pitchgenerator.m @ 126:292b75059949 v1.1

Update versions in n3 file as well
author Chris Cannam
date Tue, 21 Apr 2015 12:54:31 +0100
parents ac840042f5f2
children
rev   line source
matthiasm@104 1 f = 50:800;
matthiasm@104 2 fs = 44100;
matthiasm@104 3 t = (0:(2*fs))/fs;
matthiasm@104 4 nFreq = length(f);
matthiasm@104 5
matthiasm@104 6 for iFreq = 1:nFreq
matthiasm@104 7 f(iFreq)
matthiasm@104 8 x = zeros(size(t));
matthiasm@104 9 for iAdd = 1:100
matthiasm@104 10 x = x + cos(2*pi*f(iFreq)*t*iAdd)*0.6^(iAdd-1);
matthiasm@104 11 if f(iFreq)*iAdd > fs/2
matthiasm@104 12 break
matthiasm@104 13 end
matthiasm@104 14 end
matthiasm@104 15 x = x / max(abs(x));
matthiasm@104 16 wavwrite(x, fs, sprintf('/Users/matthiasm/data/pyin/simplewavs/%iHz.wav', f(iFreq)));
matthiasm@104 17 end