%
%%%% ssqr.m: square wave
%       f: pitch frequency (Hz), len: length (sec), rate: sampling rate
%
function [y] = ssqr(f, len, rate)
if (nargin < 3) rate = 8192; end;
if (nargin < 2) len = 1; end;

t = 0:1/rate:(len-1/rate);
y = square(2*pi*f*t);
sound(y, rate);
