bpmprocess/get_slope.c

Go to the documentation of this file.
00001 
00005 #include <bpm/bpm_messages.h>
00006 #include <bpm/bpm_process.h>
00007 
00008 /*
00009   Returns the slope given I,Q, IQphase and scale
00010   
00011   @return BPM_SUCCESS upon success, BPM_FAILURE upon failure
00012 */
00013 int get_slope( double Q, double I, double IQphase, double slopescale,
00014                double *slope ) {
00015 
00016   *slope = -DBL_MAX;
00017   if ( !slope ) {
00018     bpm_error( "Invalid pointer argument in get_slope(...)",
00019                __FILE__, __LINE__ );
00020     return BPM_FAILURE;
00021   }
00022 
00023   *slope = slopescale * ( -I*sin(IQphase) + Q*cos(IQphase) );
00024 
00025   return BPM_SUCCESS;
00026 }

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