%squarewv.m
%m-file to generate a square wave. See series.m, the main program which 
%also calls cosine.m, triangwv.m, and sawtoothwv.m
% calls m-file fftamps.m

function y = squarewv(Amp,off,phase,w1,t)


y=Amp*square(w1*t) + off;


%text(.35,.4,['Period=',num2str(T),' Amp= ',num2str(Amp),' Mean= ',num2str(off)],'sc')
%text(.35,.37,[' Fundamental freq= ',num2str(f1)],'sc')
%text(.35,.34,['  Variance = ',num2str(variance)],'sc')
%title(['Period=',num2str(T),' Amp= ',num2str(Amp),' Mean= ',num2str(off),' variance= ',num2str(variance)])



