0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

ΔΣ(デルタシグマ)A/D変換器(2次)

Posted at

1. ブロック図(プレーンテキスト)

          +-------------------------+
          |                         |
   X(z) →(+)─►[ H1(z) ]─►(+)─►[ H2(z) ]─►[ Quantizer ]─► Y(z)
          ^            ^                         |
          |            |                         |
         [DAC1]       [DAC2]◄───────────────────+
          |                         |
          +-------------------------+
  • X(z):アナログ入力

  • (+):加算器(差分演算)

  • H1(z), H2(z):積分器

    • H(z) = z⁻¹ / (1 - z⁻¹)
  • Quantizer:有限ビット量子化器(例:1bit or 3bit)

  • DAC:量子化結果をアナログに戻し、加算器にフィードバック

  • Y(z):変調器出力


2. 基本式モデル

Y(z) = STF(z) * X(z) + NTF(z) * E(z)
  • STF(z):信号伝達関数
  • NTF(z):雑音伝達関数
  • E(z):量子化雑音(白色雑音仮定)

3. 1次ΔΣ変調器

STF(z) = 1
NTF(z) = 1 - z⁻¹

4. 2次ΔΣ変調器(今回の構成)

STF(z) = 1
NTF(z) = (1 - z⁻¹)²

5. SN比改善

  • オーバーサンプリング比:
OSR = fs / (2 * fB)
  • 1次 ΔΣ:
SNR ≈ (6.02 * N + 1.76) + 9 * log2(OSR)
  • 2次 ΔΣ:
SNR ≈ (6.02 * N + 1.76) + 15 * log2(OSR)
  • 有効ビット数:
ENOB = (SNR - 1.76) / 6.02

6. 特徴まとめ

  • STF = 1 → 入力信号を忠実に通す
  • NTF = (1 - z⁻¹)² → 雑音を高域に追いやる(強力なノイズシェーピング)
  • OSRを大きくすると、SN比が急上昇
  • 高精度・低周波数用途(音響・医療・精密計測)に最適

# Program Name: delta_sigma_adc_2nd_order.py
# Creation Date: 20250919
# Overview: Simulation of 2nd-order Delta-Sigma ADC with noise shaping
# Usage: Run in Google Colab or local Python environment to see input/output waveforms and PSD

!pip install numpy matplotlib scipy

import numpy as np
import matplotlib.pyplot as plt
from scipy.signal import welch

# ==============================
# Parameters / パラメータ
# ==============================
fs = 48000          # Sampling frequency [Hz]
f_in = 1000         # Input sine frequency [Hz]
N = 65536           # Number of samples
A = 0.6             # Input amplitude (normalized, 1.0 = full scale)

n = np.arange(N)
x = A * np.sin(2 * np.pi * f_in * n / fs)  # 入力正弦波

# ==============================
# 2nd-order Delta-Sigma Modulator
# ==============================
y = np.zeros(N)      # 出力系列(±1ビット)
v1 = 0.0             # 積分器1の状態
v2 = 0.0             # 積分器2の状態

for i in range(N):
    # 入力とフィードバックとの差
    e = x[i] - y[i-1] if i > 0 else x[i]
    
    # 積分器1
    v1 = v1 + e
    
    # 積分器2
    v2 = v2 + v1 - y[i-1] if i > 0 else v1
    
    # 量子化器(1-bit)
    y[i] = 1.0 if v2 >= 0 else -1.0

# ==============================
# デシメーションフィルタ(簡易LPF)
# ==============================
from scipy.signal import firwin, lfilter

decim_factor = 64  # デシメーション比
lpf = firwin(128, 1/decim_factor)  # LPF設計
y_filt = lfilter(lpf, 1.0, y)      # フィルタ処理
y_decim = y_filt[::decim_factor]   # ダウンサンプリング

# ==============================
# Plot Results / 結果表示
# ==============================
plt.figure(figsize=(12,6))

# 入力 vs 出力(ビットストリーム)
plt.subplot(2,1,1)
plt.plot(n[:1000]/fs, x[:1000], label="Input X(t)")
plt.step(n[:1000]/fs, y[:1000], where="mid", label="DS Modulator Output")
plt.xlabel("Time [s]")
plt.ylabel("Amplitude")
plt.title("2nd-order ΔΣ Modulator (Time Domain)")
plt.legend()
plt.grid()

# Power Spectral Density
f, Pxx = welch(y, fs, nperseg=8192)
plt.subplot(2,1,2)
plt.semilogx(f, 10*np.log10(Pxx), label="Quantized Output Spectrum")
plt.xlabel("Frequency [Hz]")
plt.ylabel("Power Spectral Density [dB/Hz]")
plt.title("Noise Shaping in 2nd-order ΔΣ ADC")
plt.grid()
plt.legend()

plt.tight_layout()
plt.show()
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?