www.pudn.com > cyclostationary_toolbox.rar > scd.m, change:1998-04-23,size:921b


function S=scd(R,window)
%
% SCD          Compute the spectral correlation density of a signal
%              from its cyclic autocorrelation
%
% USAGE
%              S=scd(R,window)
%              
%              R is the cyclic-autocorrelation of a signal
%              The optional parameter window can be used to select
%              a window function, the default is a hamming window

% File: scd.m
% Last Revised: 23/4/98
% Created: 24/11/97
% Author: Andrew C. McCormick
% (C) University of Strathclyde

if nargin==1
  window='hamming';
end

[r,c]=size(R);

% convert even number of rows to odd number of rows

win=feval(window,r);

win=win*ones(1,c);

S=fft(R.*win);

if nargout==0  
  dispS=S(1:(r-1)/2,1:floor(c/2)+1);
  x=(0:floor(c/2));
  y=(1:(r-1)/2)-1;
  x=x/c;y=y/r;
  contour(x,y,abs(dispS))
  title('Spectral Correlation Density');
  xlabel('alpha * pi radians');
  ylabel('f * pi radians');
end