This set of routines contains the BPM digitised waveform processing routines to go from a sis digitised waveform to position and slope information.
int process_diode( doublewf_t *signal, bpmconf_t *conf, bpmproc_t *proc );
So the diode pulse has to be fitted into a doublewf_t along with a bpmconf_t structure conf. The routine first checks the flag bpmconf_t::cav_type for the cavity type. This should be of type diode for the routine to proceed. It then calls the fit_diodepulse routine onto the signal, which returns the fitted t0 into the bpmproc_t structure as proc->t0.
int process_monopole( doublewf_t *signal, bpmconf_t *bpm, bpmproc_t *proc, bpmproc_t *trig, unsigned int mode );
This routine basically is a wrapper around
int process_waveform( doublewf_t *signal, bpmconf_t *bpm, bpmproc_t *proc, bpmproc_t *trig, unsigned int mode );
and handles all the processing steps flagged by the mode bitword. Chronologically it executes the following steps :
proc->ddc_tSample = proc->t0 + bpm->ddc_tOffset;
int process_dipole( doublewf_t *signal, bpmconf_t *bpm, bpmcalib_t *cal, bpmproc_t *proc, bpmproc_t *trig, bpmproc_t *ampref, bpmproc_t *phaseref, unsigned int mode );
is therefore a wrapper around the following two core routines :
int process_waveform( signal, bpm, proc, trig, mode ); int postprocess_waveform( bpm, proc, cal, ampref, phaseref, mode );
Alternatively the user can first use the routine process_waveform on all of the waveforms ( together with processing the trigger information ). After this is done, the user can use the postprocess_waveform routine to perform the post-processing on the dipole waveforms.
proc->ddc_tSample = proc->t0 + bpm->ddc_tOffset;
int correct_gain( bpmproc_t *proc, bpmcalib_t *cal, unsigned int mode )
then corrects the phase and amplitude of the current pulse by scaling the amplitude with the ratio between the caltone amplitude at the time of calibration and the lastest one and shifting the phase by the phase difference between the phase of the calibration tone at the time of BPM calibration and the latest phase recorded in the bpmproc_t::ddc_ct_phase variable ( or bpmproc_t::fit_ct_phase ).
Files | |
file | bpm_process.h |
libbpm main processing routines | |
file | check_saturation.c |
file | correct_gain.c |
file | ddc_sample_waveform.c |
file | ddc_waveform.c |
file | downmix_waveform.c |
file | fft_waveform.c |
file | fit_diodepulse.c |
file | fit_fft.c |
file | fit_waveform.c |
file | get_IQ.c |
file | get_pedestal.c |
file | get_pos.c |
file | get_slope.c |
file | get_t0.c |
file | postprocess_waveform.c |
file | process_caltone.c |
file | process_diode.c |
file | process_dipole.c |
file | process_monopole.c |
file | process_waveform.c |
Defines | |
#define | PROC_DEFAULT |
#define | PROC_DO_FFT |
#define | PROC_DO_FIT |
#define | PROC_DO_DDC |
#define | PROC_DDC_CALIBFREQ |
#define | PROC_DDC_CALIBTDECAY |
#define | PROC_DDC_FITFREQ |
#define | PROC_DDC_FITTDECAY |
#define | PROC_DDC_FFTFREQ |
#define | PROC_DDC_FFTTDECAY |
#define | PROC_DDC_FULL |
#define | PROC_FIT_DDC |
#define | PROC_FIT_FFT |
#define | PROC_RAW_PHASE |
#define | PROC_CORR_AMP |
#define | PROC_CORR_PHASE |
#define | PROC_CORR_GAIN |
Functions | |
EXTERN int | process_diode (doublewf_t *signal, bpmconf_t *conf, bpmproc_t *proc) |
EXTERN int | process_monopole (doublewf_t *signal, bpmconf_t *bpm, bpmcalib_t *cal, bpmproc_t *proc, bpmproc_t *trig, unsigned int mode) |
EXTERN int | process_dipole (doublewf_t *signal, bpmconf_t *bpm, bpmcalib_t *cal, bpmproc_t *proc, bpmproc_t *trig, bpmproc_t *ampref, bpmproc_t *phaseref, unsigned int mode) |
EXTERN int | process_waveform (doublewf_t *signal, bpmconf_t *bpm, bpmproc_t *proc, bpmproc_t *trig, unsigned int mode) |
EXTERN int | postprocess_waveform (bpmconf_t *bpm, bpmproc_t *proc, bpmcalib_t *cal, bpmproc_t *ampref, bpmproc_t *phaseref, unsigned int mode) |
EXTERN int | process_caltone (doublewf_t *signal, bpmconf_t *bpm, bpmproc_t *proc, unsigned int mode) |
EXTERN int | correct_gain (bpmproc_t *proc, bpmcalib_t *cal, unsigned int mode) |
EXTERN int | fit_waveform (doublewf_t *w, double t0, double i_freq, double i_tdecay, double i_amp, double i_phase, double *freq, double *tdecay, double *amp, double *phase) |
EXTERN int | fit_diodepulse (doublewf_t *w, double *t0) |
EXTERN int | fft_waveform (doublewf_t *w, complexwf_t *ft) |
EXTERN int | fit_fft_prepare (complexwf_t *ft, int *n1, int *n2, double *amp, double *freq, double *fwhm) |
EXTERN int | fit_fft (complexwf_t *ft, double *freq, double *tdecay, double *A, double *C) |
EXTERN int | check_saturation (doublewf_t *w, int nbits, int *iunsat) |
EXTERN int | downmix_waveform (doublewf_t *w, double frequency, complexwf_t *out) |
EXTERN int | ddc_waveform (doublewf_t *w, double frequency, filter_t *filt, complexwf_t *dc, doublewf_t *buf_re, doublewf_t *buf_im) |
EXTERN int | ddc_sample_waveform (doublewf_t *w, double frequency, filter_t *filt, int iSample, double t0, double tdecay, double *amp, double *phase, doublewf_t *buf_re, doublewf_t *buf_im) |
EXTERN int | get_pedestal (doublewf_t *wf, int range, double *offset, double *rms) |
EXTERN int | get_t0 (doublewf_t *w, double *t0) |
EXTERN int | get_IQ (double amp, double phase, double refamp, double refphase, double *Q, double *I) |
EXTERN int | get_pos (double Q, double I, double IQphase, double posscale, double *pos) |
EXTERN int | get_slope (double Q, double I, double IQphase, double slopescale, double *slope) |
#define PROC_DEFAULT |
Definition at line 331 of file bpm_process.h.
EXTERN int process_diode | ( | doublewf_t * | signal, | |
bpmconf_t * | conf, | |||
bpmproc_t * | proc | |||
) |
This routine processes a diode pulse, which should be found in the signal structure. It fills the proc structure with the t0. The routine checks what the signal type (conf->cav_type) is and when it really is a diode pulse, it will fit the pulse and return t0, otherwise (when the signal is a monopole or dipole signal), it will determine the onset of the waveform by looking where the signal's absolute value exceeds 10 * the noise RMS at the beginning of the waveform.
signal | The bpm signal | |
conf | The bpm configuration structure | |
proc | The processed trigger structure (containing the t0) |
Definition at line 9 of file process_diode.c.
References bpm_error(), bpmconf::cav_type, diode, doublewf_basic_stats(), fit_diodepulse(), bpmconf::forced_trigger, doublewf_t::fs, wfstat_t::mean, bpmconf::name, doublewf_t::ns, wfstat_t::rms, bpmproc::t0, and doublewf_t::wf.
EXTERN int process_monopole | ( | doublewf_t * | signal, | |
bpmconf_t * | bpm, | |||
bpmcalib_t * | cal, | |||
bpmproc_t * | proc, | |||
bpmproc_t * | trig, | |||
unsigned int | mode | |||
) |
Top-level routine which is basically a wrapper around process_waveform and correct_gain to take into account the calibration tone data. See more in details documentation in those routines.
signal | The doublewf_t encoded BPM signal | |
bpm | The bpm configuration structure | |
cal | The bpm calibration structure, needed for the gain correction | |
proc | The processed data structure | |
trig | The structure with processed trigger info for that waveform | |
mode | A bitpattern encoding what exactly to process |
Definition at line 11 of file process_monopole.c.
References bpm_error(), correct_gain(), bpmconf::name, and process_waveform().
EXTERN int process_dipole | ( | doublewf_t * | signal, | |
bpmconf_t * | bpm, | |||
bpmcalib_t * | cal, | |||
bpmproc_t * | proc, | |||
bpmproc_t * | trig, | |||
bpmproc_t * | ampref, | |||
bpmproc_t * | phaseref, | |||
unsigned int | mode | |||
) |
Top-level routine which is a wrapper around process_waveform, correct_gain and postprocess_waveform. See more details in the documentation of those individual routines.
signal | The doublewf_t encoded BPM signal | |
bpm | The bpm configuration structure | |
cal | The bpm calibration structure, needed for the gain correction | |
proc | The processed data structure | |
trig | The structure with processed trigger info for that waveform | |
ampref | The already processed amplitude reference bpmproc_t structure | |
phaseref | The already processed phase reference bpmproc_t structure | |
mode | A bitpattern encoding what exactly to process |
Definition at line 10 of file process_dipole.c.
References bpm_error(), correct_gain(), bpmconf::name, postprocess_waveform(), and process_waveform().
EXTERN int process_waveform | ( | doublewf_t * | signal, | |
bpmconf_t * | bpm, | |||
bpmproc_t * | proc, | |||
bpmproc_t * | trig, | |||
unsigned int | mode | |||
) |
Top-level routine to processes a BPM beam pulse waveform (decaying "sin"-like wave) and derive amplitude and phase from the signal. The routine needs to be fed with a doublewf_t containing the digitized signal. The signal is checked for saturation, it's pedestal is determined and removed, the pulse starttime (t0) is set from the configuration or the trigger. Then, depending on the mode bitpattern, an FFT is performed, the waveform is fitted and a digital downconversion is done. The results (amplitude and phase) are stored in the bpmproc_t structure of the BPM.
Relevant mode bit patterns for this routine are :
signal | The digitized signal converted into a doublewf_t | |
bpm | A pointer to the bpmconf_t structure for the BPM channel | |
proc | A pointer to the bpmproc_t structure for the BPM channel | |
trig | A pointer to the bpmproc_t structure of the trigger for this BPM channel, if this parameter is NULL, externall clocking will be assumed and the t0 from the bpmconf_t structure will be used in the processing. | |
mode | The processing mode bitword |
Definition at line 12 of file process_waveform.c.
References bpmproc::ampnoise, bpm_error(), bpm_warning(), bpmconf::cav_decaytime, check_saturation(), bpmproc::dc, bpmproc::ddc_amp, bpmconf::ddc_buffer_im, bpmconf::ddc_buffer_re, bpmconf::ddc_filter, bpmconf::ddc_freq, bpmproc::ddc_iSample, bpmproc::ddc_phase, ddc_sample_waveform(), bpmproc::ddc_success, bpmconf::ddc_tdecay, bpmconf::ddc_tOffset, bpmproc::ddc_tSample, ddc_waveform(), bpmconf::digi_freq, bpmconf::digi_nbits, bpmconf::digi_nsamples, doublewf_bias(), bpmproc::fft_freq, bpmproc::fft_success, bpmproc::fft_tdecay, fft_waveform(), bpmproc::fit_amp, fit_fft(), bpmproc::fit_freq, bpmproc::fit_phase, bpmproc::fit_success, bpmproc::fit_tdecay, bpmconf::fit_tOffset, fit_waveform(), bpmproc::ft, get_pedestal(), bpmproc::iunsat, bpmconf::name, norm_phase(), bpmproc::saturated, bpmconf::t0, bpmproc::t0, bpmproc::voltageoffset, and complexwf_t::wf.
Referenced by process_dipole(), and process_monopole().
EXTERN int postprocess_waveform | ( | bpmconf_t * | bpm, | |
bpmproc_t * | proc, | |||
bpmcalib_t * | cal, | |||
bpmproc_t * | ampref, | |||
bpmproc_t * | phaseref, | |||
unsigned int | mode | |||
) |
Top-level routine to Post-process a waveform for whith the amplitude and the phase have already been defined using process_waveform. This routine goes on to calculate I and Q from the phase and amplitudes as well as the postion and slope using the calibration information.
Relevant mode bit patterns for this routine are :
signal | The digitized signal converted into a doublewf_t | |
bpm | A pointer to the bpmconf_t structure for the BPM channel | |
proc | A pointer to the bpmproc_t structure for the BPM channel | |
cal | A pointer to the bpmcalib_t structure for the BPM channel | |
ampref | A pointer to the bpmproc_t structure of the amplitude reference channel for this BPM. | |
phaseref | A pointer to the bpmproc_t structure of the phase reference channel for this BPM. | |
mode | The processing mode bitword |
Definition at line 10 of file postprocess_waveform.c.
References bpm_error(), bpmproc::ddc_amp, bpmproc::ddc_I, bpmcalib::ddc_IQphase, bpmproc::ddc_phase, bpmproc::ddc_pos, bpmcalib::ddc_posscale, bpmproc::ddc_Q, bpmproc::ddc_slope, bpmcalib::ddc_slopescale, bpmproc::ddc_success, bpmproc::fit_amp, bpmproc::fit_I, bpmcalib::fit_IQphase, bpmproc::fit_phase, bpmproc::fit_pos, bpmcalib::fit_posscale, bpmproc::fit_Q, bpmproc::fit_slope, bpmcalib::fit_slopescale, bpmproc::fit_success, get_IQ(), get_pos(), get_slope(), bpmconf::name, and norm_phase().
Referenced by process_dipole().
EXTERN int process_caltone | ( | doublewf_t * | signal, | |
bpmconf_t * | bpm, | |||
bpmproc_t * | proc, | |||
unsigned int | mode | |||
) |
Top level routine to process the calibration tone via DDC, similar to process_waveform but it also updates the ddc_ct_amp and ddc_ct_phase variables in the bpmproc_t structure. No fitting is implemented in this routine.
Relevant mode bit patterns for this routine are analogous as in process_waveform
signal | The digitized signal converted into a doublewf_t | |
bpm | A pointer to the bpmconf_t structure for the BPM channel | |
proc | A pointer to the bpmproc_t structure for the BPM channel | |
mode | The processing mode bitword |
Definition at line 11 of file process_caltone.c.
References bpmproc::ampnoise, bpm_error(), bpm_warning(), check_saturation(), bpmproc::dc, bpmproc::ddc_amp, bpmconf::ddc_buffer_im, bpmconf::ddc_buffer_re, bpmproc::ddc_ct_amp, bpmconf::ddc_ct_filter, bpmconf::ddc_ct_freq, bpmconf::ddc_ct_iSample, bpmproc::ddc_ct_phase, bpmproc::ddc_phase, bpmproc::ddc_success, ddc_waveform(), bpmconf::digi_nbits, doublewf_bias(), bpmproc::fft_freq, bpmproc::fft_success, bpmproc::fft_tdecay, fft_waveform(), fit_fft(), bpmproc::ft, get_pedestal(), bpmproc::iunsat, bpmconf::name, norm_phase(), bpmproc::saturated, bpmproc::voltageoffset, and complexwf_t::wf.
EXTERN int correct_gain | ( | bpmproc_t * | proc, | |
bpmcalib_t * | cal, | |||
unsigned int | mode | |||
) |
Correct the processed amplitude and phase by using calibration tone information if the ddc and or fits were successfull. Since e.g. for internal clock it is not really sure the phase information can be used if there is no proper trigger, some mode bits can be flagged to only correct the amplitude.
Relevant mode bit patterns for this routine are :
proc | The bpmproc_t structure of the bpm | |
cal | The bpmcalib_t structure of the bpm | |
mode | Mode of correction |
Definition at line 10 of file correct_gain.c.
References bpm_error(), bpmproc::ddc_amp, bpmcalib::ddc_ct_amp, bpmproc::ddc_ct_amp, bpmcalib::ddc_ct_phase, bpmproc::ddc_ct_phase, bpmproc::ddc_phase, bpmproc::ddc_success, bpmproc::fit_amp, bpmcalib::fit_ct_amp, bpmproc::fit_ct_amp, bpmcalib::fit_ct_phase, bpmproc::fit_ct_phase, bpmproc::fit_phase, and bpmproc::fit_success.
Referenced by process_dipole(), and process_monopole().
EXTERN int fit_waveform | ( | doublewf_t * | w, | |
double | t0, | |||
double | i_freq, | |||
double | i_tdecay, | |||
double | i_amp, | |||
double | i_phase, | |||
double * | freq, | |||
double * | tdecay, | |||
double * | amp, | |||
double * | phase | |||
) |
Fits the waveform with a decaying sin wave using the lmder/lmdif routines from nr_levmar.c !
*w | The waveform encoded as a doublewf_t | |
t0 | t0 for the waveform | |
i_freq | Initial frequency for the fit | |
i_tdecay | Initial decay time for the fit | |
i_amp | Initial amplitude for the fit | |
i_phase | Initial phase for the fit | |
freq | Fitted frequency | |
tdecay | Fitted decay time | |
amp | Fitted amplitude | |
phase | Fitted phase |
Definition at line 80 of file fit_waveform.c.
References bpm_error(), doublewf(), doublewf_delete(), doublewf_t::fs, doublewf_t::ns, and doublewf_t::wf.
Referenced by process_waveform().
EXTERN int fit_diodepulse | ( | doublewf_t * | w, | |
double * | t0 | |||
) |
Fits the diode pulse, basically a wrapper for get_t0, to conserve names and consistency in the library... is nothing more than a wrapper around get_t0, so see there...
Definition at line 10 of file fit_diodepulse.c.
References get_t0().
Referenced by process_diode().
EXTERN int fft_waveform | ( | doublewf_t * | w, | |
complexwf_t * | ft | |||
) |
Performs a fast fourier transform of the waveform, after subtracting the pedestal, basically just a wrapper around the forward realfft routine from the DSP module. Please see it's documentation for more details...
*w | the waveform | |
fft | the complex returned fft spectrum |
Definition at line 12 of file fft_waveform.c.
References bpm_error(), FFT_FORWARD, and realfft().
Referenced by process_caltone(), and process_waveform().
EXTERN int fit_fft_prepare | ( | complexwf_t * | ft, | |
int * | n1, | |||
int * | n2, | |||
double * | amp, | |||
double * | freq, | |||
double * | fwhm | |||
) |
This routine prepares the fft fit of the waveform. It starts by getting the position of the maximum in the spectrum (first nyquist band only). Then from this position runs left and right to determine where the amplitude drops to half of the peak amplitude and have an initial estimation of the FWHM. It will then set twice the FWHM width as the fit range in which to perform the fit, this is than returned by the samplnumbers n1 and n2.
ft | The complexwf_t fourier transform | |
n1 | The first sample to start the fit from | |
n2 | The last sample to take into account in the following fit | |
amp | Initial estimation of the amplitude for the fit | |
freq | Initial estimation of the frequency for the fit | |
fwhm | Initial estimation of the FWHM for the fit. |
Definition at line 72 of file fit_fft.c.
References bpm_error(), complexwf_t::fs, complexwf_t::ns, and complexwf_t::wf.
Referenced by fit_fft().
EXTERN int fit_fft | ( | complexwf_t * | ft, | |
double * | freq, | |||
double * | tdecay, | |||
double * | A, | |||
double * | C | |||
) |
Fits the power spectrum of the FT of a waveform frequency and decay time. Internally it makes a call to fit_fft_prepare to get an initial estimation of the parameters and goes on by applying the nr_lmder routine to minimise the fourier transform power spectrum agains a lorentzian lineshape defined by
Where
ft | The complexwf_t encoded fourier transform | |
freq | The returned frequency (p1) | |
tdecay | The returned tdecay (p2) | |
a | p0 (amplitude of powerspectrum ) of the fit ( can be NULL if not interested ) | |
c | p3 (offset) of the fit ( can be NULL if not interested ) |
Definition at line 148 of file fit_fft.c.
References bpm_error(), fit_fft_prepare(), complexwf_t::fs, complexwf_t::ns, and complexwf_t::wf.
Referenced by process_caltone(), and process_waveform().
EXTERN int check_saturation | ( | doublewf_t * | w, | |
int | nbits, | |||
int * | iunsat | |||
) |
Checks the saturation, so computes the first sample where no saturation occurs. If no saturation occurred in the waveform, this sample - stored in iunsat - will be set to 0. A saturated sample is found when it's ADC value is more (resp. less) than then maximum allowed ADC value ( 2^nbits ) minus a threshold set to 15. ( resp. the minium allowed ADC value, being 0 ) plus a threshold set to 15.
w | The waveform to check, encoded as a doublewf_t | |
nbits | The number of digitiser bits (e.g. 12 or 14 ) | |
iunsat | The returned last unsaturated sample |
Definition at line 11 of file check_saturation.c.
References bpm_error(), doublewf_t::ns, and doublewf_t::wf.
Referenced by process_caltone(), and process_waveform().
EXTERN int downmix_waveform | ( | doublewf_t * | w, | |
double | frequency, | |||
complexwf_t * | out | |||
) |
Downmixes the input waveform agains a complex LO using a frequency f and phase 0, the real part of the resulting complex waveform was mixed against a cosine-like wave, the imaginary part against a sinus-like. Note that this is just the downmixing itself, no filtering whatsoever is applied here.
w | The input waveform, encoded as a doublewf_t | |
freq | The frequency of the digital LO | |
out | The complex output downmixed waveform |
Definition at line 10 of file downmix_waveform.c.
References bpm_error(), doublewf_t::fs, complex_t::im, doublewf_t::ns, complex_t::re, doublewf_t::wf, and complexwf_t::wf.
EXTERN int ddc_waveform | ( | doublewf_t * | w, | |
double | frequency, | |||
filter_t * | filt, | |||
complexwf_t * | dc, | |||
doublewf_t * | buf_re, | |||
doublewf_t * | buf_im | |||
) |
As this is a pure wrapper around the ddc routine out of the dsp packate, please see the documentation there.
Definition at line 12 of file ddc_waveform.c.
References bpm_error(), and ddc().
Referenced by process_caltone(), and process_waveform().
EXTERN int ddc_sample_waveform | ( | doublewf_t * | w, | |
double | frequency, | |||
filter_t * | filt, | |||
int | iSample, | |||
double | t0, | |||
double | tdecay, | |||
double * | amp, | |||
double * | phase, | |||
doublewf_t * | buf_re, | |||
doublewf_t * | buf_im | |||
) |
TO BE IMPLEMENTED !!!
This routine will contain a quicker version of the ddc algorithm that doesn't filter the entire waveform and only applies the filter at the sampling point. However, I need to make custom a apply_filter routine which is universally valid for all types of filters (IIR as well).
Definition at line 19 of file ddc_sample_waveform.c.
References bpm_error().
Referenced by process_waveform().
EXTERN int get_pedestal | ( | doublewf_t * | wf, | |
int | range, | |||
double * | offset, | |||
double * | rms | |||
) |
Find the mean pedestal using the first 20 (or how ever many are required) sample values, store the results in the offset and rms. This routine in fact just calls the doublewf_basic_stats routine and gets the appropriate values from the wfstat_t structure.
wf | The signal encoded as a doublewf_t | |
range | The maximum sample to go to average over. The pedestal gets determined from the first "range" samples of the waveform | |
*offset | Returns the mean value of the samples, so voltage offset (pedestal value) | |
*rms | Returns the RMS on that |
Definition at line 10 of file get_pedestal.c.
References bpm_error(), doublewf_basic_stats(), wfstat_t::mean, and wfstat_t::rms.
Referenced by get_t0(), process_caltone(), and process_waveform().
EXTERN int get_t0 | ( | doublewf_t * | w, | |
double * | t0 | |||
) |
Finds the t0 value from a diode peak, used in the case of internall triggering when a trigger pulse needs to be specified to calculate beam arrival
w | A pointer to the doublewf_t signal | |
t0 | returns t0 |
Definition at line 46 of file get_t0.c.
References bpm_error(), bpm_verbose, bpm_warning(), doublewf_t::fs, get_pedestal(), nr_fit(), doublewf_t::ns, and doublewf_t::wf.
Referenced by fit_diodepulse().
EXTERN int get_IQ | ( | double | amp, | |
double | phase, | |||
double | refamp, | |||
double | refphase, | |||
double * | Q, | |||
double * | I | |||
) |
Gets the I and Q from the amplitude and phase of the waveform and it's respective references. The I and Q are calculated respectively as :
and
amp | The amplitude of the considered waveform | |
phase | The phase of the considered waveform | |
refamp | The amplitude of the reference cavity | |
refphase | The phase of the reference cavity | |
Q | The returned Q value | |
I | The returned I value |
Definition at line 8 of file get_IQ.c.
References bpm_error(), and bpm_warning().
Referenced by postprocess_waveform().
EXTERN int get_pos | ( | double | Q, | |
double | I, | |||
double | IQphase, | |||
double | posscale, | |||
double * | pos | |||
) |
Returns the beam given I and Q values, IQphase and scale, it is calcualted as
Where c is the positionscale and x the position.
Q | The Q value (obtained from get_IQ) | |
I | The I value (obtained from get_IQ) | |
IQphase | The IQ phase rotation | |
posscale | The position scale | |
pos | The returned position |
Definition at line 8 of file get_pos.c.
References bpm_error().
Referenced by postprocess_waveform().
EXTERN int get_slope | ( | double | Q, | |
double | I, | |||
double | IQphase, | |||
double | slopescale, | |||
double * | slope | |||
) |
Returns the beam slope given I and Q values, IQphase and scale, it is calcualted as
Where c is the positionscale and x the position.
Q | The Q value (obtained from get_IQ) | |
I | The I value (obtained from get_IQ) | |
IQphase | The IQ phase rotation | |
slopescale | The slope scale | |
slope | The returned slope |
Definition at line 8 of file get_slope.c.
References bpm_error().
Referenced by postprocess_waveform().