bpmsimulation/add_excitation.c

Go to the documentation of this file.
00001 
00006 #include <bpm/bpm_messages.h>
00007 #include <bpm/bpm_simulation.h>
00008 #include <bpm/bpm_rf.h>
00009 #include <bpm/bpm_wf.h>
00010 #include <math.h>
00011 
00018 int add_excitation( double ttrig, doublewf_t *RF ) {
00019 
00020   double curr_time = 0;
00021   int i = 0;
00022 
00023   if ( ! RF ) {
00024     bpm_error( "Invalid pointer argument in add_wave(...)",
00025                __FILE__, __LINE__ );
00026     return BPM_FAILURE;
00027   }
00028 
00029   while (curr_time < ttrig && i < RF->ns) {
00030    
00031     i++;
00032     curr_time = (double) i / RF->fs;
00033 
00034   }
00035 
00036   RF->wf[i] += 1.;
00037 
00038   return BPM_SUCCESS;
00039 }
00040 
00041 // end of file
00042 

Generated on Thu Jan 10 10:18:04 2008 for libbpm by  doxygen 1.5.1