% file generating a sinusoidal tone and playing it with the sound command dur = 2; % duration of tone in seconds Fs = 44100; % sampling rate per second wdms = 20; % gating window in ms (for temporal envelope) f = 130; % frequency of tone t = (0:(1/Fs):dur); % from 0 to dur with 1/Fs increments x = 0.2*cos(2*pi*f*t); x = wind(srate,wdms,x); % window wavwrite(x, Fs, 'a_sound_wind'); sound(x,Fs);