imat_fn/zuxr


Purpose

Zero up crossing rate.

Syntax

m = zuxr(f)
m = zuxr(f,MODE)

Description

ZUXR calculates the zero up crossing rate of the supplied imat_fn.

For both evenly and unevenly spaced functions in the time domain the formula used is

zuxr = sum(diff(y>0)>0)/(x(end)-x(1));

For frequency domain functions, the signal is assumed to be Gaussian random and uses the formula

zuxr = rms(y)/rms(f^2*y);

where f is the abscissa frequency in Hz and the function RMS is calculated in the same way with the same considerations as imat_fn/rms.

MODE is an optional input string specifying the interpolation type to use. Valid options are 'linlin' (default), 'linlog', 'loglin', and 'loglog'. Two frequency-banded options are also supported. These are 'linband' and 'logband'. Both of these options assume that the frequencies specified in the function abscissa are the center frequencies of each band.

When calculating using either of the banded options, the ordinate value is assumed to be constant in that band. The only difference in the two is how the bandwidths are computed. These are computed as such:

'linband' The edges of each frequency band is simply the average of the two adjacent center frequencies. The first bandwidth is the distance between the first and second frequencies, and the last bandwidth is the distance between the last and next-to-last frequencies.
'logband' The frequency band edges are simply the geometric average of the two adjacent center frequencies, sqrt(f1*f2). The lowest band edge is calculated as f1*sqrt(f1/f2), where f1 and f2 are the first two center frequencies. The highest band edge is calculated as fn*sqrt(fn/fn-1) where fn-1 and fn are the last two center frequencies.

 

See also

imat_fn/rms, imat_fn/mean, imat_fn/std