Mercurial > hg > pyin
comparison misc/pitchgenerator.m @ 104:ac840042f5f2 notes_refinement
adding test data and pitch generator
author | matthiasm |
---|---|
date | Wed, 07 Jan 2015 16:31:48 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
103:228aae2253c3 | 104:ac840042f5f2 |
---|---|
1 f = 50:800; | |
2 fs = 44100; | |
3 t = (0:(2*fs))/fs; | |
4 nFreq = length(f); | |
5 | |
6 for iFreq = 1:nFreq | |
7 f(iFreq) | |
8 x = zeros(size(t)); | |
9 for iAdd = 1:100 | |
10 x = x + cos(2*pi*f(iFreq)*t*iAdd)*0.6^(iAdd-1); | |
11 if f(iFreq)*iAdd > fs/2 | |
12 break | |
13 end | |
14 end | |
15 x = x / max(abs(x)); | |
16 wavwrite(x, fs, sprintf('/Users/matthiasm/data/pyin/simplewavs/%iHz.wav', f(iFreq))); | |
17 end |