Changeset 680:93d85ffac3e0 in roaraudio
- Timestamp:
- 08/27/08 15:38:16 (16 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libroardsp/filter_lowp.c
r673 r680 27 27 int roardsp_lowp_init (struct roardsp_filter * filter, struct roar_stream * stream, int id) { 28 28 struct roardsp_lowp * self = malloc(sizeof(struct roardsp_lowp)); 29 float freq = 25;29 float freq = filter->rate/2; 30 30 31 31 if ( self == NULL ) … … 59 59 samples /= channels; 60 60 61 ROAR_DBG("roardsp_lowp_calc16(*): filtering %i frames of %i channels...", samples, channels); 62 61 63 // * output[N] = input[N] * A + output[N-1] * B 62 64 … … 79 81 float lp; 80 82 float oldfreq; 83 float newfreq; 81 84 82 85 if ( cmd != ROARDSP_FCTL_FREQ ) 83 86 return -1; 84 87 85 lp = exp(-2 * M_PI * *(float*)data / filter->rate) * 65536; 88 newfreq = *(float*)data; 89 90 lp = exp(-2 * M_PI * newfreq / filter->rate) * 65536; 86 91 87 92 self->b = lp; … … 89 94 90 95 oldfreq = self->freq / 1000; 91 self->freq = *(float*)data* 1000;96 self->freq = newfreq * 1000; 92 97 93 98 *(float*)data = oldfreq; 99 100 ROAR_DBG("roardsp_lowp_ctl(); oldfreq=%f, newfreq=%f", oldfreq, newfreq); 94 101 95 102 return 0;
Note: See TracChangeset
for help on using the changeset viewer.