
function testFreq( data, Fs )

%TESTFS	Test if data has the expected sampling frequency.
%	TESTFS( data, Fs [10 KHz] )  tests whether 
%	the variable 'data' has the expected sampling
%	frequency (in KHz) defined by Fs (default is 
%	10).


if( nargin < 2 ), Fs = 10;, end
   
estimateFs = round( 1 / (data(2,1) - data(1,1)) );  % uses first two time stamps to estimate Fs.

if( estimateFs  ~= Fs )
   warning( ['The data has sampling frequency: ', num2str( estimateFs ) ,' KHz, different than expected: ', num2str( Fs ),' KHz.'] )
end
