% Unlimited Function Sampling and Spectrum
%
% SAMPLING illustrates the spectrum from samples of data functions, 
% with emphasis on selecting the proper sampling frequency, fs, and
% sample number, N.  There are four functions to select among, and an
% option to specify a custom data function.  The edit box for fs can 
% accept non-numeric input such as "6/pi" to specify an exact frequency.
% The spectrum calculated by the Discrete Fourier Transform of the samples 
% is shown.  The spectrum type is selected among Amplitude spectrum, Power 
% spectrum, and Complex spectrum.  The sampled points and the spectrum
% are assigned in the main workspace by pushing the "Return" button.
% If the sampling frequency is too low, a nasty red bar appears in the 
% spectrum marking the correct location of the aliased frequency.
%
% In SINE mode, the amplitude, frequency, and delay of the sine wave
% can be edited by pushing the "Define" button.
%
% In MULTI-PERIODIC mode, the data function is a sum of multiple sine
% waves.  Upon pushing the "Define" button, first the number of individual
% sine waves is selected.  Next a series of input dialogs specifies the
% individual amplitudes, frequencies, and delays.  The default values are
% the partial Fourier series for a square wave.  The input dialogs can 
% accept non-numeric inputs such as "4/(3*pi)," such as are necessary
% to exactly specify Fourier components.
%
% In ROSSLER X mode, the data function is the x component of Rossler's
% strange attractor.  This is a chaotic but quasi-periodic function with
% average period 2*pi and average amplitude of about 10.  
%
% In SQUARE2 mode, the data function is a true square wave of period 2*pi.
% Because the true square wave has infinite bandwidth, there will always
% be some degree of aliasing even with a very high sampling frequency.  No
% red bars appear because they are useless in this case.
%
% SAMPLING('myfun','F') replaces the SQUARE2 mode with any other function
% name "F."  For example:
%        sampling('myfun','cos')
% replaces the square wave with the cosine function.  Any standard or
% user-defined function can be sampled in this way.
%
% See also FOURCOEF, FUNSPECT, DATASPECT, FIRSTORD, 
% SECONDORD, and MULTISYS.
%
