function p = IncWave(name,varargin)
% GPSSim Create a IncWave object 
switch nargin
case 0
   % if no input arguments, create a default object
   p.A = 1;
   p.T = 10;
   p.Type = 1;  % Type of incident wave profile.
                % Type 0:  Pierson Moskowitz Spectrum with Amplitude = A
                % Type 1:  Wave amplitude ramps to sine wave with Amplitude = A and
                %          period = T.
                % Type 2:  User Supplied Spectrum 
                % Type 3:  Modified Pierson Moskowitz Spectrum with Amplitude = A and
                %          peak period = T.
                
   p.g = 9.81;  
   p.fmin = .001;
   p.fmax = .501;  
   p.n_freq = 1;
   p.phases = 0;
   p.freq = 1/p.T;
   df = (p.fmax-p.fmin)/p.n_freq;
   p.spectrum = p.A^2/(2*df);
   p.beta = 1;  %Wave direction, +1 = moving towards positive x, -1 = moving towards negative x.    

   p.phases = 0;
   p.tau = 0;
   
   p = class(p,'IncWave');
  
case 1
   % if single argument of class IMUsim, return it
   if isa(name,'IncWave')
      p = name;
   else
      disp([inputname(1) ' is not an GPSSim object']);
      return
   end
otherwise
   % create object using specified arguments
   disp('Specific arguments not implemented');
end