foutra: add math for harmonic scaling authored by Thomas Forbriger's avatar Thomas Forbriger
......@@ -22,15 +22,159 @@ This way it computes spectral analysis with three different scaling options:
### Scaling options
#### Fourier amplitude spectrum
#### Power spectral density
#### Spectrum of harmonics amplitudes
#### Scaling for harmonic signals
This math is inline $`a^2+b^2=c^2`$.
For harmonic signals the FFT normalized to the duration of the available
time window has an amplitude of the value of the maximum of the Fourier
transform of the window function times half the amplitude of the time domain
signal. To obtain a spectral representation with peaks of the amplitude of
the time domain signal, the FFT must be scaled accordingly.
This is on a separate line
We understand
```math
a^2+b^2=c^2
\tilde{f}(\omega)=\int\limits_{-\infty}^{+\infty}
f(t) \,e^{-i\omega t} \textrm{d}{t}.
```
as the Fourier transformation of the time domain signal
```math
f(t)=\int\limits_{-\infty}^{+\infty}
\tilde{f}(\omega) \,e^{i\omega t} \frac{\textrm{d}{\omega}}{2\pi}.
```
If we apply a time domain window function \f$w(t)\f$ to the function
\f$f(t)\f$, we obtain the tapered function
```math
g(t)=f(t) w(t)
```
and its Fourier transform
```math
\tilde{g}(\omega)=\int\limits_{-\infty}^{+\infty}
\tilde{f}(\omega')\,\tilde{w}(\omega-\omega')\,\textrm{d}\omega.
```
##### Application to harmonic signals
Let
```math
f(t)=A\,\cos(\omega_0 t+\phi)
```
be the harmonic signal under investigation.
Then
```math
f(t)=A\left\{\cos(\omega_0 t)\cos(\phi)-
\sin(\omega_0 t)\sin(\phi)\right\}
```
and
```math
\tilde{f}(\omega) =
\frac{A}{2}\left\{
\cos(\phi)
\left[
\delta(\omega-\omega_0)
+
\delta(\omega+\omega_0)
\right]
+i\sin(\phi)
\left[
\delta(\omega-\omega_0)
-
\delta(\omega+\omega_0)
\right]
\right\},
```
where \f$\delta(\omega)\f$ is Dirac's delta function with
```math
\delta(\omega)=\left\{
\begin{array}{ll}
\infty & \textrm{if $\omega=0$ and}\\
0 & \textrm{otherwise}
\end{array}
\right.
```
and
```math
\int\limits_{-\infty}^{+\infty}
\delta(\omega)\,\textrm{d}\omega=1
```
such that
```math
\tilde{f}(\omega)=\int\limits_{-\infty}^{+\infty}
\tilde{f}(\omega')\,\delta(\omega-\omega')\,\textrm{d}\omega.
```
This way I obtain
```math
\tilde{g}(\omega)=
\frac{A}{2}\left\{
e^{i\phi}\tilde{w}(\omega-\omega_0)
+
e^{-i\phi}\tilde{w}(\omega+\omega_0)
\right\}
```
for the Fourier transform of the tapered function.
If we ignore interference with side-lobes from the negative frequency
\f$-\omega_0\f$ and side-lobes of potential other harmonics at nearby
frequencies, we can approximate
```math
\tilde{g}(\omega_0)\approx\frac{A}{2}e^{i\phi}\tilde{w}(0)
```
and
```math
\left|\tilde{g}(\omega_0)\right|\approx
\frac{A}{2}\left|\tilde{w}(0)\right|.
```
##### Boxcar taper function
The boxcar taper is defined as
```math
w(t) =
\left\{
\begin{array}{ll}
1 & \textrm{if $|t|\leq T/2$ and}\\
0 & \textrm{otherwise}
\end{array}
\right.
```
with
```math
\tilde{w}(\omega)
= T \frac{\sin(\omega T/2)}{\omega T/2}
```
and
```math
w_{\textrm{max}}=w(0)=T.
```
##### Hanning taper function
The Hanning taper is defined as
```math
w(t) =
\left\{
\begin{array}{ll}
\cos^2(\pi t / T))
= \frac{1}{2}\left[
1 + \cos(2\pi t / T)
\right]
& \textrm{if $|t|\leq T/2$ and}\\
0 & \textrm{otherwise}
\end{array}
\right.
```
with
```math
\tilde{w}(\omega)
= T/2 \frac{\sin(\omega T/2)}{\omega T/2}
+ T/4 \frac{\sin(\omega T/2+\pi)}{\omega T/2+\pi}
+ T/4 \frac{\sin(\omega T/2-\pi)}{\omega T/2-\pi}
```
(see Blackman, R.B. and Tukey, J.W. 1958.
The measurement of power spectra.
Dover Publications, Inc., New York.
Section B.5)
and
```math
w_{\textrm{max}}=w(0)=\frac{T}{2}.
```
### Usage
......
......