sf = 8192;                    % sample frequency (Hz)
d = 2.0;                       % duration (s)
n = sf * d;                    % number of samples

% set carrier
cf = 1000;                     % carrier frequency (Hz)
c1 = (1:n) / sf;                % carrier data preparation
c = 2 * pi * cf * c1;

% set modulator
mf = 5;                        % modulator frequency (Hz)
mi = 0.5;                      % modulator index
m = (1:n) / sf;                % modulator data preparation
m = mi * cos(2 * pi * mf * m); % sinusoidal modulation

% frequency modulation
s = sin(.1*c.^1.3);% + m);    % my frequency modulation
%s = sin(c + m);                % frequency modulation

% sound presentation
sound(s, sf);                  % sound presentation
pause(d + 0.5);                % wating for sound end
figure(2)
plot(c1,s)
axis([0, 1, -1, 1]) 
