bpmrf/rf_addLO.c

Go to the documentation of this file.
00001 
00005 #include <bpm/bpm_interface.h>
00006 #include <bpm/bpm_rf.h>
00007 #include <bpm/bpm_nr.h>
00008 #include <math.h>
00009 #include <bpm/bpm_wf.h>
00010 
00021 int rf_addLO( double amp, double lofreq, enum bpmphase_t type,
00022               double phase, double phasenoise, doublewf_t *LO ) {
00023 
00024   if ( ! LO ) {
00025     bpm_error( "Invalid LO pointer in rf_addLO(...)",
00026                __FILE__, __LINE__ );
00027     return BPM_FAILURE;
00028   }
00029 
00030   // Generate the LO upon the phase type
00031   
00032   if ( type == locked ) {
00033 
00034     doublewf_add_cwtone( LO, amp, phase, lofreq, phasenoise);
00035 
00036   } else {
00037 
00038     doublewf_add_cwtone( LO, amp, nr_ranuniform( 0., 2*PI ), lofreq, phasenoise);
00039 
00040   }
00041 
00042   return BPM_SUCCESS;
00043 }
00044 // end of file

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