Files
thesis/latex/chapters/id/03_methodology/steps/preprocessing/index.tex
2025-08-07 22:49:04 +00:00

67 lines
1.9 KiB
TeX
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
\subsection{Signal Normalization}
Each raw acceleration time series
\(\mathbf{a}_{k}(n)\), \(n = 0,1,\dots,N-1\) with \(N=262144\) samples (collected at \(f_s=1024\)Hz over 256s) :contentReference[oaicite:0]{index=0} is first standardized to zero mean and unit variance:
\[
\tilde a_{k}(n)
=\frac{a_{k}(n)-\mu_{k}}{\sigma_{k}},
\quad
\mu_{k}=\frac{1}{N}\sum_{n=0}^{N-1}a_{k}(n),
\quad
\sigma_{k}=\sqrt{\frac{1}{N}\sum_{n=0}^{N-1}\bigl(a_{k}(n)-\mu_{k}\bigr)^{2}}.
\]
\subsection{Framing and Windowing}
The normalized signal \(\tilde a_{k}(n)\) is chopped into overlapping frames of length \(W\) samples with hop size \(H\). The \(p\)-th frame is
\[
x_{k,p}[m]
=\tilde a_{k}(pH + m)\,w[m],
\quad
m=0,1,\dots,W-1,
\]
where \(w[m]\) is a chosen window function (e.g., Hamming).
\subsection{Short-Time Fourier Transform (STFT)}
For each frame \(x_{k,p}[m]\), compute its STFT:
\[
S_{k}(f,p)
=\sum_{m=0}^{W-1}x_{k,p}[m]\;e^{-j2\pi\,f\,m/W},
\]
where \(f=0,1,\dots,W-1\) indexes frequency bins :contentReference[oaicite:1]{index=1}.
\subsection{Spectrogram and Log-Magnitude}
Form the magnitude spectrogram
\[
M_{k}(f,p)
=\bigl|S_{k}(f,p)\bigr|,
\]
and apply log scaling for numerical stability:
\[
L_{k}(f,p)
=\log\bigl(1 + M_{k}(f,p)^{2}\bigr).
\]
This yields a timefrequency representation
\(\mathbf{L}_{k}\in\mathbb{R}^{F\times P}\), with \(F\) frequency bins and \(P\) frames.
\subsection{Feature Matrix Assembly}
For each column \(j\in\{1,\dots,5\}\), select only the two endpoint sensors:
\[
\mathbf{L}_{\text{bot},j} = \mathbf{L}_{(j)},\quad
\mathbf{L}_{\text{top},j} = \mathbf{L}_{(25+j)},
\]
and stack them:
\[
\mathbf{F}_{j}
=
\begin{bmatrix}
\mathbf{L}_{\text{bot},j} \\[6pt]
\mathbf{L}_{\text{top},j}
\end{bmatrix}
\;\in\mathbb{R}^{2F\times P}.
\]
Finally, flatten into a feature vector:
\[
\mathbf{f}_{j}
=\operatorname{vec}\bigl(\mathbf{F}_{j}\bigr)
\;\in\mathbb{R}^{2FP}.
\]