Signals

Signal types, Nyquist-Shannon sampling, Fourier analysis, digital filtering, and signal-to-noise ratio.

Signal Fundamentals

Types of signals
Continuous (analog):  defined for all time, infinite values
  Sound waves, voltage, temperature

Discrete (digital):   defined at sample points, finite values
  Digital audio, network packets, sensor readings

Conversion:
  ADC (Analog-to-Digital): sample + quantize
  DAC (Digital-to-Analog): reconstruct from samples
Sinusoidal signals
x(t) = A × sin(2πft + φ)

A = amplitude (peak value)
f = frequency (Hz, cycles per second)
T = 1/f = period (seconds per cycle)
φ = phase (radians, offset from origin)
ω = 2πf = angular frequency (radians/second)

Key frequencies:
  20 Hz - 20 kHz:   human hearing range
  44.1 kHz:          CD sample rate
  48 kHz:            professional audio
  2.4 GHz:           WiFi band
Nyquist-Shannon sampling theorem
To perfectly reconstruct a signal:
  f_sample >= 2 × f_max

CD audio: 44.1 kHz samples → captures up to 22.05 kHz
  Human hearing: ~20 kHz max → sufficient

Aliasing: if f_sample < 2 × f_max
  High frequencies masquerade as low frequencies
  Anti-aliasing filter: remove frequencies above f_sample/2 before sampling

Fourier Analysis

Fourier transform
Any signal = sum of sine waves at different frequencies

Time domain → Frequency domain

Time domain:    x(t) — signal vs time
                "What amplitude at each moment?"

Frequency domain: X(f) — spectrum
                  "How much of each frequency?"

DFT/FFT:  discrete Fourier transform / fast Fourier transform
  DFT:  O(n^2) — direct computation
  FFT:  O(n log n) — divide and conquer (Cooley-Tukey)
  n must be power of 2 for basic FFT (zero-pad if needed)
Applications
Audio:        spectrum analyzer, EQ, noise removal
Networking:   OFDM in WiFi/LTE (data on many frequency channels)
Image:        JPEG compression (DCT — related to Fourier)
Security:     side-channel analysis (frequency of operations)
Monitoring:   detect periodic patterns in metrics

Filtering

Filter types
Low-pass:    passes frequencies below cutoff, removes high
             Smoothing, anti-aliasing, noise removal

High-pass:   passes frequencies above cutoff, removes low
             Edge detection, DC removal, differentiation

Band-pass:   passes frequencies in a range
             Radio tuning, voice isolation

Band-stop:   removes frequencies in a range (notch filter)
             Remove 60 Hz power line hum
Digital filters
Moving average (simple low-pass):
  y[n] = (x[n] + x[n-1] + ... + x[n-N+1]) / N

  Smooths data, removes high-frequency noise
  Used in monitoring dashboards (5-minute average)

Exponential moving average (EMA):
  y[n] = α × x[n] + (1-α) × y[n-1]

  α close to 1: fast response, more noise
  α close to 0: slow response, smoother
  Used in TCP RTT estimation: α = 1/8
Signal-to-noise ratio
SNR = P_signal / P_noise

SNR_dB = 10 × log_10(SNR)

Common values:
  60 dB:  studio recording (1,000,000:1)
  40 dB:  good audio (10,000:1)
  20 dB:  noisy but usable (100:1)
  0 dB:   signal equals noise (1:1)
  -10 dB: noise dominates (0.1:1)

See Also

  • Information Theory — channel capacity applies to real signals

  • Physics — wave physics underlying signal behavior

  • Wireless — RF signal concepts in WiFi