bpmdsp/filter_impulse_response.c

Go to the documentation of this file.
00001 
00005 #include "bpm/bpm_dsp.h"
00006 
00007 int filter_impulse_response( filter_t *f, double *wf, int itrig ) {
00008 
00014   int i = 0;
00015 
00016   if ( ! wf || ! f ) {
00017     bpm_error( "Invalid pointers in filter_impulse_reponse(...)", __FILE__, __LINE__ );
00018     return 1;
00019   } 
00020 
00021   // fill the step
00022   for ( i = 0; i < f->ns; i++ ) wf[i] = ( i == itrig ? 1. : 0. );
00023 
00024   // apply the filter to the step function
00025   if ( apply_filter( f, wf ) ) {
00026     bpm_error( "Unable to apply filter in filter_impulse_response(...)",
00027                __FILE__, __LINE__ );
00028     return 1;
00029   }
00030 
00031   return 0;
00032 }

Generated on Fri Nov 9 21:17:10 2007 for libbpm by  doxygen 1.5.1