Current File : //usr/man/man3mlib/mlib_SignalCrossCorrel_S16.3mlib
'\" te
.\" Copyright (c) 2007, Sun Microsystems, Inc.  All Rights Reserved 
.TH mlib_SignalCrossCorrel_S16 3MLIB "2 Mar 2007" "SunOS 5.11" "mediaLib Library Functions"
.SH NAME
mlib_SignalCrossCorrel_S16, mlib_SignalCrossCorrel_S16S, mlib_SignalCrossCorrel_F32, mlib_SignalCrossCorrel_F32S \- signal cross correlation
.SH SYNOPSIS
.LP
.nf
cc [ \fIflag\fR... ] \fIfile\fR... \fB-lmlib\fR [ \fIlibrary\fR... ]
#include <mlib.h>

\fBmlib_status\fR \fBmlib_SignalCrossCorrel_S16\fR(\fBmlib_d64 *\fR\fIcorrel\fR, 
     \fBconst mlib_s16 *\fR\fIsrc1\fR, \fBconst mlib_s16 *\fR\fIsrc2\fR, \fBmlib_s32\fR \fIn\fR);
.fi

.LP
.nf
\fBmlib_status\fR \fBmlib_SignalCrossCorrel_S16S\fR(\fBmlib_d64 *\fR\fIcorrel\fR, 
     \fBconst mlib_s16 *\fR\fIsrc1\fR, \fBconst mlib_s16 *\fR\fIsrc2\fR, \fBmlib_s32\fR \fIn\fR);
.fi

.LP
.nf
\fBmlib_status\fR \fBmlib_SignalCrossCorrel_F32\fR(\fBmlib_d64 *\fR\fIcorrel\fR, 
     \fBconst mlib_f32 *\fR\fIsrc1\fR, \fBconst mlib_f32 *\fR\fIsrc2\fR, \fBmlib_s32\fR \fIn\fR);
.fi

.LP
.nf
\fBmlib_status\fR \fBmlib_SignalCrossCorrel_F32S\fR(\fBmlib_d64 *\fR\fIcorrel\fR, 
     \fBconst mlib_f32 *\fR\fIsrc1\fR, \fBconst mlib_f32 *\fR\fIsrc2\fR, \fBmlib_s32\fR \fIn\fR);
.fi

.SH DESCRIPTION
.sp
.LP
Each of these functions performs cross correlation.
.sp
.LP
For monaural signals, the following equation is used:
.sp
.in +2
.nf
             1    n-1
correl[0] = --- * SUM (src1[i] * src2[i])
             n    i=0
.fi
.in -2

.sp
.LP
For stereo signals, the following equation is used:
.sp
.in +2
.nf
             1    n-1
correl[0] = --- * SUM (src1[2*i] * src2[2*i])
             n    i=0

             1    n-1
correl[1] = --- * SUM (src1[2*i + 1] * src2[2*i + 1])
             n    i=0
.fi
.in -2

.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 cross correlation array. In the stereo version, \fBcorrel[0]\fR contains the cross correlation of channel \fB0\fR, and \fBcorrel[1]\fR contains the cross correlation of channel \fB1\fR.
.RE

.sp
.ne 2
.mk
.na
\fB\fIsrc1\fR\fR
.ad
.RS 10n
.rt  
First source signal array.
.RE

.sp
.ne 2
.mk
.na
\fB\fIsrc2\fR\fR
.ad
.RS 10n
.rt  
Second source signal array.
.RE

.sp
.ne 2
.mk
.na
\fB\fIn\fR\fR
.ad
.RS 10n
.rt  
Number of samples in the source signal arrays.
.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_SignalAutoCorrel_S16\fR(3MLIB), \fBattributes\fR(5)