Home > classes > @fsdata > setFreq.m

setFreq

PURPOSE ^

SETFREQ sets the frequency vector of a fsdata object based on the length of the y vector and the sample rate.

SYNOPSIS ^

function fsd = setFreq(fsd, varargin)

DESCRIPTION ^

 SETFREQ sets the frequency vector of a fsdata object based on the length of the y vector and the sample rate.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

 DESCRIPTION: SETFREQ sets the frequency vector of a fsdata object based on the
              length of the y vector and the sample rate.

 CALL:        fsd = setFreq(fsd)

 VERSION:     $Id: setFreq.m,v 1.4 2007/11/30 19:36:05 ingo Exp $

 HISTORY:     31-01-2007 M Hewitson
                 Creation

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function fsd = setFreq(fsd, varargin)
0002 % SETFREQ sets the frequency vector of a fsdata object based on the length of the y vector and the sample rate.
0003 %
0004 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0005 %
0006 % DESCRIPTION: SETFREQ sets the frequency vector of a fsdata object based on the
0007 %              length of the y vector and the sample rate.
0008 %
0009 % CALL:        fsd = setFreq(fsd)
0010 %
0011 % VERSION:     $Id: setFreq.m,v 1.4 2007/11/30 19:36:05 ingo Exp $
0012 %
0013 % HISTORY:     31-01-2007 M Hewitson
0014 %                 Creation
0015 %
0016 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0017 
0018 VERSION  = '$Id: setFreq.m,v 1.4 2007/11/30 19:36:05 ingo Exp $';
0019 
0020 if  nargin == 2 && isa(fsd, 'fsdata') && ischar(varargin{1})
0021   if strcmp(varargin{1}, 'Params')
0022     fsd = plist();
0023     return
0024   elseif strcmp(varargin{1}, 'Version')
0025     fsd = VERSION;
0026     return
0027   end
0028 end
0029 
0030 fsd.x = linspace(0, fsd.fs/2, length(fsd.y));
0031 fsd = reshapeF(fsd);
0032 
0033 % END

Generated on Tue 22-Jan-2008 10:39:13 by m2html © 2003