%\magnification=\magstephalf
\hsize= 95 truemm \tolerance=3000
\vsize= 240 truemm
\hoffset = 25 truemm
\supereject
\parskip 0pc
\parindent 2pc
\baselineskip=12pt
\font\nbf=cmbx10 scaled \magstep2
\font\nrm=cmr10 scaled \magstep2
\pageno=0
\def\boxit#1{\vbox{\hrule\hbox{\vrule\kern3pt
\vbox{\kern3pt#1\kern3pt}\kern3pt\vrule}\hrule}}
\rm
\ \
\vskip 75 truemm
\centerline {\nrm Number 1.}
\vskip 1.0 pc
\centerline{\nbf THE PROGRAM PACKAGE}
\vskip 0.5 pc
\centerline{\nbf MUFRAN}
\vskip 1.0 pc
\centerline {\rm Zolt\'an Koll\'ath}
%\vskip .5 pc
\centerline {\rm Konkoly Observatory - Budapest}
\vskip 1.0 pc
\centerline {20.12.1990}
\eject
\hsize= 140 truemm \tolerance=3000
\hoffset = 15 truemm
\centerline{\nbf THE PROGRAM PACKAGE MUFRAN}
\vskip 1 pc
\centerline {Zolt\'an Koll\'ath}
\centerline {Konkoly Observatory - Budapest}
\vskip 2pc
{\bf INTRODUCTION}
\vskip 2pc
The MUFRAN (MUlti FRequency ANalysis) is a collection of methods
for period determination, sine fitting for observational data and
graphic routines for the visualization of the results. The programme
was written in Fortran language and it works on IBM XT/AT/386 compatible
computers equipped with graphics card (CGA,HGC,EGA,MCGA,VGA),
and math coprocessor.
The commands of MUFRAN can be chosen from the following menu, typing the
letter in the right side of the columns:
\tt
\leftskip 2pc
\parindent 0pc
LOAD LIGHT CURVE-------------L\ \ \ \ \ \ \ DFT--------------------------D
\baselineskip=12pt
SAVE LIGHT CURVE-------------K\ \ \ \ \ \ \ ZOOM-FFT---------------------F
REFRESH THE DATA-------------R\ \ \ \ \ \ \ -----------------------------G
LOAD SPECTRUM----------------T\ \ \ \ \ \ \ LS CALCULATION---------------E
SAVE SPECTRUM----------------O\ \ \ \ \ \ \ SEARCH (LINEAR)--------------H
SHOW THE LIGHT CURVE---------P\ \ \ \ \ \ \ SEARCH (GRADIENT)------------A
SHOW THE FIT-----------------Y\ \ \ \ \ \ \ WHITENING--------------------W
SHOW THE SPECTRUM------------S\ \ \ \ \ \ \ MAKE SYNTHETIC DATA----------B
COMPARE THE SPECTRA----------C\ \ \ \ \ \ \ TEST AMPLITUDES--------------Z
MOVE THE SPECTRUM -----------M\ \ \ \ \ \ \ SYSTEM VARIABLES-------------I
LOAD LS COEFFICIENTS---------J\ \ \ \ \ \ \ DOS COMMAND------------------X
SAVE LS COEFFICIENTS---------N\ \ \ \ \ \ \ QUIT-------------------------Q
\baselineskip=12pt
\parindent 2pc
\leftskip 0pc
\rm
The options of the left columns are connected with file operations
(writing and reading data) and graphics. One can save
or load the light curve, the calculated spectra and the parameters
of the sine fitting. The right column represents the calculations
of spectra and LS fits.
The command SEE THE LIGHT CURVE displays the analysed time series. The
upper panel shows the total data sequence, while the bottom panel shows
each data track independently. Pressing any key moves the next track to
the screen. All graphic modes can be exited by pressing {\it q} or {\it Q}.
\vskip 2pc
{\bf DATA TRANSFERS}
\vskip 2pc
The file structure of the light-curve (analyzed time series) must be one
of the following two formats:
\vskip 10pt
\baselineskip=12pt
\parindent 0pc
\halign{#&\hfil#\hfil&\quad\hfil#\hfil&\quad\hfil#\hfil\cr
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ & $jjj_1$& $ttt_1$ & $xxx_1$\cr
& $jjj_2$& $ttt_2$ & $xxx_2$\cr
& .\cr
& .\cr
& .\cr
& $jjj_n$& $ttt_n$ & $xxx_n$\cr}
\baselineskip=12pt
where $jjj_k$s and $ttt_k$s are the integer and fractional parts of
the time sequence and $xxx_k$s are the magnitude values, or
\vskip 10pt
\baselineskip=12pt
\halign{#&\hfil#\hfil&\quad\hfil#\hfil\cr
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ &$ttt_1$ & $xxx_1$\cr
&$ttt_2$ & $xxx_2$\cr
& .\cr
& .\cr
& .\cr
&$ttt_n$ & $xxx_n$\cr}
\baselineskip=12pt
where $ttt_k$s mean the time values.
The command LOAD LIGHT CURVE sorts the not ordered
time series.
After some operations on the data, which change
the light curve, the option REFRESH THE DATA returnes the light curve
as it was loaded.
The maximum number of the data in the light curve is 4000.
\parindent 2pc
In addition to the work registers of the DFT and ZOOM-FFT
there are four registers for spectra, each has a capacity for 4095
points. These spectra can be loaded to a register from another one by
the command MOVE THE SPECTRUM. The four registers are labelled by
A, B, C and D. If these registers already contain some data an
asterisk behind the label letter indicates this. One can update the registers
by moving a new spectrum.
The last calculated or loaded spectrum is in
the register 0. In the DFT and ZOOM-FFT, if the minimum frequency of the calculation
is zero, the spectral window is commonly calculated and the result
is loaded to register 1. The programme saves the spectra in the following format:
\vskip 10pt
\baselineskip=12pt
\parindent 0pc
\halign{#&\hfil#\hfil&\quad\hfil#\hfil&\quad\hfil#\hfil\cr
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ & $n$& $f_{min}$ & $f_{max}$\cr
& $a_1$\cr
& $a_2$\cr
& .\cr
& .\cr
& .\cr
& $a_n$&,\cr}
\baselineskip=12pt
where n is the number of spectral points, $f_{min}$ and $f_{max}$ are the
minimum and maximum frequency and $a_k$ is the amplitude at frequency
$f_{min}+(k-1)(f_{max}-f_{min})/(n-1)$.
\parindent 2pc
\vskip 2pc
{\bf THE DATA TRACKS}
\vskip 2pc
There is no need to bother about the sampling of the analysed data, the
MUFRAN deals with unequally spaced, gapped data. The programme
cuts the data set into tracks for the graphic display of the data and
for some kinds of calculations. The data can be cut automatically or
manually. In the automatic mode the data set is cut so that the length
of the maximum gap between two successive data elements in any track is
less than a critical value (maximum length of gaps) and the length of
any track is not greater than another crucial value (maximum length of tracks).
These values can be changed in the SYSTEM VARIABLES menu. In this
menu one can cut the data manually (manual cutting) by typing the
time for the last points of the tracks. The programme shows the total
number of tracks and lists the serial number of active tracks.
The LS calculation and the Fourier transformation use only the data
of the active tracks. One can change the status of the tracks
(active - inactive) in the SYSTEM VARIABLES menu and by
SEE THE LIGHT CURVE. In the display of the light curve a number
in the upper right corner of the bottom panel shows the track number.
If there is an asterisk before this number, the track is active, else
it is inactive. This status can be changed by pushing
the 's' key too. For more information about the data tracks see
the ZOOM FFT.
\vskip 2pc
{\bf FOURIER TRANSFORMATION}
\vskip 2pc
The MUFRAN has two methods for Fourier-transformation. The first is a
Discrete Fourier Transformation (DFT). It works like which was
described by Deeming (Deeming 1975). The user must type the
minimum and maximum frequency of calculations, and the number of
spectral points (number of steps). The program gives a recommended
value of the number of steps. If the minimum frequency is zero, the code
calculates the spectral window simultaneusly and assigns it to
register 1.
The DFT needs a long time for the calculations. The ZOOM FFT is a
faster method but it requires much attention because of some
interpolation during the calculations. It is recommended to check the
results around some peaks by DFT.
The programme calculates the FFT of each track using equidistant spacing
by 'extirpolation' (see Press and Rybicki 1989).
A simple FFT is calculated for each data track, and the spectra are
collected by a zoom FFT method to produce the final spectrum:
$$F(\omega)=\sum_{k=1}^{n_{\rm tracks}} F_k(\omega)*\exp\left(-i\omega (t_k-t_0)\right),$$
where $F_k(\omega)$ and $t_k$ are the FFT of the $k$th track interpolated
to $\omega$ and the epoch of the $k$th track.
The spectral window is calculated as by the DFT. According to the
even sampling in the FFT, a fundamental maximum frequency is given.
Its value depends on the length of the tracks - so one can change
the maximum frequency in the SYSTEM VARIABLES menu.
\vskip 2pc
{\bf GRAPHIC ROUTINES}
\vskip 2pc
The calculated or loaded spectrum can be seen by
the SEE THE SPECTRUM command.
The routine shows the spectrum for the whole calculated
frequency range. Pressing {\it H} or {\it h} a help screen is shown:
\parindent 0pc
\leftskip 7pc
\tt
Home --------------- 1 step left
\baselineskip=12pt
Pg Up ------------- 1 step right
$\gets$ ---------------- 20 step left
$\to$ --------------- 20 step right
End -------------- 500 step left
Pg Dn ----------- 500 step right
Ins ---------- set the left side
Del --------- set the right side
Esc ----------- make new picture
$\uparrow$ or $\downarrow$ + Esc ------- print peaks
$\uparrow$ or $\downarrow$ + Esc + P ---- type peaks
Prt Sc --- print cursor position
q or Q -------------------- quit
\baselineskip=12pt
\parindent 2pc
\leftskip 0pc
\rm
The first six options are connected with the horizontal cursor movements.
The displayed frequency range can be changed by setting new borders by
the {\it Ins} and {\it Del} keys. The new picture appears after having pressed
the {\it Esc} key.
The frequencies of the peaks which have higher amplitudes than the vertical
cursor can be typed to the screen. The vertical cursors work if the $\uparrow$
or $\downarrow$ key is pressed. If the vertical cursors are in the display,
pressing the {\it Esc} key displays the peak frequencies. Use the {\it p}
or {\it P} keys to clear the display and type the frequencies and amplitudes
in text mode. The frequencies can be saved to file.
The option COMPARE SPECTRA works like the previous command, but it displays
two spectra and the peak frequencies cannot be printed in this mode. The spectra
can be displayed with common scale, but they may be normalised independently.
If the second spectrum is a spectral window, the program uses a different scale
for the two spectra automatically.
\vskip 2pc
{\bf LEAST SQUARES CALCULATION}
\vskip 2pc
The command LS CALCULATION gives the amplitudes and phases of fixed
frequencies. This routine asks the number of frequencies and the value
of frequencies. If one types a negative frequency the programme asks
for the number of harmonics too. If one types n for the number
of harmonics, the programme fits the frequencies $1f, 2f,...,nf$. The
maximum number of frequencies (with the harmonics) is 50. Typing
0 for the number of frequencies the code calculates with the last
used frequencies, while typing -1 loads the frequencies from a file.
(The frequency file must have the structure: number of frequencies,
sequence of frequencies.)
After a short computing time the code shows the amplitudes and phases
with error estimates. The errors are the square roots of standard
deviation assuming that the differences between the data and the
fitted curve is gaussian noise. So these error estimates give only
a rough idea of the quality of the fit.
The value 'residual' represents the square root of the mean standard
deviation between the fitted curve and the data. The value
$a(0)$ is the constant shift for the fit, not the mean value.
The phases are calculated according to an epoch equal
to the integer part of the time of the first data element
(by default) but this value can be changed in the SYSTEM VARIABLES
menu (EPOCH).
One can verify the fit by the option SEE THE FIT in two ways:
by displaying the light curve night-by-night (NORMAL PLOT),
or by displaying the phase diagram (SPOOL THE DATA). If there are inactive
tracks in the data, the phase diagram can be drawn only for the active
tracks.
The programme saves or loads the LS coefficients in the following
format:
\vskip 10pt
\baselineskip=12pt
\parindent 0pc
\halign{#&\hfil#\hfil&\quad\hfil#\hfil&\quad\hfil#\hfil\cr
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ & $n$ & $a_0$ & $t_0$\cr
& $f_1$& $a_1$ & $b_1$\cr
& $f_2$& $a_2$ & $b_2$\cr
& .\cr
& .\cr
& .\cr
& $f_n$& $a_n$ & $b_n$\cr}
\baselineskip=12pt
where $n$ is the number of (all) frequencies, $t_0$ is the epoch,
$f_i$s are the frequencies and $a_i$s, $b_i$s are the cosine
and sine coefficients, ie. the fitted curve is the following
$$x(t)=a_0+\sum_{i=1}^n a_i \cos[2\pi f_i(t_i-t_0)]
+\sum_{i=1}^n b_i \sin[2\pi f_i(t_i-t_0)]$$
\parindent 2pc
The code MUFRAN whitens the light curve (not the spectra!) by the
command WHITENING. This option works after LS CALCULATION or after
LOAD LS COEFFICIENTS. This option is not repeatable, the user
cannot call it more than once
There is an option (MAKE SYNTHETIC DATA) for generation of artificial
data with sine waves according to the LS coefficients and the sampling
of the loaded time series. The cosine and sine amplitudes may be fixed
by the user too (TEST AMPLITUDES).
\vskip 2pc
{\bf SEARCH}
\vskip 2pc
The top of the peaks of the Fourier-spectra may not be in the
place of the real frequencies. To get the exact frequencies for
the best fit one can use the GRADIENT SEARCH. The GRADIENT SEARCH
is a nonlinear iterative fitting method, it searches for the local
minima of the deviation of the fit to the light curve. If one
starts the iteration so close to the real frequencies as the
width of the spectral peaks, the method works well. It means,
that the frequencies of the well determined peaks are good
initial values. One can give the
starting parameters (number of frequencies and harmonics ...)
as it was described at the LS CALCULATIONS. The code changes the
frequencies simultaneusly while converging to the local minimum
of the deviation between the fitted curve and the data. The step
size of the iterations is suggested by the code, but the final
value is determined by the user. The iteration can be interrupted
by pressing {\it q} or {\it Q}. After the GRADIENT SEARCH the new LS coefficients
are ready for the options SEE THE FIT, WHITENING or SAVE LS COEFFICIENTS.
The LINEAR SEARCH makes spectra as the Fourier transformation, but
it gives information about the goodness of the fit. The meaning
of 'goodness' is connected with the deviation between the fitted curve
and the data (REGISTER 0) and the cross-correlation of the two
time series (REGISTER 1). The main difference between these and the
Fourier spectra is that the LINEAR SEARCH deals with a multiperiodic fit with
fixed and variable frequencies. The using of this method is similar
to the DFT, but the user must give the range for the first
frequency and the value of fixed frequencies.
Both SEARCH methods change the harmonic frequencies simultaneously, so that
the harmonic ratios are remained.
\vskip 2pc
{\bf EXERCISE}
\vskip 2pc
The file MUFRAN.EPL consists of a $\delta$ Scuti like time series,
with frequencies $f_1=12.0,f_2=13.2$. An example for the analysis
of this data is given. Start the program and press {\it l} for
LOAD THE LIGHT CURVE. Then give the name of the data file {\it mufran.epl}
and press return. The data can be seen by pressing {\it s}. Calculate the
spectra by ZOOM-FFT! Press {\it f} and give 0 for the minimum and 30 for the
maximum
frequency. The suggested number of steps is 500, type e.g. 1000. Wait for
the main menu return, then press {\it s} (SEE THE SPECTRA). When the spectrum
is displayed move the cursors by the vertical arrows so that only the two
highest peaks are above the cursors. Press {\it Esc} to display the frequencies
of these peaks and {\it p} to type it in text mode. Save the frequencies and
return to the main menu by {\it q}. Choose the LS CALCULATION ({\it e}), give
-1 for the number of frequencies and write the filename. After some time
the program types the amplitudes and phases. Press any key then press {\it y}
and {\it a} (SEE THE FIT). Leave the graphic routine and start the SEARCH
(GRADIENT). Give 0 for the number of frequencies and the suggested value for
the frequency step and wait for the O.K. to appear. Press any key and SEE THE FIT
again.
\vskip 2pc
{\bf REFERENCES}
\vskip 2pc
\parindent 0pc
Deeming, T. J. 1975, {\it Astrophys. Space Sci.}, {\bf 36}, 137.
Press, W. H. \& Rybicki, G. B., 1989. {\it Ap. J.}, {\bf 338}, 277.
\bye