findtrigs(trigger_c​han,varargin)

finds trigger onset/offset from TTL trig channel
49 Downloads
Updated 17 Feb 2016

View License

% ----------[Lindex,Sindex] = findtrigs(trigger_chan,varargin)-------------
%
% Finds stim indexes from TTL stim channel given user-defined min/max
% thresholds for stims.
%
% >>> INPUTS >>>
% Required:
% trigger_chan: trigger data
% Optional:
% Lthresh: min, max for stim (i.e. [.2 .6])
% Fs: sampling rate...to return stim times in seconds
% mpd: minimum distance between peaks in samples (default = 0)
%
% <<< OUTPUTS <<<
% StimOn: time (in samples) of stim
% StimOff: time (in samples) of off-times of stim
% StimIndex: indicies of stims found (useful if stim channel has
% multiplexed stimuli)
% StimThrsh: output thresh for stims (to use in loop if desired)
%
% by JMS, 09/29/2015
% --------------------------------------------------------------------------

Cite As

Jordan Sorokin (2024). findtrigs(trigger_chan,varargin) (https://www.mathworks.com/matlabcentral/fileexchange/55458-findtrigs-trigger_chan-varargin), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2013a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Frequently-used Algorithms in Help Center and MATLAB Answers
Tags Add Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.0.0.0