%% Generate Variable-Frequency Tones in Simulink
% Examine the Audio Oscillator block in a Simulink(R) model and tune the
% parameters.
%
open_system('ExampleAudioOscillatorModel');

%% 
%
% 1. Run the simulation. Listen to the tone from the Audio Oscillator block
% generating a sine wave. Visualize the spectrums of all three waveforms on
% the Spectrum Analyzer. Visualize the waveforms on the Time Scope.
%
% 2. Toggle the manual switches to listen to the square and sawtooth waves. 
%
% 3. Open any of the Audio Oscillator blocks and modify the Frequency (Hz)
% or Amplitude parameters to hear the effect and visualize the effect on
% the Spectrum Analyzer and Time Scope.
%
open_system('ExampleAudioOscillatorModel/Spectrum Analyzer');
open_system('ExampleAudioOscillatorModel/Time Scope');
sim('ExampleAudioOscillatorModel',5);

%% 
% Copyright 2019 The MathWorks, Inc.