% vibrato
%--------

clear all; close all;

Fe = 22050; h = 1/Fe;
f0 = 440;
t = 4; th = 0:h:t;

H = [1 2 3 4 5 6 7 8 9];
f = f0*H; fm = 5; larg = 7;
E = [1000 300 .1 .1 .1 3 .5 1 4];

% les harmoniques modules
y = 00*th;
for k = 1:9
    y = y + E(k)*sin(2*pi*f(k)*th + ...
        H(k)^(1/2)*larg*sin(2*pi*fm*th));
end

% l'enveloppe habituelle
tr = t*[0 .2 .8 .95 1];
yr = [0  1   .3 .1 0];
env = envelop(tr,yr,Fe);
y = y.*env;
y = .98*y/(max(abs(y)));

sound(y,Fe); 
%wavwrite(y,Fe,'../SONS/612vibrato.wav');
clf
voirspec(y,Fe,Fe/2,512);

