Mercurial > hg > pyin
changeset 104:ac840042f5f2 notes_refinement
adding test data and pitch generator
author | matthiasm |
---|---|
date | Wed, 07 Jan 2015 16:31:48 +0000 |
parents | 228aae2253c3 |
children | 55507f9c603a |
files | misc/pitchgenerator.m testdata/DontTellMeExcerpt.wav testdata/bob_02.wav |
diffstat | 3 files changed, 17 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/misc/pitchgenerator.m Wed Jan 07 16:31:48 2015 +0000 @@ -0,0 +1,17 @@ +f = 50:800; +fs = 44100; +t = (0:(2*fs))/fs; +nFreq = length(f); + +for iFreq = 1:nFreq + f(iFreq) + x = zeros(size(t)); + for iAdd = 1:100 + x = x + cos(2*pi*f(iFreq)*t*iAdd)*0.6^(iAdd-1); + if f(iFreq)*iAdd > fs/2 + break + end + end + x = x / max(abs(x)); + wavwrite(x, fs, sprintf('/Users/matthiasm/data/pyin/simplewavs/%iHz.wav', f(iFreq))); +end \ No newline at end of file