function [y,phi]=block(o,phi,duty,f)
% block - generate square wave

u=cumsum([phi,1./ceil(1./f)]);
y=mod(u(1:end-1),1)<duty;
phi=mod(u(end),1);
	
