next up previous contents
Next: Example: print_ssF program Up: GRASP Routines: Reading/using FRAME Previous: Swept-sine calibration information   Contents

Function: GRcalibrate()

0 void GRcalibrate(float *fri,int frinum,int num,float *complex,float srate,int method,int order)
This is a intermediate-level routine which takes as input a pointer to an array containing the swept sine data, and outputs an array of interpolated points suitable for calibration of FFT's of the interferometer output.

The arguments are:

fri: Input. Pointer to an array containing swept sine data. The format of this data is fri[0]=$f_0$, fri[1]=$r_0$, fri[2]=$i_0$, fri[3]=$f_1$, fri[4]=$r_1$, fri[5]=$i_1$,... and the total length of the array is fri[0..frinum-1].
frinum: Input. The number of entries in the array fri[0..frinum-1]. If this number is not divisible by three, something is wrong!
num: Input. The number of points $N$ in the FFT that we will be calibrating. This is typically $N=2^k$ where $k$ is an integer. In this case, the number of distinct frequency values at which a calibration is needed is $2^{k-1}+1 = N/2+1$, corresponding to the number of distinct frequency values from $0$ (DC) to the Nyquist frequency $f_{\rm Nyquist}$. See for example equation (12.1.5) of reference [1]. The frequencies are $f_i = {i \over N}
F_{\rm sample}$ for $i=0,\cdots,N/2$.
srate: Input. The sample rate $F_{\rm sample}$ (in Hz) of the data that we are going to be calibrating.
complex: Input. Pointer to an array complex[0..s] where $s=2^k+1$. The routine calibrate() fills in this array with interpolated values of the swept sine calibration data, described in the previous section. The real part of the DC response is in complex[0], and the imaginary part is in complex[1]. The real/imaginary parts of the response at frequency $f_1$ are in complex[2] and complex[3] and so on. The last two elements of complex[ ] contain the real/imaginary parts of the response at the Nyquist frequency $F_{\rm sample}/2$.
method: Input. This integer sets the type of interpolation used to determine the real and imaginary part of the response, at frequencies that lie in between those given in the swept sine calibration files. Rational function interpolation is used if method=0. Polynomial interpolation is used if method=1. Spline interpolation with natural boundary conditions (vanishing second derivatives at DC and the Nyquist frequency) is used if method=2.
order: Input. Ignored if spline interpolation is used. If polynomial interpolation is used, then order is the order of the interpolating polynomial. If rational function interpolation is used, then the numerator and denominator are both polynomials of order order/2 if order is even; otherwise the degree of the denominator is (order+1)/2 and that of the numerator is (order-1)/2.

The basic problem solved by this routine is that the swept sine calibration data in a frame typically contain data at a few hundred distinct frequency values. However to properly calibrate the IFO output, one usually needs this calibration information at a large number of frequencies corresponding to the distinct frequencies associated with the FFT of a data set. This routine allows you to choose different possible interpolation methods. If in doubt, we recommend spline interpolation as the first choice. The interpolation methods are described in detail in Chapter 3 of reference [1].

Author: Bruce Allen,
Comments: It might be better to interpolate values of $f^2$ times the swept-sine response function, as this is the quantity needed to compute the IFO response function.

next up previous contents
Next: Example: print_ssF program Up: GRASP Routines: Reading/using FRAME Previous: Swept-sine calibration information   Contents
Bruce Allen 2000-11-19