%Lab report 2 Script
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
[out]=tapedelay(x,drygain,delaygain,modgain,delay,feedback,cutofflowpass,cutoffhighpass,filterorderlowpass,filterorderhighpass,saturation,Modfreq,width,fs);
%By using the wavwrite function to save the output signals 
%a range of different parameters can be showcased in the tape delayfunction.

[x,fs]= wavread('anechoic_voice.wav');%calling input wav. signal to be implemented into the tapedelay function

%important to note that the parameters being changed are the ones that
%pertain to tape delay, examples of different gain, delay times, and
%feedback are self explanitory.

[out]=tapedelay(x,0.9,0.2,0.2,0.3,0.5,2000,100,10,10,3,1,0.000001,fs); %these set of parameters exaggerate the lowpass filter implemented
wavwrite(out,fs,'tapedelay1');

[out]=tapedelay(x,0.9,0.2,0.2,0.3,0.5,20000,2000,10,10,3,1,0.000001,fs); %these set of parameters exaggerate the highpass filter implemented
wavwrite(out,fs,'tapedelay2');

[out]=tapedelay(x,0.9,0.2,0.2,0.3,0.5,20000,10,10,10,0.1,1,0.000001,fs); %these set of parameters exaggerate the saturation filter implemented
wavwrite(out,fs,'tapedelay3');

[out]=tapedelay(x,0.9,0.4,0.4,0.4,0.5,20000,10,10,10,3,7,0.001,fs); %these set of parameters exaggerate the delay modulation implemented
wavwrite(out,fs,'tapedelay4');

[out]=tapedelay(x,0.9,0.4,0.3,0.8,0.35,7000,180,10,10,0.5,4,0.0001,fs);%these set of parameters could be seen as a preset/or starting point for a tape delay with all the parameters in use
wavwrite(out,fs,'tapedelay5'); %sublte use of the parameters for this particular input signal to try to simulate tape delay.
