関数sequence_signal_ratio マニュアル

(The documentation of function sequence_signal_ratio)

Last Update: 2025/8/1


◆機能・用途(Purpose)

時系列データの大振幅比率をMaeda et al. (2020)のアルゴリズムで計算する。
Compute large amplitude ratios of a time series data using the algorithm proposed by Maeda et al. (2020).


◆形式(Format)

#include <sequence/operation.h>
inline struct signal_ratio_data sequence_signal_ratio
(const struct sequence data,
 const double long_window_length,const double short_window_length,
 const int verbose,const _Bool remove_mean)


◆引数(Arguments)

data 入力時系列データ。
The input time series data.
long_window_length 長時間窓の長さ(s)。 入力時系列データのサンプリング間隔の整数倍、 かつ入力時系列データの長さの整数分の1 (1) でなければならない。
The length (s) of a long window. This value must be an integer multiple of the sampling interval and a divisor of the length of the input time series data. (1)
short_window_length 短時間窓の長さ(s)。 入力時系列データのサンプリング間隔の整数倍、 かつ長時間窓の長さの整数分の1 でなければならない。
The length (s) of a short window. This value must be an integer multiple of the sampling interval and a divisor of the length of a long window.
verbose 進行状況に関するメッセージ出力の選択。以下のいずれかとする。
Choice of messages of the progress to display, which must be one of the followings.

  • 0
    進行状況を表示しない。
    Do not display the progress.

  • 1
    1つの長時間窓の処理が終わるごとに進行状況を表示する。
    Display the progress whenever processings for each long window finish.

  • 2
    上記に加え、最適な\(N’\)の探索において \(N’\)に関するループが100ステップ進むごとに 進行状況を表示する。
    In addition to above, display the progress for each 100 steps of the loop with regard to \(N’\) during the search for the optimal \(N’\).

remove_mean 長時間窓の波形から平均値を差し引くか否かの選択。
A choice of whether to remove the mean from the waveform in each long window or not.

  1. 正確には時系列データの長さに1サンプルを加えた長さの整数分の1。 例えば2025/7/24 0時台の「1時間分のデータ」(100 Hzサンプリング)を扱う場合、 通常は01:00:00.00のデータは含まれない。 すなわち厳密には2025/07/24 00:00:00.00-00:59:59.99の3599.99 sのデータである。 しかし第2引数としては3600.00 sの整数分の1を与えれば良い (3599.99 sの整数分の1を与えてはならない)。 実際の処理時には長時間窓・短時間窓においても末尾の1サンプルは除かれる。 例えばlong_window_length=300.0とした場合、長時間窓は
    となってデータが等分される。
    Exactly, an integer multiple of the length of the input time series data added by a sample. For example, consider to treat a so-called “1-h data” starting from 00:00 on July 24, 2025, sampled at 100 Hz. This data usually does not include a sample at 01:00:00.00. Therefore, the exact length of the data is 3599.99 s from 00:00:00.00 to 00:59:59.99 on July 24, 2025. Nevertheless, the 2nd argument must be an integer multiple of 3600.00 s, not 3599.99 s. In the processing in this function, the last samples in long and short windows are also not used. For example, if long_window_length=300.0, then the long windows are as follows:
    • from 00:00:00.00 to 00:04:59.99 (not 00:05:00.00),
    • from 00:05:00.00 to 00:09:59.99,
    • from 00:10:00.00 to 00:14:59.99,
    • from 00:55:00.00 to 00:59:59.99
    on July 24, 2025. In this way, the data is divided into long windows of equal lengths.


◆戻り値(Return value)

引数dataで与えた時系列データを用いて計算した大振幅比率の時系列データと中間データ。 struct signal_ratio_data型構造体 の全てのメンバを計算する。
A time series data of large amplitude ratios and intermediate data computed using the time series data given by argument data; all members of a struct signal_ratio_data-type structure are computed.


◆使用例(Example)

struct sequence data=read_sequence_file("data.seq1");
struct signal_ratio_data signal_ratio =sequence_signal_ratio(data,300.0,1.0,1,true,true);


◆補足(Additional remarks)

大振幅比率の定義と計算方法については struct signal_ratio_data型構造体 または sacfile_get_signal_ratioコマンド のマニュアル参照。
For the definition and computation method of large amplitude ratios, see the documentation of a struct signal_ratio_data-type structure or sacfile_get_signal_ratio command.


◆引用文献 (References)

は本プログラムを用いた研究成果の発表時に必ず引用すべき論文を表す。
The star () indicates the references that must be cited whenever a research that used this program is published or presented.