関数create_timefunc_smoothRandom マニュアル

(The documentation of function create_timefunc_smoothRandom)

Last Update: 2024/12/13


◆機能・用途(Purpose)

値が乱数の時系列データ(平滑化したもの)を作成する。 エラーチェック機能が不十分なのでこの関数を直接用いてはならない。 この関数は関数create_timefuncからの内部呼び出し用である。
Create a time series data composed of random values (smoothed). Do not directly call this function because error checks are insufficient. This function is for an internal call from function create_timefunc.


◆時間関数の定義 (Definition of the time function)

概要(Overview)
正規分布に従う乱数を値にもつ時系列データに対して平滑化処理を施すことで 差分法などの数値シミュレーションに利用しやすくした関数である。
A time series data composed of the values of random variables that obey a normal distribution, smoothed for use in numerical simulations (e.g., a finite-difference method).


定義(Definition)
以下の手順で作成した時系列データである。
A time series data created by the following procedures.

  1. 関数random_sequence を用いて正規分布(平均値:0、標準偏差:1)に従う乱数から成る時系列データを生成する。
    A time series data composed of the values of random variables that obey a normal distribution (average: 0, standard deviation: 1), created by function random_sequence.

  2. コーナー周波数が\(1/\tau_p\)のローパスフィルター (ゼロ位相、Butterworth型、極の数:4)を掛ける ( 関数sequence_lowpassall_zerophase使用)。
    Apply a low-pass filter (zero-phase, Butterworth type, four poles) with a corner frequency of \(1/\tau_p\) using function sequence_lowpassall_zerophase.

  3. 先頭・末尾に長さ\(\tau_s\)のコサインテーパーを掛ける (関数taper_cos_before, taper_cos_after使用)。
    Apply a cosine taper of length \(\tau_s\) at the beginning and end part of the time series data using functions taper_cos_before and taper_cos_after.

ローパスフィルターとコサインテーパーの目的は時系列データを滑らかにすることである。 この関数で生成する時系列データは 差分法を用いた地震波動場の数値シミュレーションへの利用を想定しており、 高周波の振動や先頭・末尾部のステップは数値不安定の原因となるため、 ローパスフィルターとコサインテーパーによってこれらを抑制する。
The purpose of the low-pass filter and cosine taper is to smooth the time series data, as it is supposed to be used for a numerical simulation of seismic wave field by a finite difference method. High-frequency oscillations and steps at the beginning and end of the data result in numerical instability in the simulation. The low-pass filter and cosine taper are used to suppress the instability.


◆形式(Format)

#include <sequence/timefunc.h>
inline struct sequence create_timefunc_smoothRandom
(const double tp,const double ts,const int size,const double t0,
 const double dt,const int Nintegral)


◆引数(Arguments)

tp 関数の定義における\(\tau_p\)の値。 ローパスフィルターのコーナー周波数の逆数である。
The value of \(\tau_p\) in the definition of the function; the inverse of the corner frequency of a low-pass filter.
ts 関数の定義における\(\tau_s\)の値。 コサインテーパーの長さである。
The value of \(\tau_s\) in the definition of the function; the length of a cosine taper.
size 作成する時系列データのサンプル数。
The number of samples of the time series data to create.
t0 作成する時系列データの先頭時刻。
The beginning time of the time series data to create.
dt 作成する時系列データのサンプリング間隔。
The sampling interval of the time series data to create.
Nintegral 積分回数。以下の4つの値のいずれかを指定する。
The number of integrals, which must be one of the followings.
\(-1\) 時間関数の微分形を作成する。数値微分とし、 関数sequence_differentiate を用いる。
Create the differential form of the time function. The differentiation is performed numerically using function sequence_differentiate.
0 時間関数そのものを作成する。
Create the time function itself.
1 時間関数の1階積分形を作成する。数値積分とし、 関数sequence_integral を用いる。
Create the 1st order integral form of the time function. The integration is performed numerically using function sequence_integral.
2 時間関数の2階積分形を作成する。数値積分とし、 関数sequence_integral を用いる。
Create the 2nd order integral form of the time function. The integration is performed numerically using function sequence_integral.


◆戻り値(Return value)

作成した時系列データ。
The time series data created.


◆使用例(Example)

struct sequence timefunc=create_timefunc_smoothRandom (5.0,10.0,10001,-2.0,0.01,0);