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

  1. function y = blackman(n)
  2. %y=blackman(n)
  3. %n - number of window points
  4. %y - n-point Blackman's window function
  5.  
  6. %       S.Halevy 7/31/92
  7. %       Copyright (c) 1992 by the MathWizards
  8.  
  9. %wa = [7938 -9240 1430]/18608;   % exact Blackman window
  10. wa = [0.42 -0.50 0.08];          % standard Blackman window
  11.  
  12. wn = length(wa);
  13.  
  14. y = wa(1);
  15.  
  16. for k=2:wn
  17.    % y += wa(k)*cosw(n,k-1);             % last sample matched to the first
  18.    y += wa(k)*cos(2*pi*(k-1)*x01(n));    % for MATLAB compatibility
  19. end
  20.  
  21. y=y.';
  22.  
  23.  
  24.