function done = experiment(azuma,elev,wavenum);

done = 1;

timeorfreq = 0;

[s u] = genstim;

first = 1;
second = 2;
az = azuma;

if azuma<=0
  first = 2;
  second = 1;
  az = -azuma;
end

htemp = readhrtf(elev,az,'L');

h_left = htemp(first,:)';
h_right = htemp(second,:)';

if timeorfreq==1
  y = [conv(s,h_left) conv(s,h_right)];
else
  S=fft(s);
  H_left=fft(h_left,length(s));
  H_right=fft(h_right,length(s));
  Y(:,1)=H_left.*S;
  Y(:,2)=H_right.*S;
  y=[ifft(Y(:,1)) ifft(Y(:,2))];
  y = real(y);
end


%soundsc(real(y),44100)
y = [[u u];y];
ymax = max([abs(max(y(:,1))) abs(min(y(:,1))) abs(max(y(:,2))) abs(min(y(:,2)))]);
y = y/(ymax+.01);
max(max(abs(y)))


wavwrite(y,44100,sprintf('test%d',wavenum));












