Home > vbmeg > functions > tool_box > time_frequency > mk_tfrscalo.m

mk_tfrscalo

PURPOSE ^

[out_scl,scl_frq,scl_time]=mk_tfrscalo(j,sr,low_freq,high_freq,time_step);

SYNOPSIS ^

function [out_scl,scl_frq,scl_time]=mk_tfrscalo(j,sr,low_freq,high_freq,time_step);

DESCRIPTION ^

[out_scl,scl_frq,scl_time]=mk_tfrscalo(j,sr,low_freq,high_freq,time_step);

j numsamp x numstim
sr = sampling ratei %default 1000
default low_freq=2.5;   high_freq=50 hz.
time step upon which TFR is evaluated  %default = 32msec

 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:

SOURCE CODE ^

0001 function [out_scl,scl_frq,scl_time]=mk_tfrscalo(j,sr,low_freq,high_freq,time_step);
0002 %[out_scl,scl_frq,scl_time]=mk_tfrscalo(j,sr,low_freq,high_freq,time_step);
0003 %
0004 %j numsamp x numstim
0005 %sr = sampling ratei %default 1000
0006 %default low_freq=2.5;   high_freq=50 hz.
0007 %time step upon which TFR is evaluated  %default = 32msec
0008 %
0009 % Copyright (C) 2011, ATR All Rights Reserved.
0010 % License : New BSD License(see VBMEG_LICENSE.txt)
0011 
0012 if nargin<2
0013   sr=1000;
0014 end
0015 if nargin<3
0016    low_freq=2.5;
0017 end
0018 if nargin<4
0019    high_freq=50;
0020 end
0021 if nargin<5 
0022    time_step=32;
0023 end
0024 
0025 numpts_y=32;
0026 [numsamp,numstim]=size(j);
0027 
0028 time_step=(floor(time_step.*(sr./1000)));
0029 
0030 
0031 wave=sqrt(numsamp); %half length of morlet wavelt   %0 mexican hat
0032 numpts_x=length(1:time_step:numsamp);
0033 
0034 
0035 fmin=low_freq./sr;
0036 fmax=high_freq./sr;
0037 
0038 out_scl=zeros(numpts_y,numpts_x,numstim);
0039 for i=1:numstim
0040    in_j=j(:,i);
0041    h=hilbert(in_j);
0042    [out1,t,f]=tfrscalo(h,1:time_step:numsamp,wave,fmin,fmax,numpts_y);
0043    out_scl(:,:,i)=out1;
0044 end
0045 
0046 scl_frq=f.*sr;
0047 scl_time=t./(sr./1000);
0048

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