aovspec Module

Routines for handling frequency spectra. This file is part of AOV package of routines for computation and evaluation of periodograms. (C) A. Schwarzenberg-Czerny 1998-2018, alex@camk.edu.pl Its distribution is free, except that distribution of modifications is prohibited.



Contents


Functions

public function cre_spec(nfr, fr0, frs)

create structure for spectrum frequency grid

Arguments

Type IntentOptional AttributesName
integer, intent(in) :: nfr

number of frequencies

real(kind=TIME), intent(in) :: fr0

initial frequency

real(kind=TIME), intent(in) :: frs

frequency step

Return Value type(SPEC_T)

new spec structure

public function fgrid(t, npar, fr0in, fruin, frsin)

Robust routine for evaluation of the time sampling pattern and guessing a suitable frequency grid. The spec structure containing grid parameters is returned as function value.

Read more…

Arguments

Type IntentOptional AttributesName
real(kind=TIME), intent(in) :: t(:)

times

integer, intent(in) :: npar

number of model parameters (to refine frequency grid)

real(kind=TIME), intent(in) :: fr0in

low frequency

real(kind=TIME), intent(in) :: fruin

high frequency

real(kind=TIME), intent(in) :: frsin

if positive set input grid values, though fru>=frs is forced; otherwise they are calculated within routine.

Return Value type(SPEC_T)

new spec structure spec.NFR, spec.FR0 and spec.FRS where NFR is calculated as (FRU-FR0)/FRS+1


Subroutines

public subroutine clr_spec(spec)

clear structure for spectrum frequency grid

Arguments

Type IntentOptional AttributesName
type(SPEC_T) :: spec

spec structure to destroy

public subroutine peak(n, fx, xm, fm, dx)

Scan periodogram for a peak and return its properties
Method:
For f=log(fx) fits a parabola 0.5(d2*x**2+d1*x)+f(2) where d2=f(1)+f(3)-2f(2), d1=f(3)-f(1) finds dxl & dxp such, that the linear and quadratic terms drop by 0.7 in log, i.e. by a factor of 2 (dx=HWHI).
(C) Alex Schwarzenberg-Czerny, 1999-2005 alex@camk.edu.pl

Arguments

Type IntentOptional AttributesName
integer, intent(in) :: n

periodogram length

real(kind=SP), intent(in) :: fx(n)

periodogram values

real(kind=TIME), intent(out) :: xm

peak location (in index units, 1<xm<n)

real(kind=SP), intent(out) :: fm

peak value;

real(kind=SP), intent(out) :: dx

peak halfwidth HWHI,dx<0 no valid peak

public subroutine peakrm(dt, spec, freq, thm, dfm)

Finds a peak and flags it to search for subsequent ones. Flags are negated weights, so they are not lost.

Arguments

Type IntentOptional AttributesName
real(kind=TIME), intent(in) :: dt

peak width

type(SPEC_T) :: spec

spectrum structure (changed on output)

real(kind=TIME), intent(out) :: freq

current peak frequency

real(kind=SP), intent(out) :: thm

current peak value

real(kind=SP), intent(out) :: dfm

current peak width