본문내용
이다.
//
#include
#include "volume.h"
#define taps 25
/* Global declarations */
float inp_buffer[BUFSIZE]; /* processing data buffers */
float out_buffer[BUFSIZE];
//edited
float x_buff[taps]={0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0};
/*0.2 lowpass */
float h[taps] = {0.0255, 0.0172, -0.0000, -0.0210, -0.0382, -0.0437, -0.0315, 0.0000, 0.0472, 0.1019, 0.1528, 0.1889, 0.2019, 0.1889, 0.1528, 0.1019, 0.0472, 0.0000, -0.0315, -0.0437, -0.0382, -0.0210, -0.0000, 0.0172, 0.0255 };
/*0.3 lowpass
float h[taps]={-0.0262,-0.0243,0.0000,0.0297,0.0393,0.0146,-0.0324,-0.0661,-0.0485,0.0340,
0.1570,0.2672,0.3113,0.2672,0.1570,0.0340,-0.0485,-0.0661,-0.0324,0.0146,0.0393,0.0297,0.0000,
-0.0243,-0.0262}; */
/*0.3~0.5 bandpass
float h[taps] = {0.0224,-0.0049,0.0000,0.0060,-0.0336,-0.0528,0.0277,0.1129,0.0415,-0.1232
,-0.1342,0.0539,0.1774,0.0539,-0.1342,-0.1232,0.0415,0.1129,0.0277,-0.0528,-0.0336,0.0060,
0.0000,-0.0049,0.0224}; */
/*0.7 highpass
float h[taps] = {-0.0262,0.0243,-0.0000,-0.0297,0.0393,-0.0146,-0.0324,0.0661,-0.0485,
-0.0340,0.1570,-0.2672,0.3113,-0.2672,0.1570,-0.0340,-0.0485,0.0661,-0.0324,-0.0146,0.0393,
-0.0297,-0.0000,0.0243,-0.0262}; */
/*Fs=40kHz
float h[taps] = {-0.0160,0.0135,0.0327,0.0165,-0.0241,-0.0462,-0.0169,0.0463,0.0778,
0.0171,-0.1324,-0.2917,0.6686,-0.2917,-0.1324,0.0171,0.0778,0.0463,-0.0169,-0.0462,-0.0241,
0.0165,0.0327,0.0135,-0.0160}; */
float y;
static int processing(float *input, float *output)
{
int k;
int i;
y = 0;
x_buff[0] = *input;
for (k = 0; k < taps; k++)
{
y += h[k] * x_buff[k];
}
for (i=1;i
{
x_buff[taps-i] = x_buff[taps-i-1];
}
*output = y;
/* additional processing load */
load(processingLoad);
return(TRUE);
}
//
#include
#include "volume.h"
#define taps 7 //when BPF, 9
/* Global declarations */
float inp_buffer[BUFSIZE]; /* processing data buffers */
float out_buffer[BUFSIZE];
//edited
float x_buff[taps]={0.0,0.0,0.0,0.0,0.0,0.0,0.0}; //when BPF ,0.0,0.0};
float y_buff[taps]={0.0,0.0,0.0,0.0,0.0,0.0,0.0}; //when BPF ,0.0,0.0};
/*low*/float a[taps] = {1.0, -3.1836, 4.6222, -3.7795, 1.8136, -0.4800, 0.0544};
/*low*/float b[taps] = {0.0007, 0.0044, 0.0111, 0.0148, 0.0111, 0.0044, 0.0007 };
//band float a[taps]={1.0000,-2.1749,4.7356,-5.5330,6.1605,-4.2503,2.7958,-0.9807,0.3464};
//bandfloat b[taps]={0.0010,0.0000,-0.0041,0.0000,0.0061,0.0000,-0.0041,0.0000,0.0010};
//high float a[taps] = {1.0000,3.1836,4.6222,3.7795,1.8136,0.4800,0.0544};
//highfloat b[taps] = {0.0007,-0.0044,0.0111,-0.0148,0.0111,-0.0044,0.0007};
float y;
static int processing(float *input, float *output)
{
int k;
int i;
x_buff[0] = *input;
for (k = 0; k < taps; k++)
{
y += -a[k] * y_buff[k] + b[k] * x_buff[k];
}
y_buff[0] = y;
*output = y_buff[0];
for (i=1;i
{
x_buff[taps-i] = x_buff[taps-i-1];
y_buff[taps-i] = y_buff[taps-i-1];
}
x_buff[0]=0;
/* additional processing load */
load(processingLoad);
return(TRUE);
}
//
#include
#include "volume.h"
#define taps 25
/* Global declarations */
float inp_buffer[BUFSIZE]; /* processing data buffers */
float out_buffer[BUFSIZE];
//edited
float x_buff[taps]={0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0};
/*0.2 lowpass */
float h[taps] = {0.0255, 0.0172, -0.0000, -0.0210, -0.0382, -0.0437, -0.0315, 0.0000, 0.0472, 0.1019, 0.1528, 0.1889, 0.2019, 0.1889, 0.1528, 0.1019, 0.0472, 0.0000, -0.0315, -0.0437, -0.0382, -0.0210, -0.0000, 0.0172, 0.0255 };
/*0.3 lowpass
float h[taps]={-0.0262,-0.0243,0.0000,0.0297,0.0393,0.0146,-0.0324,-0.0661,-0.0485,0.0340,
0.1570,0.2672,0.3113,0.2672,0.1570,0.0340,-0.0485,-0.0661,-0.0324,0.0146,0.0393,0.0297,0.0000,
-0.0243,-0.0262}; */
/*0.3~0.5 bandpass
float h[taps] = {0.0224,-0.0049,0.0000,0.0060,-0.0336,-0.0528,0.0277,0.1129,0.0415,-0.1232
,-0.1342,0.0539,0.1774,0.0539,-0.1342,-0.1232,0.0415,0.1129,0.0277,-0.0528,-0.0336,0.0060,
0.0000,-0.0049,0.0224}; */
/*0.7 highpass
float h[taps] = {-0.0262,0.0243,-0.0000,-0.0297,0.0393,-0.0146,-0.0324,0.0661,-0.0485,
-0.0340,0.1570,-0.2672,0.3113,-0.2672,0.1570,-0.0340,-0.0485,0.0661,-0.0324,-0.0146,0.0393,
-0.0297,-0.0000,0.0243,-0.0262}; */
/*Fs=40kHz
float h[taps] = {-0.0160,0.0135,0.0327,0.0165,-0.0241,-0.0462,-0.0169,0.0463,0.0778,
0.0171,-0.1324,-0.2917,0.6686,-0.2917,-0.1324,0.0171,0.0778,0.0463,-0.0169,-0.0462,-0.0241,
0.0165,0.0327,0.0135,-0.0160}; */
float y;
static int processing(float *input, float *output)
{
int k;
int i;
y = 0;
x_buff[0] = *input;
for (k = 0; k < taps; k++)
{
y += h[k] * x_buff[k];
}
for (i=1;i
x_buff[taps-i] = x_buff[taps-i-1];
}
*output = y;
/* additional processing load */
load(processingLoad);
return(TRUE);
}
//
#include
#include "volume.h"
#define taps 7 //when BPF, 9
/* Global declarations */
float inp_buffer[BUFSIZE]; /* processing data buffers */
float out_buffer[BUFSIZE];
//edited
float x_buff[taps]={0.0,0.0,0.0,0.0,0.0,0.0,0.0}; //when BPF ,0.0,0.0};
float y_buff[taps]={0.0,0.0,0.0,0.0,0.0,0.0,0.0}; //when BPF ,0.0,0.0};
/*low*/float a[taps] = {1.0, -3.1836, 4.6222, -3.7795, 1.8136, -0.4800, 0.0544};
/*low*/float b[taps] = {0.0007, 0.0044, 0.0111, 0.0148, 0.0111, 0.0044, 0.0007 };
//band float a[taps]={1.0000,-2.1749,4.7356,-5.5330,6.1605,-4.2503,2.7958,-0.9807,0.3464};
//bandfloat b[taps]={0.0010,0.0000,-0.0041,0.0000,0.0061,0.0000,-0.0041,0.0000,0.0010};
//high float a[taps] = {1.0000,3.1836,4.6222,3.7795,1.8136,0.4800,0.0544};
//highfloat b[taps] = {0.0007,-0.0044,0.0111,-0.0148,0.0111,-0.0044,0.0007};
float y;
static int processing(float *input, float *output)
{
int k;
int i;
x_buff[0] = *input;
for (k = 0; k < taps; k++)
{
y += -a[k] * y_buff[k] + b[k] * x_buff[k];
}
y_buff[0] = y;
*output = y_buff[0];
for (i=1;i
x_buff[taps-i] = x_buff[taps-i-1];
y_buff[taps-i] = y_buff[taps-i-1];
}
x_buff[0]=0;
/* additional processing load */
load(processingLoad);
return(TRUE);
}
소개글