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.
create structure for spectrum frequency grid
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | nfr | number of frequencies |
||
real(kind=TIME), | intent(in) | :: | fr0 | initial frequency |
||
real(kind=TIME), | intent(in) | :: | frs | frequency step |
new spec structure
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.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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. |
new spec structure spec.NFR, spec.FR0 and spec.FRS where NFR is calculated as (FRU-FR0)/FRS+1
clear structure for spectrum frequency grid
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(SPEC_T) | :: | spec | spec structure to destroy |
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
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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 |
Finds a peak and flags it to search for subsequent ones. Flags are negated weights, so they are not lost.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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 |