libsent/src/adin/ds48to16.c File Reference

Down sampling from 48kHz to 16kHz. More...

#include <sent/stddefs.h>
#include <sent/adin.h>
#include "lpfcoef_3to4.h"
#include "lpfcoef_2to1.h"

Go to the source code of this file.

Defines

#define USE_HEADER_COEF
 TRUE if use embedded values on header.
#define mod(x)   ((x) & (DS_RBSIZE -1))
 USB device sampling rate.

Functions

static void load_filter_from_header_2to1 (DS_FILTER *f)
 Set 1/2 filter coefficients from header values.
static void load_filter_from_header_3to4 (DS_FILTER *f)
 Set 4/2 filter coefficients from header values.
static void init_filter (DS_FILTER *f, int d, int u)
 Initialize filter values.
static void firin (DS_FILTER *f, double in)
 Store input for FIR filter.
static double firout (DS_FILTER *f, int os)
 Get filtered output from FIR filter.
static int do_filter (DS_FILTER *f, double *dst, double *src, int len, int maxlen)
 Perform down sampling of input samples.
DS_BUFFERds48to16_new ()
 Setup for down sampling.
void ds48to16_free (DS_BUFFER *ds)
 Free the down sampling buffer.
int ds48to16 (SP16 *dst, SP16 *src, int srclen, int maxdstlen, DS_BUFFER *ds)
 Perform down sampling of input samples to 1/3.


Detailed Description

Down sampling from 48kHz to 16kHz.

Author:
Akinobu LEE
Date:
Sun Feb 13 16:18:26 2005
Revision
1.1.1.1

Definition in file ds48to16.c.


Define Documentation

#define mod (  )     ((x) & (DS_RBSIZE -1))

USB device sampling rate.

filter parameters in header Buffer index cycler

Definition at line 41 of file ds48to16.c.


Function Documentation

static void load_filter_from_header_2to1 ( DS_FILTER f  )  [static]

Set 1/2 filter coefficients from header values.

Parameters:
f [out] filter info

Definition at line 51 of file ds48to16.c.

static void load_filter_from_header_3to4 ( DS_FILTER f  )  [static]

Set 4/2 filter coefficients from header values.

Parameters:
f [out] filter info

Definition at line 69 of file ds48to16.c.

static void init_filter ( DS_FILTER f,
int  d,
int  u 
) [static]

Initialize filter values.

Parameters:
f [i/o] filter info
u [in] up sampling rate
d [in] down sampling rate

Definition at line 123 of file ds48to16.c.

static void firin ( DS_FILTER f,
double  in 
) [static]

Store input for FIR filter.

Parameters:
f [i/o] filter info
in [in] an input sample

Definition at line 150 of file ds48to16.c.

static double firout ( DS_FILTER f,
int  os 
) [static]

Get filtered output from FIR filter.

Parameters:
f [i/o] filter info
os [in] point
Returns:
output value

Definition at line 165 of file ds48to16.c.

static int do_filter ( DS_FILTER f,
double *  dst,
double *  src,
int  len,
int  maxlen 
) [static]

Perform down sampling of input samples.

Parameters:
f [i/o] filter info
dst [out] store the resulting samples
src [in] input samples
len [in] number of input samples
maxlen [in] maximum length of dst
Returns:
the number of samples written to dst, or -1 on errror.

Definition at line 190 of file ds48to16.c.

DS_BUFFER* ds48to16_new (  ) 

Setup for down sampling.

Returns:
newly allocated buffer for down sampling

Definition at line 267 of file ds48to16.c.

Referenced by adin_setup_all().

void ds48to16_free ( DS_BUFFER ds  ) 

Free the down sampling buffer.

Parameters:
ds [i/o] down sampling buffer to free

Definition at line 304 of file ds48to16.c.

int ds48to16 ( SP16 dst,
SP16 src,
int  srclen,
int  maxdstlen,
DS_BUFFER ds 
)

Perform down sampling of input samples to 1/3.

Parameters:
dst [out] store the resulting samples
src [in] input samples
srclen [in] number of input samples
maxdstlen [in] maximum length of dst
ds [i/o] down sampling buffer
Returns:
the number of samples written to dst, or -1 on errror.

Definition at line 329 of file ds48to16.c.

Referenced by adin_cut().


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