libsent/src/adin/zc-e.c File Reference

Count zero cross and level for speech detection. More...

#include <sent/stddefs.h>
#include <sent/adin.h>

Go to the source code of this file.

Functions

void init_count_zc_e (ZEROCROSS *zc, int length)
 Allocate buffers for zerocross counting.
void reset_count_zc_e (ZEROCROSS *zc, int c_trigger, int c_length, int c_offset)
 Initialize all parameters and buffers for zero-cross counting.
void free_count_zc_e (ZEROCROSS *zc)
 End procedure: free all buffers.
int count_zc_e (ZEROCROSS *zc, SP16 *buf, int step)
 Adding buf[0.
void zc_copy_buffer (ZEROCROSS *zc, SP16 *newbuf, int *len)
 Flush samples in the current cycle buffer.


Detailed Description

Count zero cross and level for speech detection.

Count zero cross number within the given length of cycle buffer. The content of the cycle buffer will be swapped with the newest data, So the input delays for the length of the cycle buffer.

Author:
Akinobu LEE
Date:
Mon Feb 14 19:11:34 2005
Revision
1.1.1.1

Definition in file zc-e.c.


Function Documentation

void init_count_zc_e ( ZEROCROSS zc,
int  length 
)

Allocate buffers for zerocross counting.

Parameters:
zc [i/o] zerocross work area
length [in] Cycle buffer size = Number of samples to hold

Definition at line 49 of file zc-e.c.

Referenced by adin_setup_param(), and reset_count_zc_e().

void reset_count_zc_e ( ZEROCROSS zc,
int  c_trigger,
int  c_length,
int  c_offset 
)

Initialize all parameters and buffers for zero-cross counting.

Parameters:
zc [i/o] zerocross work area
c_trigger [in] Tgigger level threshold
c_length [in] Cycle buffer size = Number of samples to hold
c_offset [in] Static DC offset of input data

Definition at line 68 of file zc-e.c.

Referenced by adin_cut().

void free_count_zc_e ( ZEROCROSS zc  ) 

End procedure: free all buffers.

Parameters:
zc [i/o] zerocross work area

Definition at line 98 of file zc-e.c.

Referenced by reset_count_zc_e().

int count_zc_e ( ZEROCROSS zc,
SP16 buf,
int  step 
)

Adding buf[0.

.step-1] to the cycle buffer and update the count of zero cross. Also swap them with the oldest ones in the cycle buffer. Also get the maximum level in the cycle buffer.

Parameters:
zc [i/o] zerocross work area
buf [I/O] new samples, will be swapped by old samples when returned.
step [in] length of above.
Returns:
zero-cross count of the samples in the cycle buffer.

Definition at line 116 of file zc-e.c.

Referenced by adin_cut().

void zc_copy_buffer ( ZEROCROSS zc,
SP16 newbuf,
int *  len 
)

Flush samples in the current cycle buffer.

Parameters:
zc [i/o] zerocross work area
newbuf [out] the samples in teh cycle buffer will be written here.
len [out] length of above.

Definition at line 165 of file zc-e.c.

Referenced by adin_cut().


Generated on Tue Dec 18 16:01:38 2007 for Julius by  doxygen 1.5.4