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?

指定も式を日本語で可視化する

Last updated at Posted at 2025-09-05

Google Colab での可視化

Colab には日本語フォントが標準で入っていないため、まず Noto Sans JP をインストールします。

スクリプト例

# フォントをインストール
!apt-get -y install fonts-noto-cjk

import matplotlib.pyplot as plt
import matplotlib.font_manager as fm

# フォント指定
jp_font = fm.FontProperties(fname="/usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc")

plt.figure(figsize=(9,8))

# 数式 (LaTeX)
walden = r"$\mathrm{FoM_W} = \dfrac{P}{\min(2 \times BW_{\mathrm{eff}}, F_s) \cdot 2^{ENOB}}$"
walden_alt = r"$\mathrm{FoM_W} = \dfrac{E_{\mathrm{conversion}}}{2^{ENOB}}, \quad E_{\mathrm{conversion}} = \dfrac{P}{F_s}$"
schreier = r"$\mathrm{FoM_S} = \mathrm{SNDR} + 10 \cdot \log_{10}\!\left(\dfrac{BW_{\mathrm{eff}}}{P}\right)$"

# タイトルと数式
plt.text(0.05, 0.92, "ADC の Figure of Merit (FoM)", fontsize=16, weight="bold", fontproperties=jp_font)
plt.text(0.05, 0.80, walden, fontsize=18)
plt.text(0.05, 0.70, walden_alt, fontsize=14)
plt.text(0.05, 0.55, schreier, fontsize=18)

# パラメータ説明
params = """
P : 消費電力 [W]
BW_eff : 実効帯域幅 [Hz]
Fs : サンプリング周波数 [Hz]
ENOB : 有効ビット数 [bit]
E_conversion : 変換ステップあたりの消費エネルギー [J] (E_conversion = P / Fs)
SNDR : 信号対雑音歪比 [dB]
min(2×BW_eff, Fs) : 実効帯域幅とサンプリング周波数のうち小さい方
"""
plt.text(0.05, 0.35, params, fontsize=12, fontproperties=jp_font, va="top")

plt.axis("off")
plt.show()

実行結果

  • 上部に Walden FoM と Schreier FoM の数式が LaTeX で綺麗に表示
  • 下部に 日本語でのパラメータ説明がメイリオ風フォントで表示

# Program Name: adc_fom_comparison.py
# Creation Date: 20250905
# Overview: Compare Walden FoM and Schreier FoM with equations and explanations
# Usage: Run in Google Colab (requires Noto Sans JP font)

# --- Install Japanese font ---
!apt-get -y install fonts-noto-cjk

# --- Python code ---
import matplotlib.pyplot as plt
import matplotlib.font_manager as fm

# Noto Sans JP フォント指定
jp_font = fm.FontProperties(fname="/usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc")

plt.figure(figsize=(14,7))

# --- Walden FoM ---
walden_eq = r"$FoM_W = \dfrac{P}{F_s \times 2^{ENOB}}$"
walden_text = """定義:
- P : 消費電力 [W]
- Fs : サンプリング周波数 [Hz]
- ENOB : 有効ビット数 [bit]

意味:
- 1ステップの変換あたりに必要なエネルギーを表す
- 値が小さいほど「低電力・高効率ADC」

特徴:
- 消費電力基準の総合性能指標
- Fs と ENOB を同時に考慮できる
- 方式やプロセス間の比較に広く利用"""

# --- Schreier FoM ---
schreier_eq = r"$FoM_S = SNDR + 10 \cdot \log_{10}\!\left(\dfrac{BW}{P}\right)$"
schreier_text = """定義:
- SNDR : 信号対雑音ひずみ比 [dB]
- BW : 実効帯域幅 [Hz]
- P : 消費電力 [W]

意味:
- SNDR と帯域幅を消費電力で正規化
- 値が大きいほど「高分解能・高性能ADC」

特徴:
- 精度を重視した性能指標
- 歪みや分解能に重点
- 高分解能ADCの設計評価に適する"""

# --- 配置 ---
plt.subplot(1,2,1)
plt.text(0.05, 0.9, "Walden FoM", fontsize=16, weight="bold", fontproperties=jp_font)
plt.text(0.05, 0.75, walden_eq, fontsize=20)
plt.text(0.05, 0.65, walden_text, fontsize=12, fontproperties=jp_font, va="top")
plt.axis("off")

plt.subplot(1,2,2)
plt.text(0.05, 0.9, "Schreier FoM", fontsize=16, weight="bold", fontproperties=jp_font)
plt.text(0.05, 0.75, schreier_eq, fontsize=20)
plt.text(0.05, 0.65, schreier_text, fontsize=12, fontproperties=jp_font, va="top")
plt.axis("off")

plt.suptitle("ADC FoM の比較: Walden vs Schreier", fontsize=18, fontproperties=jp_font, weight="bold")
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?