Home > bml > signal > bml_coding2raw.m

bml_coding2raw

PURPOSE ^

BML_CODING2RAW creates a raw from the audio in the Coding file

SYNOPSIS ^

function raw = bml_coding2raw(cfg)

DESCRIPTION ^

 BML_CODING2RAW creates a raw from the audio in the Coding file

 Use as
   annot = bml_coding2raw(cfg)

 cfg.CodingMatPath    - path to mat file with coding info
 cfg.t0               - Time origin of audio file in coding mat file

 returns a raw with the audio

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function raw = bml_coding2raw(cfg)
0002 
0003 % BML_CODING2RAW creates a raw from the audio in the Coding file
0004 %
0005 % Use as
0006 %   annot = bml_coding2raw(cfg)
0007 %
0008 % cfg.CodingMatPath    - path to mat file with coding info
0009 % cfg.t0               - Time origin of audio file in coding mat file
0010 %
0011 % returns a raw with the audio
0012 
0013 if nargin == 1
0014   CodingMatPath = bml_getopt_single(cfg,'CodingMatPath');
0015   assert(~isempty(CodingMatPath),'cfg.CodingMatPath required in single argument call');
0016   load(CodingMatPath,'Audio');
0017   load(CodingMatPath,'Afs');
0018 else 
0019   error('Use as bml_codingmatrix2raw(cfg)');
0020 end
0021 
0022 t0               = bml_getopt(cfg,'t0',0);
0023 
0024 if size(Audio,1) > size(Audio,2)
0025   Audio = Audio';
0026 end
0027 
0028 raw=[];
0029 raw.trial = {Audio};
0030 raw.label = {'CodingAudio'};
0031 raw.time  = {t0 + (1:length(Audio)) ./ Afs};
0032 raw.fsample = Afs;
0033 
0034 
0035 
0036

Generated on Tue 25-Sep-2018 10:08:19 by m2html © 2005