% battements de l'unisson La-3
%-----------------------------

clear all; close all;

Fe = 22050; h = 1/Fe;
T =  4;
th = 0:h:T;
f1 = 440; f2 = 442;

% enveloppe
tr = T*[0 .02 .98 1];
yr = [0 1 1 0];
env = envelop(tr,yr,Fe);

% deux frequences proches
x1 = sin(2*pi*f1*th);
x2 = sin(2*pi*f2*th);
x = (x1+x2).*env;

x = .98*x/(max(abs(x)));
sound(x,Fe);
%wavwrite(x,Fe,'../SONS/201battements.wav');
