zero_crossings.m
SYNTAX: [ldg_edge_smple,trl_edge_smple,ldg_edge,trl_edge] =
zero_crossings(data,time)
PURPOSE: Estimate locations (sample indices) where data crosses zero.
Optionally computes estimated times of zero crossings.
INPUT:
data = data vector to find zero crossings in
time = time vector corresponding to data (optional, when input the
ldg_edge and trl_edge outputs are computed)
OUTPUT:
ldg_edge_smple = sample numbers in "data" where data will cross zero
with a positive slope going to next sample
trl_edge_smple = sample numbers in "data" where data will cross zero
with a negative slope going to next sample
ldg_edge = time values corresponding to estimated zero crossing value
trl_edge = time values corresponding to estimated zero crossing value
Dependencies