% sampling frequency (Hz)
%Fs = 48000;
Fs = 44100;

% time in seconds of sound sample
T = 1.2;

% time in seconds of silence
T = 0.5;

%  total number of samples
N = Fs*T;

% time variable
%t = (0:N-1)/Fs;
t = (1:N)/Fs;

%  generate a pure tone with F1 frequency
F1 = 440; %A4
x1 = sin(2*pi*F1*t);

F2 = 442;
x2 = sin(2*pi*F2*t);

F3 = 1046.50; %C6
x3 = sin(2*pi*F3*t);


s1 = x1;
s1 = 0.9*s1/norm(s1,'inf');

s2 = x1+0.05*x2; 
s2 = 0.9*s2/norm(s2,'inf');

s3 = x1+0.05*x3; 
s3 = 0.9*s3/norm(s3,'inf');

s4 = x1+x2; 
s4 = 0.9*s4/norm(s4,'inf');

silence = zeros(1,ceil(Fs*0.5));

% experiment A
wavwrite([s2,silence,s1],Fs,16,'expA.wav');
% experiment B
wavwrite([s1,silence,s3],Fs,16,'expB.wav');
% experiment C
wavwrite([s1,silence,s1],Fs,16,'expC.wav');
% experiment D
wavwrite([s1,silence,s4],Fs,16,'expD.wav');

% afplay
