function beat(f,delta)

% function to output a sound at frequency f and a sound at a slightly higher
% freq (delta+freq).  This creates a beat frequency.

Fs = 44100;
numSeconds = 10;
samples = 0:1/Fs:numSeconds;
output = sin(2*pi*f*samples)+sin(2*pi*(f+delta)*samples);
sound(output,Fs);