#coding:utf-8
import numpy as np
from matplotlib import pyplot as plt
import numpy as np
from matplotlib import pyplot as plt
N = 1024
hamming = np.hamming(N)
hanning = np.hanning(N)
bartlett = np.bartlett(N)
blackman = np.blackman(N)
kaiser = np.kaiser(N, 5)
hanning = np.hanning(N)
bartlett = np.bartlett(N)
blackman = np.blackman(N)
kaiser = np.kaiser(N, 5)
plt.figure(figsize=(30,20))
plt.rcParams["font.size"] = 30
plt.subplot(231)
plt.plot(hamming)
plt.title("ハミング窓")
plt.text(10, 0.5, r'$w(x)=0.54 - 0.46cos2πx$', color='red')
plt.axis((0, N, 0, 1))
plt.rcParams["font.size"] = 30
plt.subplot(231)
plt.plot(hamming)
plt.title("ハミング窓")
plt.text(10, 0.5, r'$w(x)=0.54 - 0.46cos2πx$', color='red')
plt.axis((0, N, 0, 1))
plt.subplot(232)
plt.plot(hanning)
plt.title("ハン窓")
plt.text(10, 0.5, r'$w(x)=0.5 - 0.5cos2πx$', color='red')
plt.axis((0, N, 0, 1))
plt.plot(hanning)
plt.title("ハン窓")
plt.text(10, 0.5, r'$w(x)=0.5 - 0.5cos2πx$', color='red')
plt.axis((0, N, 0, 1))
plt.subplot(233)
plt.plot(bartlett)
plt.title("バートレット窓")
plt.text(10, 0.5, r'$w(x)=1 - 2|x - 0.5|$', color='red')
plt.axis((0, N, 0, 1))
plt.plot(bartlett)
plt.title("バートレット窓")
plt.text(10, 0.5, r'$w(x)=1 - 2|x - 0.5|$', color='red')
plt.axis((0, N, 0, 1))
plt.subplot(234)
plt.plot(blackman)
plt.title("ブラックマン窓")
plt.text(10, 0.5, r'$w(x)=0.42 - 0.5cos2πx + 0.08cos4πx$', color='red')
plt.axis((0, N, 0, 1))
plt.plot(blackman)
plt.title("ブラックマン窓")
plt.text(10, 0.5, r'$w(x)=0.42 - 0.5cos2πx + 0.08cos4πx$', color='red')
plt.axis((0, N, 0, 1))
plt.subplot(235)
plt.plot(kaiser)
plt.title("カイザー窓")
plt.text(10, 0.5, r'$w(x)=I_0{πα√(1 - (2x - 1)^2)} / I_0(πα)$', color='red')
plt.axis((0, N, 0, 1))
plt.plot(kaiser)
plt.title("カイザー窓")
plt.text(10, 0.5, r'$w(x)=I_0{πα√(1 - (2x - 1)^2)} / I_0(πα)$', color='red')
plt.axis((0, N, 0, 1))
plt.subplots_adjust(wspace=0.5, hspace=0.5) # グラフ間の隙間調整
plt.show()
plt.show()
