Morlet wavelet
\[\begin{equation}
\psi(t)
=\pi^{-1/4}\left[\exp\left(-2\pi if_{ref} t\right)
-\exp\left(-2\pi^2 f_{ref}^2\right)\right]
\exp\left(-\frac{t^2}{2}\right)
\label{eq.psi}
\end{equation}\]
のフーリエ変換を計算する。
求めるのは指定した1つの周波数での値とし、
以下の(\ref{eq.Psi.final})式を用いて計算する。
Compute the Fourier transformation of a Morlet wavelet
(Eq. \ref{eq.psi})
for a single, specified frequency using Eq. \ref{eq.Psi.final}.
フーリエ変換の値を求めたい周波数(Hz)。
以下の計算式における\(f\)。
The frequency (Hz) at which the Fourier transformation is needed,
which is the value \(f\) in the formula below.
f_ref
(\ref{eq.psi})式における\(f_{ref}\)の値。
The value of \(f_{ref}) in Eq. (\ref{eq.psi}).
◆戻り値(Return value)
指定した周波数\(f\)におけるフーリエ変換\(\Psi(f)\)の値。
The value of Fourier transformation \(\Psi(f)\)
at the specified frequency \(f\).
となるので、(\ref{eq.round_integral})式で\(T\rightarrow\infty\)とした極限は
\[\begin{equation}
\int_{-\infty}^{\infty}\exp\left[-\frac{(t-2\pi if)^2}{2}\right]dt
-\sqrt{2\pi}=0
\label{eq.round_integral.infT}
\end{equation}\]
となり、ここから
\[\begin{equation}
\int_{-\infty}^{\infty}\exp\left[-\frac{(t-2\pi if)^2}{2}\right]dt
=\sqrt{2\pi}
\label{eq.integral1}
\end{equation}\]
が得られる。同様にして
\[\begin{equation}
\int_{-\infty}^{\infty}
\exp\left[-\frac{\left\{t-2\pi i\left(f-f_{ref}\right)\right\}^2}{2}
\right]dt
=\sqrt{2\pi}
\label{eq.integral2}
\end{equation}\]
も得られ、これらを(\ref{eq.Psi.derivation1})に代入すると
\[\begin{eqnarray}
\Psi(f)
&=& \pi^{-1/4}\exp\left[-2\pi^2 \left(f-f_{ref}\right)^2\right]
\sqrt{2\pi}
-\pi^{-1/4}\exp\left[-2\pi^2 \left(f^2+f_{ref}^2\right)\right]
\sqrt{2\pi}
\nonumber \\
&=& \sqrt{2}\pi^{1/4}\exp\left[-2\pi^2 \left(f-f_{ref}\right)^2\right]
-\sqrt{2}\pi^{1/4}\exp\left[-2\pi^2 \left(f^2+f_{ref}^2\right)\right]
\label{eq.Psi.final}
\end{eqnarray}\]
が得られる。
Following sequence/fft.h,
the Fourier transformation is defined by Eq. (\ref{eq.psi.fourier}).
Inserting Eq. (\ref{eq.psi}) into (\ref{eq.psi.fourier})
results in (\ref{eq.Psi.derivation1}).
Let us consider a complex integral (\ref{eq.integral.complex.general})
along a straight line connecting two arbitrary points \(P\) and \(Q\)
on a complex plane.
Since the integrand is regular over the entire complex plane,
a round integral connecting 4 points
\(A(T)\equiv -T\),
\(B(T)\equiv T\),
\(C(T,f)\equiv T+2\pi if\), and
\(D(T,f)\equiv -T+2\pi if\)
on a complex plane, where \(T\) is a positive real number,
satisfies (\ref{eq.round_integral}).
For a limit of \(T\rightarrow\infty\),
each term in Eq. (\ref{eq.round_integral}) can be calculated as follows:
the integral from \(A(T)\) to \(B(T)\),
where \(z=t\) and \(dz=dt\),
is calculated as (\ref{eq.integral.AB});
the integral from \(B(T)\) to \(C(T,f)\),
where \(z=T+is\) and \(dz=ids\),
is calculated as (\ref{eq.integral.BC});
the integral from \(C(T,f)\) to \(D(T,f)\),
where \(z=t+2\pi if\) and \(dz=dt\),
is calculated as (\ref{eq.integral.CD}); and
the integral from \(D(T,f)\) to \(A(T)\),
where \(z=-T+is\) and \(dz=ids\),
is calculated as (\ref{eq.integral.DA}).
Therefore Eq. (\ref{eq.round_integral}) reduces to
(\ref{eq.round_integral.infT}) at the limit of \(T\rightarrow\infty\),
giving (\ref{eq.integral1}).
In the same way, Eq. (\ref{eq.integral2}) is obtained.
Inserting these results into (\ref{eq.Psi.derivation1})
results in (\ref{eq.Psi.final}).
◆検証(Validation)
(\ref{eq.psi})式に基づいてMorlet waveletを生成して数値的にフーリエ変換し、
本関数で計算した値と比較した。
I compared the numerical Fourier transformation of a Morlet wavelet
created by Eq. (\ref{eq.psi})
with a spectrum created by this function.
Morlet waveletの生成にあたってはデータサンプル数\(N=16384\)、
時間刻み\(\Delta t=0.01\)、先頭時刻\(t_0=-N\Delta t/2\)とした。
時刻0付近に最も強いエネルギーを持つ波形なので
先頭時刻ではなく中心時刻が0になるように時刻範囲を設定することがポイントである。
Morlet waveletは複素関数なのでstruct imsequence2型構造体に代入し、
これを関数fft2によってスペクトルに変換した。
To generate the Morlet wavelet,
I used the number of data samples \(N=16384\),
a time stepping \(\Delta t=0.01\),
and a start time \(t_0=-N\Delta t/2\).
The point here is to set the time range not starting at time 0
but centered on time 0,
because the wavelet has the strongest energy at the time 0.
The Morlet wavelet is inserted into
a struct imsequence2-type structure
since it is a complex function.
Then the wavelet is transformed to a spectrum
by function fft2.
このようにして生成したスペクトルは実部に比べて虚部が十分に小さく、
実関数と見なせるものであった。
またその実部はこの関数を用いて計算したスペクトルと
グラフ上で差異が認められないレベルで一致した。
なお、この検証は\(f_{ref}=1\)および\(f_{ref}=3.3\)の2つのケースで試した。
The spectrum created in this way
had the imaginary components smaller enough than the real ones
to regard the spectrum as a real function.
The real parts showed no difference at a visible scale in a graph
from the spectrum calculated with this function.
This examination was conducted for two cases,
namely, \(f_{ref}=1\) and \(f_{ref}=3.3\).