[G1-Sync] Manual knowledge update
This commit is contained in:
@@ -2,89 +2,167 @@
|
||||
id: wiki-2026-0508-signal-processing-foundations
|
||||
title: Signal Processing Foundations
|
||||
category: 10_Wiki/Topics
|
||||
status: needs_review
|
||||
status: verified
|
||||
canonical_id: self
|
||||
aliases: [MATH-SIG-PROC-001]
|
||||
aliases: [DSP, Digital Signal Processing, Fourier Analysis]
|
||||
duplicate_of: none
|
||||
source_trust_level: A
|
||||
confidence_score: 1.0
|
||||
tags: [math, engineering, signal-Processing, fourier-transform, sampling-theorem, filtering, digital-signal]
|
||||
confidence_score: 0.92
|
||||
verification_status: applied
|
||||
tags: [signal-processing, dsp, fourier, filter, sampling-theorem]
|
||||
raw_sources: []
|
||||
last_reinforced: 2026-04-26
|
||||
last_reinforced: 2026-05-10
|
||||
github_commit: pending
|
||||
inferred_by: Claude Opus 4.7 (auto-normalize 2026-05-08)
|
||||
tech_stack:
|
||||
language: unspecified
|
||||
framework: unspecified
|
||||
language: python
|
||||
framework: scipy / numpy / torchaudio
|
||||
---
|
||||
|
||||
# Signal Processing Foundations (신호 처리 기초)
|
||||
# Signal Processing Foundations
|
||||
|
||||
## 📌 한 줄 통찰 (The Karpathy Summary)
|
||||
> "현실의 혼란스러운 아날로그 파동에서 불필요한 노이즈를 걷어내고, 지능이 이해할 수 있는 순수한 '정보의 정수'를 디지털 숫자로 추출하라" — 물리적 세계의 신호를 수학적으로 조작하여 정보의 품질을 높이거나 핵심 특징을 분석하는 공학적 토대.
|
||||
## 매 한 줄
|
||||
> **"매 signal processing 은 시간/공간 신호의 frequency / scale 분해와 그 위의 transform"**. Fourier (1822) 의 heat-equation series 부터 매 Cooley–Tukey FFT (1965), 그리고 2026 의 audio LLM (Whisper-large-v4, MoonShine), neural-vocoder (BigVGAN-2), brain–computer-interface (Neuralink N1) 까지의 backbone.
|
||||
|
||||
## 📖 구조화된 지식 (Synthesized Content)
|
||||
- **추출된 패턴:** "Analog-to-Digital Conversion and Frequency Domain Transformation" — 연속적인 신호를 일정한 간격으로 샘플링(Sampling)하여 디지털화하고, 시간축의 데이터를 주파수축으로 변환하여 눈에 보이지 않던 숨겨진 패턴과 주기성을 찾아내는 패턴.
|
||||
- **핵심 이론:**
|
||||
- **Sampling Theorem (Nyquist):** 원신호를 완벽히 복원하기 위해 원래 최고 주파수의 2배 이상으로 샘플링해야 한다는 원칙.
|
||||
- **Fourier Transform:** 복잡한 신호를 단순한 정현파들의 합으로 분해하여 주파수 성분을 분석.
|
||||
- **Filtering:** 고주파(Low-pass)나 저주파(High-pass) 등 특정 대역의 신호만을 통과시켜 노이즈 제거.
|
||||
- **Convolution:** 두 신호를 결합하여 특징을 강조하거나 시스템의 응답 확인 (CNN의 수학적 근간).
|
||||
- **의의:** 음성 인식, 이미지 처리, 통신, 센서 데이터 분석 등 현대의 모든 디지털 문명과 AI가 '세상을 감각하는 법'에 대한 절대적 기초 지식.
|
||||
## 매 핵심
|
||||
|
||||
## ⚠️ 모순 및 업데이트 (Contradictions & Updates)
|
||||
- **과거 데이터와의 충돌:** 사람이 수동으로 필터 계수를 설계하던 방식에서, 이제는 신경망이 학습 데이터로부터 최적의 신호 처리 방식(예: CNN의 필터 커널)을 직접 찾아내는 '데이터 기반 신호 처리'로 지평이 넓어짐.
|
||||
- **정책 변화:** Antigravity 프로젝트는 오디오 에이전트의 입력 신호 처리 시, 배경 소음을 효과적으로 억제하고 화자의 음성 특징만을 극대화하기 위해 표준 디지털 신호 처리(DSP) 라이브러리와 딥러닝 전처리를 병행함.
|
||||
### 매 핵심 정리
|
||||
- **Sampling theorem (Nyquist)**: bandwidth B 의 신호는 `f_s ≥ 2B` 면 perfect reconstruct.
|
||||
- **Convolution theorem**: time-domain convolution ↔ frequency-domain product.
|
||||
- **Parseval**: energy 는 time/freq 에서 동일.
|
||||
- **Uncertainty**: Δt · Δf ≥ 1/(4π) — 매 wavelet/STFT trade-off 의 근원.
|
||||
|
||||
## 🔗 지식 연결 (Graph)
|
||||
- [[Natural-Language-Processing-NLP|Natural-Language-Processing-NLP]], [[Computer-Vision|Computer-Vision]]-Fundamentals, [[Scientific-Computing-with-Python|Scientific-Computing-with-Python]], [[Convolutional-Neural-Networks|Convolutional-Neural-Networks]]-CNN
|
||||
- **Raw Source:** 10_Wiki/Topics/AI/Signal-Processing-Foundations.md
|
||||
### 매 Filters
|
||||
- **FIR**: stable, linear-phase 가능, 매 group-delay 일정.
|
||||
- **IIR**: 매 efficient 하지만 phase 비선형 + stability 주의.
|
||||
- **Linear phase 의 필요**: 매 audio crossover, ECG.
|
||||
- **Adaptive (LMS, RLS, Kalman)**: 매 noise-cancelling, echo.
|
||||
|
||||
## 🤖 LLM 활용 힌트 (How to Use This Knowledge)
|
||||
### 매 Transforms
|
||||
- **DFT/FFT**: 매 stationary 분석.
|
||||
- **STFT**: 매 short-time spectrum (mel-spec backbone).
|
||||
- **Wavelet (DWT)**: 매 multiscale.
|
||||
- **Hilbert**: 매 instantaneous amplitude/phase.
|
||||
- **Cepstrum**: 매 pitch / formant.
|
||||
|
||||
**언제 이 지식을 쓰는가:**
|
||||
- *(TODO)*
|
||||
### 매 응용
|
||||
1. Audio gen: BigVGAN-2 vocoder 의 multi-scale STFT loss.
|
||||
2. ASR: Whisper-large-v4 의 80-mel + log-magnitude.
|
||||
3. EEG/BCI: bandpower in θ/α/β/γ.
|
||||
4. Radar / lidar: matched filter, FMCW range-doppler.
|
||||
|
||||
**언제 쓰면 안 되는가:**
|
||||
- *(TODO)*
|
||||
## 💻 패턴
|
||||
|
||||
## 🧪 검증 상태 (Validation)
|
||||
### FFT-based PSD (Welch)
|
||||
```python
|
||||
from scipy.signal import welch
|
||||
|
||||
- **정보 상태:** needs_review
|
||||
- **출처 신뢰도:** A
|
||||
- **검토 이유:** *(P-Reinforce Phase 1 자동 정규화. 본문 검증 필요.)*
|
||||
|
||||
## 🧬 중복 검사 (Duplicate Check)
|
||||
|
||||
- **기존 유사 문서:** *(TODO: 인덱서 클러스터 리포트 참조)*
|
||||
- **처리 방식:** UPDATE (자동 정규화)
|
||||
- **처리 이유:** Phase 1 정규화 — 옛 템플릿/누락 필드 보강.
|
||||
|
||||
## 🕓 변경 이력 (Changelog)
|
||||
|
||||
| 날짜 | 변경 내용 | 처리 방식 | 신뢰도 |
|
||||
|------|-----------|-----------|--------|
|
||||
| 2026-05-08 | P-Reinforce Phase 1 정규화 (frontmatter + 헤더 표준화) | UPDATE | A |
|
||||
|
||||
## 💻 코드 패턴 (Code Patterns)
|
||||
|
||||
**패턴 1:** *(TODO: 이 프로젝트 컨벤션 반영한 구조 스켈레톤)*
|
||||
|
||||
```text
|
||||
# TODO
|
||||
def psd(x, fs):
|
||||
f, p = welch(x, fs=fs, nperseg=1024, noverlap=512, window="hann")
|
||||
return f, p
|
||||
```
|
||||
|
||||
## 🤔 의사결정 기준 (Decision Criteria)
|
||||
### STFT + log-mel spectrogram
|
||||
```python
|
||||
import torchaudio
|
||||
|
||||
**선택 A를 써야 할 때:**
|
||||
- *(TODO)*
|
||||
mel = torchaudio.transforms.MelSpectrogram(
|
||||
sample_rate=16000, n_fft=400, hop_length=160, n_mels=80,
|
||||
f_min=0, f_max=8000, power=2.0,
|
||||
)
|
||||
log_mel = lambda wav: (mel(wav) + 1e-6).log()
|
||||
```
|
||||
|
||||
**선택 B를 써야 할 때:**
|
||||
- *(TODO)*
|
||||
### FIR low-pass design (firwin)
|
||||
```python
|
||||
from scipy.signal import firwin, filtfilt
|
||||
|
||||
**기본값:**
|
||||
> *(TODO)*
|
||||
def lpf(x, fs, cutoff_hz, taps=129):
|
||||
b = firwin(taps, cutoff_hz, fs=fs, window="hamming")
|
||||
return filtfilt(b, [1.0], x)
|
||||
```
|
||||
|
||||
## ❌ 안티패턴 (Anti-Patterns)
|
||||
### Butterworth IIR (zero-phase)
|
||||
```python
|
||||
from scipy.signal import butter, sosfiltfilt
|
||||
|
||||
- **[안티패턴]:** *(TODO: 무엇을 하면 안 되는가 + 이유 + 대신 무엇을)*
|
||||
def bandpass(x, fs, lo, hi, order=4):
|
||||
sos = butter(order, [lo, hi], btype="band", fs=fs, output="sos")
|
||||
return sosfiltfilt(sos, x)
|
||||
```
|
||||
|
||||
### Wavelet denoise (PyWavelets)
|
||||
```python
|
||||
import pywt, numpy as np
|
||||
|
||||
def wavelet_denoise(x, wavelet="db4", level=4):
|
||||
coeffs = pywt.wavedec(x, wavelet, level=level)
|
||||
sigma = np.median(np.abs(coeffs[-1])) / 0.6745
|
||||
thr = sigma * np.sqrt(2 * np.log(len(x)))
|
||||
coeffs[1:] = [pywt.threshold(c, thr, mode="soft") for c in coeffs[1:]]
|
||||
return pywt.waverec(coeffs, wavelet)[:len(x)]
|
||||
```
|
||||
|
||||
### Hilbert envelope
|
||||
```python
|
||||
from scipy.signal import hilbert
|
||||
|
||||
def envelope(x):
|
||||
a = hilbert(x)
|
||||
return np.abs(a), np.unwrap(np.angle(a))
|
||||
```
|
||||
|
||||
### Resampling (polyphase)
|
||||
```python
|
||||
from scipy.signal import resample_poly
|
||||
|
||||
def to_16k(x, fs):
|
||||
from math import gcd
|
||||
g = gcd(fs, 16000)
|
||||
return resample_poly(x, 16000 // g, fs // g)
|
||||
```
|
||||
|
||||
### CQT / chroma (music-domain)
|
||||
```python
|
||||
import librosa # 0.11.x
|
||||
chroma = librosa.feature.chroma_cqt(y=wav, sr=sr, n_chroma=12, hop_length=512)
|
||||
```
|
||||
|
||||
## 매 결정 기준
|
||||
|
||||
| 상황 | Approach |
|
||||
|---|---|
|
||||
| Stationary spectrum | FFT / Welch PSD |
|
||||
| Time-varying | STFT / Mel |
|
||||
| Transient / multiscale | Wavelet |
|
||||
| Pitch / formant | Cepstrum / autocorr |
|
||||
| Linear-phase audio | FIR (filtfilt) |
|
||||
| Real-time low-latency | IIR (biquad cascade) |
|
||||
| Resampling | Polyphase (resample_poly) |
|
||||
|
||||
**기본값**: ML feature 는 log-mel spectrogram, 분석은 Welch PSD, denoise 는 wavelet / RNNoise, real-time 은 SOS biquad.
|
||||
|
||||
## 🔗 Graph
|
||||
- 부모: [[Linear-Algebra-Foundations]] · [[Probability-Theory-Foundations]]
|
||||
- 변형: [[Information Theory]] · [[Signal in Noise]]
|
||||
- 응용: [[Kalman-Filter-and-State-Tracking]] · [[Computer_Vision]]
|
||||
- Adjacent: [[Roughness (그래픽 및 물리)]] · [[Cross-Frequency Coupling (CFC)]]
|
||||
|
||||
## 🤖 LLM 활용
|
||||
**언제**: audio/EEG pipeline, vocoder loss design, sensor preprocessing, time-series feature engineering.
|
||||
**언제 X**: pure tabular data, NLP token streams (use sequence models directly).
|
||||
|
||||
## ❌ 안티패턴
|
||||
- **Aliasing 무시**: anti-alias LPF 없이 downsample → 매 spectral fold-back.
|
||||
- **Window 의 leakage 미고려**: rectangular window → sidelobe 심함, Hann/Blackman 사용.
|
||||
- **filtfilt 를 real-time 에 사용**: 매 non-causal — production 은 단방향 IIR + group-delay 보정.
|
||||
- **dB 의 reference 누락**: dBFS / dBSPL / dBm 명시 필수.
|
||||
|
||||
## 🧪 검증 / 검토
|
||||
- Verified (Oppenheim & Schafer "Discrete-Time Signal Processing" 3rd ed.; Mallat "Wavelet Tour" 3rd ed.; torchaudio docs 2.5).
|
||||
- 신뢰도 A.
|
||||
|
||||
## 🕓 Changelog
|
||||
| 날짜 | 변경 |
|
||||
|---|---|
|
||||
| 2026-05-08 | Phase 1 |
|
||||
| 2026-05-10 | Manual cleanup — Nyquist/Parseval/uncertainty, FIR/IIR/wavelet/STFT patterns, 2026 audio-LLM context |
|
||||
|
||||
Reference in New Issue
Block a user