sequence/wavelet.h マニュアル

(The documentation of sequence/wavelet.h)

Last Update: 2022/1/26


sequence/wavelet.hでは 時系列データのwavelet変換を行う関数が定義されている。 このヘッダファイル内で定義されている関数を以下に示す。 各関数の詳細は関数名をクリックしてリンク先を参照のこと。
Functions to perform the wavelet transformation of a time series data are defeind in sequence/wavelet.h. Functions defined in this header file are listed below. For details of individual functions, click the links.

このヘッダファイルで用いている数式については 表の下に載せているので参照のこと。
Mathematical formulas used in this header file are available below the table.

関数名
Function name
機能・用途
Purpose
morlet_spectrum
【マニュアル改訂中につき非公開】
[Documentation is not open as it is under revision]
Morlet wavelet (以下の(4)式)の フーリエ変換を計算する。
Compute the Fourier transformation of a Morlet wavelet (eq. 4 below).
wavelet_transform_morlet
【マニュアル改訂中につき非公開】
[Documentation is not open as it is under revision]
Morlet waveletをテンプレート関数として用いて 時系列データのwavelet変換を行う。
Perform the wavelet transformation of a time series data using the Morlet wavelet as a template function.


◆wavelet変換について (The wavelet transformation)

波形x(t)のwavelet変換は基準時刻trefおよび時間幅τの関数として 以下の式で定義される(e.g., Lapins et al., 2020)。 (1)T(tref,τ)x(t)ψ(ttrefτ)dt ここでψ(t)は解析者が指定する関数であり、テンプレート関数と呼ばれる。 または複素共役を表す。
The wavelet transformation of a waveform x(t), as a function of a reference time tref and a width of time τ, is defined by eq. (1). Here, ψ(t) is a function specified by the analyzer and is called a template function, and denotes a complex conjugate.

ψ(t)は2条件 (2)|ψ(t)|2dt< (3)ψ(t)dt=0 を満たさなければならない。 (2)式はt±ψ(t)0となることを、 (3)式はψ(t)の平均が0であることを表している。 ψ(t)の具体的な関数形の代表的なものにMorlet wavelet (4)ψ(t)=π1/4[exp(2πifreft)exp(2π2fref2)]exp(t22) がある(Lapins et al., 2020)。 ここでfrefは解析者が与える定数である。
The function ψ(t) must satisfy eqs (2) and (3), which mean that ψ(t) approaches to zero for t± and the average of ψ(t) is zero, respectively. One of the common choices for ψ(t) is a a Morlet wavelet (eq. 4) (Lapins et al., 2020), where fref is a constant given by the analyzer.


◆wavelet変換の計算 (Computation of the wavelet transformation)

wavelet変換の計算は周波数領域で行うのが効率が良い(Lapins et al., 2020)。 x(t), ψ(t)のフーリエ変換をそれぞれ (5)X(f)x(t)e2πiftdt (6)Ψ(f)ψ(t)e2πiftdt とおく。ここではfft.hに合わせてe+2πiftを用いた。 フーリエ逆変換は (7)x(t)=X(f)e2πiftdf (8)ψ(t)=Ψ(f)e2πiftdf である。また(6)の両辺の複素共役を取ると (9)Ψ(f)=ψ(t)e2πiftdt である。これらを用いると(1)式は T(tref,τ)=dtx(t)ψ(ttrefτ)=dtdfX(f)e2πiftψ(ttrefτ)=dfX(f)dtψ(ttrefτ)e2πift=dfX(f)τdtψ(t)e2πif(tref+τt)=τdfX(f)e2πiftrefdtψ(t)e2πifτt=τdfX(f)e2πiftrefΨ(fτ)(10)=τX(f)Ψ(fτ)e2πiftrefdf と書き直せる。ここで3行目から4行目への変形では (11)tttrefτ,t=tref+τt,dt=τdt の変数変換を用いた。
The wavelet transformation can be computed more efficiently in the frequency domain than the time domain (Lapins et al., 2020). Let the Fourier transformations of x(t) and ψ(t) be X(f) (eq. 5) and Ψ(f) (eq. 6), respectively. Here, e+2πift is used following fft.h. The corresponding Fourier inverse transformations are given by eqs (7) and (8). Taking the complex conjugates of the both hand sides of eq. (6) results in (9). Using these equations, eq. (1) can be rewritten as (10), where the 4-th line is based on a conversion of variable given by eq. (11).

(10)式を用いると wavelet変換は以下の手順で計算できる。
Using eq. (10), the wavelet transformation can be computed by the following procedure:
  1. 波形x(t)をフーリエ変換してX(f)を求める。 これはtref, τによらず1度だけ行えば良い。
    perform a Fourier transformation of the waveform x(t) to get X(f), which must be done only once as the transformation is independent of tref and τ;
  2. τについてΨ(fτ)を求める。 ψ(t)は解析者が指定する(既知の)関数であるので、 多くの場合Ψ(fτ)も解析的に書き下すことができ、 その関数形にfτの具体的な値を代入するだけで良い。
    calculate Ψ(fτ) for each τ, which can in many cases be done by simply inserting fτ values into an analytical formula of Ψ(fτ), since ψ(t) is a function given by the analyzer (i.e., a known function); and
  3. Ψ(fτ)X(f)を掛けてフーリエ逆変換し、 その結果をτ倍する。 これによって得られる時系列は現在のτにおける T(tref,τ)そのもの(trefを引数とする時系列) であることが(10)式から分かる。
    multiply Ψ(fτ) with X(f), perform the Fourier inverse transformation to it, and multiply the result with τ, the result of which is just the wavelet transformation T(tref,τ) for the current value of τ (represented as a time series with respect to tref) according to eq. (10).


◆参考文献 (References)

Lapins, S., et al. (2020), An examination of the continuous wavelet transform for volcano-seismic spectral analysis, JVGR, 389, 106728