Changeset 680:93d85ffac3e0 in roaraudio


Ignore:
Timestamp:
08/27/08 15:38:16 (16 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

added some debuging code, changed default freq to rate/2

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libroardsp/filter_lowp.c

    r673 r680  
    2727int roardsp_lowp_init  (struct roardsp_filter * filter, struct roar_stream * stream, int id) { 
    2828 struct roardsp_lowp * self = malloc(sizeof(struct roardsp_lowp)); 
    29  float freq = 25; 
     29 float freq = filter->rate/2; 
    3030 
    3131 if ( self == NULL ) 
     
    5959 samples /= channels; 
    6060 
     61 ROAR_DBG("roardsp_lowp_calc16(*): filtering %i frames of %i channels...", samples, channels); 
     62 
    6163//  *      output[N] = input[N] * A + output[N-1] * B 
    6264 
     
    7981 float lp; 
    8082 float oldfreq; 
     83 float newfreq; 
    8184 
    8285 if ( cmd != ROARDSP_FCTL_FREQ ) 
    8386  return -1; 
    8487 
    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; 
    8691 
    8792 self->b = lp; 
     
    8994 
    9095 oldfreq = self->freq / 1000; 
    91  self->freq = *(float*)data * 1000; 
     96 self->freq = newfreq * 1000; 
    9297 
    9398 *(float*)data = oldfreq; 
     99 
     100 ROAR_DBG("roardsp_lowp_ctl(); oldfreq=%f, newfreq=%f", oldfreq, newfreq); 
    94101 
    95102 return 0; 
Note: See TracChangeset for help on using the changeset viewer.