home *** CD-ROM | disk | FTP | other *** search
/ C!T ROM 5 / ctrom5b.zip / ctrom5b / WINDOWS / DIVERSEN / MATHS171 / WSINA.M < prev    next >
Text File  |  1993-03-23  |  551b  |  24 lines

  1. function y = wsina(n,np,woff)
  2. %y=wsina(n,na, woff)
  3. %create a family of sine windows
  4. %   n    - number of points
  5. %   np   - power of sin (default is one) 
  6. %          Popular values of na are 1, 2, 3, 4
  7. %   woff - offset (default 0)
  8. %
  9. % sine lobe window is generated by wsina(n)
  10.  
  11. %       S.Halevy 7/31/92
  12. %       Copyright (c) 1992 by the MathWizards
  13.  
  14. %y = sinw(n,0.5);    % last sample matched to the first
  15. y = sin(pi*x01(n));  % for MATLAB compatibility
  16.  
  17. if nargin>1
  18.   y = y .^ np;
  19. end
  20. if nargin>2
  21.   y = woff + (1-woff)*y;
  22. end
  23.  
  24.