8
6

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 5 years have passed since last update.

ノイズの時系列データの作り方

Last updated at Posted at 2019-11-25

数値検証をする場合のノイズの時系列データがしばしばベンチマークとして使われる。

pythonで時系列データを作る。

ホワイトノイズ

ホワイトノイズwiki

ガウス分布関数を利用して

sample.py
import numpy as np
import random 
import matplotlib.pyplot as plt

dlen = 1024 #ノイズデータのデータ長
mean = 0.0  #ノイズの平均値
std  = 1.0  #ノイズの分散

y = np.array( [random.gauss(mean, std) for i in range(dlen)] )

plt.plot(y)
plt.show()

又はnumpyのrandomを使って簡単に

sample.py
import numpy as np
import matplotlib.pyplot as plt

dlen = 1024 #ノイズデータのデータ長
mean = 0.0  #ノイズの平均値
std  = 1.0  #ノイズの分散

y = np.random.normal(mean,std,dlen)

plt.plot(y)
plt.show()

download.png

8
6
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
8
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?