デジタル信号処理と機械学習の学習ロードマップ:5大ハブ集大成と分野別動線(scipy.signal/numpy.fft/pywt/sklearn)

デジタル信号処理(Bode線図・フィルタ設計・時間周波数解析・周波数応答)と機械学習時系列予測の学習順序をPythonコードで体系化。scipy.signal・numpy.fft・pywt・sklearn・kerasのAPI名と5大集約ハブ(Bode/モンテカルロ最適化/フィルタ設計/時間周波数/ML時系列)へのリンクで初心者→実務者への動線を提示する。

なぜ学習ロードマップが必要か

デジタル信号処理(DSP)と機械学習(ML)は別々に学ぶと、それぞれが膨大な手法群を持つためどこから手をつけるかで挫折しがちである。実務では「センサデータ → 前処理(フィルタ)→ 特徴量 → ML モデル」と一連で扱うことが多く、両者を串刺しで学ぶ動線が要る。

本ブログでは過去 5 サイクルで以下の集約ハブを段階的に整備してきた:

  1. https://yuhi-sa.github.io/posts/20260521_bode_plot/1/ — Bode 線図ハブ(周波数応答の基礎)
  2. https://yuhi-sa.github.io/posts/20260522_monte_carlo_optimization/1/ — モンテカルロ最適化ハブ(最適化の確率的手法)
  3. https://yuhi-sa.github.io/posts/20260522_filter_design_guide/1/ — フィルタ設計指針ハブ(IIR/FIR/Notch/Bandpass)
  4. https://yuhi-sa.github.io/posts/20260524_time_frequency_guide/1/ — 時間周波数解析ハブ(STFT/Wavelet/Hilbert)
  5. https://yuhi-sa.github.io/posts/20260525_ml_timeseries_guide/1/ — 機械学習時系列ハブ(k-means/GMM/LSTM/Kalman/IsolationForest)

5 ハブが揃った今、本記事はこれらを束ねるメタ動線として、レベル別・目的別の学習順序を示すロードマップを提供する。

1. 5大ハブの俯瞰

ハブ扱う領域前提知識主要 API
Bode 線図周波数応答・ゲイン位相・伝達関数複素数、ラプラス変換初歩scipy.signal.bode, scipy.signal.TransferFunction, numpy.angle
モンテカルロ最適化確率的最適化・CEM/SA/GA/MPPI確率の基礎、numpy 配列演算numpy.random, scipy.optimize, 自作 sampler
フィルタ設計IIR/FIR、Butterworth/Chebyshev/Bessel、Notch/Bandpass周波数領域の感覚scipy.signal.butter, scipy.signal.firwin, scipy.signal.iirnotch, scipy.signal.freqz, scipy.signal.lfilter
時間周波数解析STFT/Wavelet/Hilbert/モード分解フィルタ設計 + Fourierscipy.signal.stft, pywt.cwt, scipy.signal.hilbert, PyEMD.EMD, vmdpy.VMD
ML 時系列k-means/GMM/RF/GBDT/LSTM/Kalman/IsolationForestnumpy, 確率初歩sklearn.cluster.KMeans, sklearn.ensemble.RandomForestClassifier, keras.layers.LSTM, sklearn.ensemble.IsolationForest

2. 学習動線図

[基礎数学]
  │ 複素数・線形代数・確率
[Fourier 解析] ── FFT 入門 ─┐
  │                          │
  ↓                          ↓
[Bode 線図ハブ]    [フィルタ設計ハブ]
  │                          │
  └──────────┬───────────────┘
   [時間周波数解析ハブ]
   [ML 時系列ハブ] ← [モンテカルロ最適化ハブ]
             │           (ハイパーパラメータ最適化で連携)
        [実務応用]

3. レベル別おすすめ進路

Level 1: 完全初心者(数学・プログラミングともに薄い)

目標: Python と numpy・matplotlib に慣れる。信号処理の用語を覚える。

  1. https://yuhi-sa.github.io/posts/20260223_matplotlib_tips/1/ — matplotlib の使い方
  2. https://yuhi-sa.github.io/posts/20210514_py_print/1/ — Python print の使い方
  3. https://yuhi-sa.github.io/posts/20260225_fft/1/ — FFT 入門(numpy.fft.fft
  4. https://yuhi-sa.github.io/posts/20260225_moving_average/1/ — 移動平均(SMA/WMA/EMA)
  5. https://yuhi-sa.github.io/posts/20220206_ema/1/ — 指数移動平均(EMA)の周波数特性

所要時間目安: 2〜4 週間。

Level 2: 数学基礎あり(線形代数・微積分の基本)

目標: 周波数応答とフィルタ設計の直観を得る。

  1. https://yuhi-sa.github.io/posts/20260521_bode_plot/1/ — Bode 線図ハブ
  2. https://yuhi-sa.github.io/posts/20260223_lowpass_filter/1/ — ローパスフィルタ
  3. https://yuhi-sa.github.io/posts/20260226_butterworth/1/ — Butterworth フィルタ
  4. https://yuhi-sa.github.io/posts/20260314_chebyshev_filter/1/ — Chebyshev フィルタ
  5. https://yuhi-sa.github.io/posts/20260316_bessel_filter/1/ — Bessel フィルタ
  6. https://yuhi-sa.github.io/posts/20260226_fir_iir/1/ — FIR と IIR の比較
  7. https://yuhi-sa.github.io/posts/20260522_filter_design_guide/1/ — フィルタ設計指針ハブ

所要時間目安: 4〜8 週間。

Level 3: Python 経験あり(numpy・matplotlib に慣れている)

目標: 時間周波数解析と非定常信号の扱いを習得する。

  1. https://yuhi-sa.github.io/posts/20260429_stft/1/ — STFT
  2. https://yuhi-sa.github.io/posts/20260226_wavelet/1/ — Wavelet 変換
  3. https://yuhi-sa.github.io/posts/20260522_wavelet_packet/1/ — Wavelet Packet 分解
  4. https://yuhi-sa.github.io/posts/20260318_hilbert_transform/1/ — Hilbert 変換
  5. https://yuhi-sa.github.io/posts/20260528_mode_decomposition/1/ — EMD/VMD/SSA モード分解
  6. https://yuhi-sa.github.io/posts/20260524_time_frequency_guide/1/ — 時間周波数解析ハブ

所要時間目安: 8〜12 週間。

Level 4: 実務応用志向(DSP の素地ができている)

目標: 機械学習と確率的最適化を信号処理に連携させる。

  1. https://yuhi-sa.github.io/posts/20260228_timeseries_anomaly/1/ — 時系列異常検知
  2. https://yuhi-sa.github.io/posts/20260226_kmeans_gmm/1/ — k-means / GMM
  3. https://yuhi-sa.github.io/posts/20260226_ensemble_learning/1/ — アンサンブル学習
  4. https://yuhi-sa.github.io/posts/20260317_lstm_timeseries/1/ — LSTM 時系列
  5. https://yuhi-sa.github.io/posts/20260525_ml_timeseries_guide/1/ — ML 時系列ハブ
  6. https://yuhi-sa.github.io/posts/20260223_bayesian_optimization/1/ — ベイズ最適化
  7. https://yuhi-sa.github.io/posts/20210329_cem/1/ — Cross Entropy Method
  8. https://yuhi-sa.github.io/posts/20260226_genetic_algorithm/1/ — 遺伝的アルゴリズム
  9. https://yuhi-sa.github.io/posts/20260215_mppi/1/ — MPPI
  10. https://yuhi-sa.github.io/posts/20260522_monte_carlo_optimization/1/ — モンテカルロ最適化ハブ

所要時間目安: 12〜20 週間。

4. 分野別の深掘り順序

A. 周波数応答(Bode)→ フィルタ設計

scipy.signal.TransferFunctionscipy.signal.bodescipy.signal.butterscipy.signal.cheby1/2scipy.signal.besselscipy.signal.iirnotch。学習所要 4〜6 週間。

B. Fourier → 時間周波数

numpy.fft.fftscipy.signal.windowsscipy.signal.welchscipy.signal.stftpywt.cwtscipy.signal.hilbertPyEMD.EMD / vmdpy.VMD。学習所要 6〜10 週間。

C. 状態推定

https://yuhi-sa.github.io/posts/20260224_kalman_filter/1/ → https://yuhi-sa.github.io/posts/20260224_ekf/1/ → https://yuhi-sa.github.io/posts/20260226_ukf/1/ → https://yuhi-sa.github.io/posts/20260223_particle_filter/1/ → https://yuhi-sa.github.io/posts/20260223_rts_smoother/1/。学習所要 6〜8 週間。

D. ML 時系列予測

sklearn.cluster.KMeanssklearn.mixture.GaussianMixturesklearn.ensemble.RandomForestClassifiersklearn.ensemble.GradientBoostingClassifierkeras.layers.LSTMsklearn.ensemble.IsolationForest。学習所要 8〜12 週間。

E. 確率的最適化

numpy.random ベース実装 → scipy.optimize.minimize → CEM → SA → GA → MPPI → ベイズ最適化(scikit-optimize)。学習所要 6〜10 週間。

5. 横断的トピック:信号処理と機械学習の融合

  • 特徴量設計: STFT 平均パワー、Wavelet エネルギー、HHT 瞬時周波数を特徴ベクトルにして RandomForest 分類
  • 異常検知: Notch + STFT で前処理 → IsolationForest で異常スコア
  • 時系列予測: SSA でトレンド分離 → LSTM で短期予測
  • ハイパーパラメータ最適化: フィルタ設計の遮断周波数 / LSTM の隠れ層次元をベイズ最適化で探索

具体実装は各ハブの「実用例」セクション、および https://yuhi-sa.github.io/posts/20260525_ml_timeseries_guide/1/ の統合評価コードを参照。

6. 学習チェックリスト(40 項目)

数学基礎

  1. 複素指数関数 \(e^{j\omega t}\) の物理的意味が言える
  2. ラプラス変換と Fourier 変換の関係を説明できる
  3. 線形時不変システムの伝達関数を求められる
  4. Parseval の等式が書ける
  5. ナイキストの定理を説明できる

Bode / フィルタ設計

  1. 1 次ローパスのカットオフ周波数を \(-3\) dB から定義できる
  2. Butterworth と Chebyshev の通過域・阻止域特性を比較できる
  3. Bessel が群遅延平坦である理由を言える
  4. scipy.signal.butter の出力を scipy.signal.lfilter に渡せる
  5. IIR と FIR の安定性・線形位相特性を比較できる
  6. Notch フィルタの \(Q\) 値と帯域幅の関係を言える
  7. 双線形変換 z 変換の役割が説明できる

Fourier / 時間周波数

  1. numpy.fft.fft の出力長と周波数軸を計算できる
  2. 窓関数(Hann/Hamming/Blackman)のスペクトル漏れ抑制を比較できる
  3. PSD の単位(V²/Hz)を言える
  4. STFT のフレーム長 / ホップ長を信号特性から選べる
  5. CWT と DWT の違いを言える
  6. Wavelet Packet が CWT より高解像度な理由を言える
  7. Hilbert 変換と解析信号の関係を式で書ける
  8. EMD と VMD のモード混合の違いを言える
  9. SSA の窓長 \(L\) を周期から決められる

ML 時系列

  1. k-means の K を Elbow / Silhouette で決められる
  2. GMM の EM 更新式を書ける
  3. RandomForest と GBDT の違いを言える
  4. LSTM のゲート 3 種(input/forget/output)を説明できる
  5. IsolationForest の異常スコアの計算方法が言える
  6. 時系列の train/val/test 分割で leakage を避ける方法を知る
  7. Kalman フィルタの予測・更新式を書ける
  8. EKF と UKF のヤコビアン不要性の違いを言える

確率的最適化

  1. CEM の精英率(elite rate)の影響を言える
  2. SA の温度スケジュールを設計できる
  3. GA の交叉・突然変異の典型実装を書ける
  4. MPPI が CEM の重み付きサンプリングと類比できる
  5. ベイズ最適化の獲得関数(EI/PI/UCB)を比較できる

統合スキル

  1. センサデータ → フィルタ → 特徴量 → 分類のパイプラインを書ける
  2. STFT で前処理した特徴量を IsolationForest に渡せる
  3. SSA でトレンド除去後 LSTM 予測ができる
  4. ハイパーパラメータ最適化をベイズ最適化で実装できる
  5. matplotlib で複数サブプロットの可視化ができる
  6. 結果を再現可能にするため numpy.random.seed を設定できる

7. よくある詰まりポイント Q&A

Q1. FFT の結果の周波数軸がわからない

np.fft.fftfreq(N, d=1/fs) または np.fft.rfftfreq(N, d=1/fs) で軸を生成する。サンプリング周波数 fs を必ず渡す。

Q2. フィルタが暴れる

scipy.signal.butter の正規化周波数は Nyquist=fs/2 で割った値Wn=cutoff/(fs/2) を渡すか、scipy.signal.butter(..., fs=fs)fs キーワードを使う。

Q3. LSTM の学習が進まない

入力スケーリング不足が最頻原因。sklearn.preprocessing.StandardScaler で平均 0 ・分散 1 にしてから学習。

Q4. STFT の窓長が選べない

周期最低 5〜10 周期入る長さに。nperseg = int(5 / target_freq * fs) を目安に試行錯誤。

Q5. EMD と VMD のどちらを使うか

モード数事前に決められる/安定性重視なら VMD、適応的に探索したいなら EMD(または EEMD)。詳細は https://yuhi-sa.github.io/posts/20260528_mode_decomposition/1/。

Q6. 異常検知で偽陽性が多い

特徴量に Hilbert 包絡線・Wavelet エネルギー・STFT バンド平均など信号の局所性を反映させる。IsolationForestcontamination パラメータの調整も有効。

Q7. ベイズ最適化の試行回数が足りない

低コスト目的関数では Grid Search が、高コストでは BO が有利。試行 50 回で頭打ちなら獲得関数を EI → UCB に切替。

8. 関連記事・参考資料

5 大ハブ:

  • https://yuhi-sa.github.io/posts/20260521_bode_plot/1/ — Bode 線図ハブ
  • https://yuhi-sa.github.io/posts/20260522_monte_carlo_optimization/1/ — モンテカルロ最適化ハブ
  • https://yuhi-sa.github.io/posts/20260522_filter_design_guide/1/ — フィルタ設計指針ハブ
  • https://yuhi-sa.github.io/posts/20260524_time_frequency_guide/1/ — 時間周波数解析ハブ
  • https://yuhi-sa.github.io/posts/20260525_ml_timeseries_guide/1/ — 機械学習時系列ハブ

主要構成記事:

  • https://yuhi-sa.github.io/posts/20260225_fft/1/ / https://yuhi-sa.github.io/posts/20260228_fft_window_psd/1/ / https://yuhi-sa.github.io/posts/20260429_stft/1/
  • https://yuhi-sa.github.io/posts/20260226_wavelet/1/ / https://yuhi-sa.github.io/posts/20260522_wavelet_packet/1/ / https://yuhi-sa.github.io/posts/20260318_hilbert_transform/1/ / https://yuhi-sa.github.io/posts/20260528_mode_decomposition/1/
  • https://yuhi-sa.github.io/posts/20260226_butterworth/1/ / https://yuhi-sa.github.io/posts/20260314_chebyshev_filter/1/ / https://yuhi-sa.github.io/posts/20260316_bessel_filter/1/ / https://yuhi-sa.github.io/posts/20260226_fir_iir/1/
  • https://yuhi-sa.github.io/posts/20260228_notch_filter/1/ / https://yuhi-sa.github.io/posts/20260312_bandpass_filter/1/ / https://yuhi-sa.github.io/posts/20260313_highpass_filter/1/ / https://yuhi-sa.github.io/posts/20260223_lowpass_filter/1/
  • https://yuhi-sa.github.io/posts/20260224_kalman_filter/1/ / https://yuhi-sa.github.io/posts/20260224_ekf/1/ / https://yuhi-sa.github.io/posts/20260226_ukf/1/ / https://yuhi-sa.github.io/posts/20260223_particle_filter/1/ / https://yuhi-sa.github.io/posts/20260223_rts_smoother/1/
  • https://yuhi-sa.github.io/posts/20260226_kmeans_gmm/1/ / https://yuhi-sa.github.io/posts/20260226_ensemble_learning/1/ / https://yuhi-sa.github.io/posts/20260317_lstm_timeseries/1/ / https://yuhi-sa.github.io/posts/20260228_timeseries_anomaly/1/
  • https://yuhi-sa.github.io/posts/20260223_bayesian_optimization/1/ / https://yuhi-sa.github.io/posts/20210329_cem/1/ / https://yuhi-sa.github.io/posts/20260226_simulated_annealing/1/ / https://yuhi-sa.github.io/posts/20260226_genetic_algorithm/1/ / https://yuhi-sa.github.io/posts/20260215_mppi/1/