% demo of creating a synthesized signal and writing as WAV file. Barnett.
fs = 44100;             % standard audio sampling rate
t = (1:10000)/fs;       % times of samples
g = sin(440*2*pi*t);    % formula for a signal (here, v simple one)
% make sure your signal does not fall outside range of -1 to +1 (it clips!)
wavwrite(g,fs,16,'g.wav')  % write it out as 16-bit WAV, mono
