function [gf,ts]=fisher(m);
%    95% PERCENTILES FOR THE FISHER'S AND SIEGEL'S TEST OF PERIODICITY
% =======================================================================
% function [gf,ts]=fisher(m);
% INPUT:
% m ... vector of lengths of the periodogram, 5<=m(j)<=1000
% OUTPUT:
% gf... gf(j)=Fisher's 95% percentile for m(j)
% ts... ts(j)=Siegel's 95% percentile for m(j)

% (C) 1997-1999, V. Vesely, Masaryk University of Brno (Czech Republic)
% Rev. 1, Dec. 22, 1999
%
error(nargchk(1,1,nargin));
if any(m<5), error('Periodogram must have length at least 5'); end
if any(m>1000), error('The periodogram length must not exceed 1000'); end
GF = [0.6837722340, 0.274       ;
      0.4449525606, 0.1812916218;
      0.3346119552, 0.1401751436;
      0.2704042202, 0.1159434232;
      0.2280456085, 0.0997325432;
      0.1978406246, 0.0880198043;
      0.1751294860, 0.0791060851;
      0.1573827449, 0.0720634801;
      0.1431035999, 0.0663391976;
      0.1313472721, 0.0615819252;
      0.1130887896, 0.0541010364;
      0.0995257984, 0.0484581309;
      0.0890258722, 0.0440297152;
      0.0806402063, 0.0404493552;
      0.0737781851, 0.0374866267;
      0.0522136336, 0.0279346469;
      0.0407367370, 0.0226517317;
      0.0335542444, 0.0192460210;
      0.0286124993, 0.0168450268;
      0.0249931178, 0.0150496264;
      0.0222217969, 0.0136497353;
      0.0200280827, 0.0125235715;
      0.0182461407, 0.0115953645;
      0.0155221997, 0.0101493846;
      0.0135334433, 0.0090692380;
      0.0120144724, 0.0082276189;
      0.0108145470, 0.0075508836;
      0.0098415283  0.0069932836
      ];
mGF =[5:5:50,60:10:100,150:50:500,600:100:1000].';
gf=spline(mGF,GF(:,1),m);
if nargout>1
   ts=spline(mGF,GF(:,2),m);
end
