zero crossing determination in octave?

Carlo de Falco carlo.defalco at gmail.com
Sat Dec 6 02:34:06 CST 2008


On 06/dic/08, at 01:08, Jack Crenshaw wrote:

> Um ... I think Patrick was looking for a function that would iterate  
> on the solution. In Matlab, that's fzero.  Your function is only a  
> linear approximation, which might be Ok if the data array is dense,  
> but otherwise, NG.
>
> Jack

Jack,
If the "waveform" is given as data samples (x,y) as specified in  
Patrick's post:

On 05/dic/08, at 20:15, J. Patrick Bedell wrote:
>  Just to clarify, I am asking about estimating the zero crossings of
> a waveform specified as (x,y) values, not finding the roots of a
> polynomial or other function


this is the best you can get.
To use fzero you would need to hava a function to compute y(x) for any  
given x (and an initial guess).
A possible improvement could be to use a smoother interpolant but that  
only makes sense if you know a-priori that the samples come from a  
smooth function.
c.


More information about the Help-octave mailing list