next up previous contents
Next: Example: print_ss program Up: GRASP Routines: Reading/using Caltech Previous: Function: read_sweptsine()   Contents

Function: calibrate()

0 void calibrate(FILE *fpss,int num,float *complex,float srate,int method,int order)
This is a intermediate-level routine which reads in a 3-column ASCII file of swept sine calibration data used to calibrate the IFO, and outputs an array of interpolated points suitable for calibration of FFT's of the interferometer output.

The arguments are:

fpss: Input. Pointer to the file in which the swept sine data can be found. The format of this data is described below.
srate: Input. The sample rate $F_{\rm sample}$ (in Hz) of the data that we are going to be calibrating.
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$.
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 files 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, ballen@dirac.phys.uwm.edu
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_ss program Up: GRASP Routines: Reading/using Caltech Previous: Function: read_sweptsine()   Contents
Bruce Allen 2000-11-19