'\" te .\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved .TH mlib_SignalAutoCorrel_S16 3MLIB "2 Mar 2007" "SunOS 5.11" "mediaLib Library Functions" .SH NAME mlib_SignalAutoCorrel_S16, mlib_SignalAutoCorrel_S16S, mlib_SignalAutoCorrel_F32, mlib_SignalAutoCorrel_F32S \- signal auto-correlation .SH SYNOPSIS .LP .nf cc [ \fIflag\fR... ] \fIfile\fR... \fB-lmlib\fR [ \fIlibrary\fR... ] #include \fBmlib_status\fR \fBmlib_SignalAutoCorrel_S16\fR(\fBmlib_d64 *\fR\fIcorrel\fR, \fBconst mlib_s16 *\fR\fIsrc\fR, \fBmlib_s32\fR \fIdisp\fR, \fBmlib_s32\fR \fIn\fR); .fi .LP .nf \fBmlib_status\fR \fBmlib_SignalAutoCorrel_S16S\fR(\fBmlib_d64 *\fR\fIcorrel\fR, \fBconst mlib_s16 *\fR\fIsrc\fR, \fBmlib_s32\fR \fIdisp\fR, \fBmlib_s32\fR \fIn\fR); .fi .LP .nf \fBmlib_status\fR \fBmlib_SignalAutoCorrel_F32\fR(\fBmlib_d64 *\fR\fIcorrel\fR, \fBconst mlib_f32 *\fR\fIsrc\fR, \fBmlib_s32\fR \fIdisp\fR, \fBmlib_s32\fR \fIn\fR); .fi .LP .nf \fBmlib_status\fR \fBmlib_SignalAutoCorrel_F32S\fR(\fBmlib_d64 *\fR\fIcorrel\fR, \fBconst mlib_f32 *\fR\fIsrc\fR, \fBmlib_s32\fR \fIdisp\fR, \fBmlib_s32\fR \fIn\fR); .fi .SH DESCRIPTION .sp .LP Each of these functions performs auto-correlation. .sp .LP For monaural signals, the following equation is used: .sp .in +2 .nf 1 n-d-1 correl[0] = ----- * SUM (src[i] * src[i + d]) n - d i=0 .fi .in -2 .sp .LP For stereo signals, the following equation is used: .sp .in +2 .nf 1 n-d-1 correl[0] = ----- * SUM (src[2*i] * src[2*(i + d)]) n - d i=0 1 n-d-1 correl[1] = ----- * SUM (src[2*i + 1] * src[2*(i + d) + 1]) n - d i=0 .fi .in -2 .sp .LP where \fBd = disp\fR. .SH PARAMETERS .sp .LP Each of the functions takes the following arguments: .sp .ne 2 .mk .na \fB\fIcorrel\fR\fR .ad .RS 10n .rt Pointer to the auto-correlation array. In the stereo version, \fBcorrel[0]\fR contains the auto-correlation of channel \fB0\fR, and \fBcorrel[1]\fR contains the auto-correlation of channel \fB1\fR. .RE .sp .ne 2 .mk .na \fB\fIsrc\fR\fR .ad .RS 10n .rt Source signal array. .RE .sp .ne 2 .mk .na \fB\fIdisp\fR\fR .ad .RS 10n .rt Displacement. \fB0 \(<= disp < n\fR. .RE .sp .ne 2 .mk .na \fB\fIn\fR\fR .ad .RS 10n .rt Number of samples in the source signal array. .RE .SH RETURN VALUES .sp .LP Each of the functions returns \fBMLIB_SUCCESS\fR if successful. Otherwise it returns \fBMLIB_FAILURE\fR. .SH ATTRIBUTES .sp .LP See \fBattributes\fR(5) for descriptions of the following attributes: .sp .sp .TS tab() box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) . ATTRIBUTE TYPEATTRIBUTE VALUE _ Interface StabilityCommitted _ MT-LevelMT-Safe .TE .SH SEE ALSO .sp .LP \fBmlib_SignalCrossCorrel_S16\fR(3MLIB), \fBattributes\fR(5)