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 = 2;
   p.Type = 1;  % Type of incident wave profile.
                % Type 0:  Pierson Moskowitz Spectrum with Amplitude = A and
                %          peak period = T.
                % Type 1:  Wave amplitude ramps to sine wave with Amplitude = A and
                %          peak period = T.
   p.g = 9.81;  
   p.n_phases = 300;
  
   p.spectrum = 0;
   p.freq = 0;
   p.df = .001;
   p.fmax = .3;
   
   p.beta = 1;  %Wave direction, +1 = moving towards positive x, -1 = moving towards negative x.
         
   %defaultStream = RandStream.getDefaultStream;
   %savedState = defaultStream.State;
   phasea = 0;
   phaseb = 2*pi; 
   p.phases = phasea + (phaseb-phasea).*rand(p.n_phases,1);

  %defaultStream.State = savedState;
  
   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