Home > vbmeg > functions > device > eeg > vb_eegfile_get_sampling_frequency.m

vb_eegfile_get_sampling_frequency

PURPOSE ^

return valid sampling frequency from EEG-MAT file

SYNOPSIS ^

function [freq] = vb_eegfile_get_sampling_frequency(eegfile)

DESCRIPTION ^

 return valid sampling frequency from EEG-MAT file
 [usage]
   [channel_list] = vb_eegfile_get_sampling_frequency(eegfile)
 [input]
   eegfile : <required> <<file>> EEG-MAT file (*.eeg.mat)
 [output]
      freq : value of sampling frequency
 [note]
   @see vb_eeginfo_get_sampling_frequency.m
 [history]
   2007-08-02 (Sako) initial version

 Copyright (C) 2011, ATR All Rights Reserved.
 License : New BSD License(see VBMEG_LICENSE.txt)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 function [freq] = vb_eegfile_get_sampling_frequency(eegfile)
0002 % return valid sampling frequency from EEG-MAT file
0003 % [usage]
0004 %   [channel_list] = vb_eegfile_get_sampling_frequency(eegfile)
0005 % [input]
0006 %   eegfile : <required> <<file>> EEG-MAT file (*.eeg.mat)
0007 % [output]
0008 %      freq : value of sampling frequency
0009 % [note]
0010 %   @see vb_eeginfo_get_sampling_frequency.m
0011 % [history]
0012 %   2007-08-02 (Sako) initial version
0013 %
0014 % Copyright (C) 2011, ATR All Rights Reserved.
0015 % License : New BSD License(see VBMEG_LICENSE.txt)
0016 
0017 % --- CHECK ARGUMENTS --- %
0018 if ~exist('eegfile', 'var') eegfile = []; end
0019 [eegfile] = inner_check_arguments(eegfile);
0020 
0021 
0022 % --- MAIN PROCEDURE --------------------------------------------------------- %
0023 %
0024 eeginfo = vb_eegfile_load_eeginfo(eegfile);
0025 freq = vb_eeginfo_get_sampling_frequency(eeginfo);
0026 return;
0027 %
0028 % --- END OF MAIN PROCEDURE -------------------------------------------------- %
0029 
0030 % --- INNER FUNCTIONS -------------------------------------------------------- %
0031 %
0032 % --- inner_check_arguments()
0033 %
0034 function [eegfile] = inner_check_arguments(eegfile)
0035 func_ = mfilename;
0036 if isempty(eegfile)
0037   error('(%s)eegfile is a required parameter', func_);
0038 end
0039 
0040 if exist(eegfile, 'file') ~= 2
0041   error('(%s)cannot find eegfile : %s', func_, eegfile);
0042 end
0043 return;
0044 %
0045 % --- end of inner_check_arguments()
0046 
0047 % --- END OF INNER FUNCTIONS ------------------------------------------------- %
0048 
0049 %%% END OF FILE %%%

Generated on Mon 22-May-2023 06:53:56 by m2html © 2005