% plotfft.m  m-file function to plot waveforms 

  function plotfft(wavetype,t,y,Amp,off,phase,nwave,Ampl,f1,fn,freq,T,variance,usrname)

addpath('/tool/local/matlab5.3/toolbox/local/loc_plot');
v=[0 max(t) -1*Amp+off-.5 1*Amp+off+.5]; 
subplot(211),plot(t,y)
axis(v)
ttle = ['Waveform: ' wavetype];
title(ttle)
ylabel('Input Signal')
xlabel('time (sec)')

maxay = max(Ampl);
va=[-f1 fn 0 maxay+.5];
%[xfreq,xAmp]=bar(freq,Ampl);
subplot(212),bar(freq,Ampl); %plot(xfreq,xAmp)
axis(va)
xlabel('frequency (Hz)')
ylabel('Fourier Amplitude Coef')
vari = variance;

if nwave==1
 title(['Period=',num2str(T),' Phase= ',num2str(phase),' Amp= ',num2str(Amp),' Mean= ',num2str(off),' variance= ',num2str(vari)])
elseif nwave<5
 title([' Mean= ',num2str(off),' variance= ',num2str(vari)])
end

signature(usrname);

%strike=('Strike any key to continue');
%disp(strike)

%pause

return;
