[Homer-users] timing of aux channels in Homer

Andrei Medvedev am236 at georgetown.edu
Mon Dec 12 13:56:02 EST 2005
Search archives:

Hi Ted,

Could you please explain how the timing of the aux channels is taken care of in the Homer and the routine 'select_sd_CW5.m'? I use the aux channel in the CW5 to store trigger synchro-pulses. When I ran your original version of the 'select_sd_CW5.m', I had a number of data points in the stimulus array (s) slightly different from the optical data channels (d) after downnsampling to 100 Hz. I thought it may be due to the following code from 'select_sd_CW5.m', which seems to cut some first data points:

%Now we will deal with the Aux10 files
%this makes a call to the dac() file which unpacks the Cw5 structure

%the output of the National Instruments board is 25kHz but the output of
%the cw5 (after Cw5Filter.exe is 100.0159 Hz)- therefore, we need to
%interperlate the auxillary data to fill in the missing points (we would rather make 
%up aux points then throw away data)

if exist(filein2A)~=0
    [da,header]=dac(filein2A);

%The part of code to identify the start of the light channel and rearrange
%aux channels accordingly.
    drng=da(1,1:2*25000);%Assuming that the clock is in channel 1.Also delay is no more than 2 sec
    zindx=find(drng==0);
    zindx=find(drng<thres);
    for i=1:size(zindx,2)
      if(zindx(i+1)-zindx(i)>1)
        lcn=zindx(i)
        break;
        end
       end
 
    aux=da(:,lcn:end); %The new output doesn't contain the clock but all other channels
    aux=da; 
    header.data_rate;
    trunsec=lcn/ans;
    clear da,drng,zindx,lcn;
     
%End of code to identify the start of the light channel.

But if I ignore this piece of coding and directly downsample array 's' from 25,000 Hz to 100 Hz keeping the same number of points as in array 'd', timing does not seem to be right because the trigger pulse gets delayed by ~100ms (checked with recording a trigger pulse by one optical channel using LED). 

It is not clear to me how the code above works but it may be necessary to keep the right timing. Can you explain? For example, what is the light channel and what is the clock which seems to be within the first 2 sec of aux channel 1? Does the aux channel have some extra points at the beginning?

Thanks,
Andrei.

Dr. Andrei Medvedev, Ph.D.
Assistant Professor,
Center for Functional and Molecular Imaging
Georgetown University Medical Center
3900 Reservoir Rd, NW
Preclinical Science Building LM-14
Washington, DC 20057-1488
tel.: 202-687-5126





More information about the Homer-users mailing list