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?

More than 3 years have passed since last update.

numpyとmatplotlibによる半波長ダイポールアンテナのE面指向性利得の描画

Last updated at Posted at 2021-05-25

おことわり

この記事は,アンテナの基礎的な用語をはじめとした,アンテナの基本事項に関する説明はしておりません.

目的・やること

半波長ダイポールアンテナの角度$\theta$に対するE面指向性利得(単位:dBi)の図を,numpyとmatplotlib.pyplotを使用して極座標形式で描画する.

理論・前提知識

半波長ダイポールアンテナのE面指向性

角度$\theta$に対する半波長ダイポールアンテナのE面指向性$D(\theta)$は,
$$ D(\theta) = \frac{\cos\left (\frac{\pi}{2}\cos{\theta} \right)}{\sin{\theta}} $$
をプロットすることで得ることができます.
これをnumpyを用いて実装します.

numpyによる実装方針

numpyで実装する場合には,できるだけfor文等のループを使用せずに実装します.
ここでは,numpyによる半波長ダイポールアンテナの角度$\theta$に対する半波長ダイポールアンテナのE面指向性$D(\theta)$の計算を取り上げます.

まず,$0<\theta < 2\pi$の範囲の角度ベクトルを用意します.角度$\theta$の間隔は各自で決めていただいて問題ありませんが,今回は0.01ずつとします.

theta = np.arange(0.01, 2*np.pi, 0.01)

続いて,$D(\theta)$の通りに実装を行います.このときsinとcosを計算する際にnumpyの関数を使用します.そうすることでループを使用せず角度$\theta$の各値に対していっぺんに計算を行うことができます.

def HW_dipole_np(theta):
    """
    角度ベクトルtheta(ndarray)に対して半波長ダイポールアンテナのE面指向性値ベクトル(ndarray)を返す.
    """
    return np.abs(np.cos((np.pi/2.0) * np.cos(theta)) / np.sin(theta))

なお,ここでは指向性図の描画のために$D(\theta)$の絶対値をとっています.

指向性(真値)から指向性利得[dBi]を得る

角度$\theta$に対する受信電界強度$|E(\theta)|$が,$|E(\theta)|=|D(\theta)|$という超絶好条件であると仮定すると,指向性$D(\theta)$から指向性利得[dBi]を得ることができます.
まず,受信側アンテナの開口面積を1と仮定した上で受信電力(単位:dBm)を以下の式
$$
P(\theta) = 10\log{\left(1000 \times \frac{|E(\theta)|^2}{120\pi}\right)}
$$
で計算します.$|E(\theta)|=|D(\theta)|$であるので,先程の計算結果をそのまま使用できます.
続いて,計算した受信電力をdBi値(絶対利得)に換算します.半波長ダイポールアンテナの絶対利得は2.15[dBi]であるので,受信電力の最大値$P_{max}$[dBm]$=2.15$[dBi]となるように値を修正します.具体的には各角度での受信電力$P(\theta)$[dBm]に対して,
$$
P(\theta)\mathrm{[dBi]} = P(\theta)\mathrm{[dBm]} + (2.15 - P_{max})
$$
と計算してやります.
以上から,指向性(真値)より指向性利得[dBi]を得ることができます.

matplotlib.pyplotによる極座標グラフの描き方

matplotlib.pyplotで極座標(偏角$\theta$に対する大きさ$r$)のグラフを描くには,subplotの引数projectionに対してpolarを渡します.

ax = plt.subplot(111, projection="polar")
ax.plot(theta, r)
plt.show()

ソースコード全体

# coding: utf-8

import numpy as np
import matplotlib.pyplot as plt


def HW_dipole_np(theta):
    """
    角度ベクトルtheta(ndarray)に対して半波長ダイポールアンテナのE面指向性値ベクトル(ndarray)を返す.
    """
    return np.abs(np.cos((np.pi/2.0) * np.cos(theta)) / np.sin(theta))

def to_dBi(d_real, dBi=2.15):
    """
    指向性d_real(真値)の絶対値=電界強度であると仮定し,d_realから指向性利得[dBi]を得る.
    """
    #受信電力[dBm]を計算
    PdBm = 10 * np.log(1000 * np.power(d_real, 2) / (120*np.pi))
    #角度に対する最大受信電力が2.15[dBi]となるように受信電力を変換して返す.
    Pmax = np.max(PdBm)
    return PdBm + (dBi - Pmax)

def plotd(theta, d):
    """
    角度thetaに対する指向性dを極座標形式で描画する.
    """
    ax = plt.subplot(111, projection="polar")
    ax.plot(theta, d)
    plt.show()


if __name__=="__main__":
    theta = np.arange(0.01, 2*np.pi, 0.01)
    D = HW_dipole_np(theta)
    plotd(theta, D) #指向性(真値)を描画
    plotd(theta, to_dBi(D)) #指向性利得[dBi]を描画

実行結果

角度$\theta$に対する指向性(真値)の描画結果は以下の通りとなりました.
HW_dipole_real.png

また,角度$\theta$に対する指向性利得[dBi]の描画結果は以下の通りとなりました.
HW_dipole_dBi.png

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?