関数sequence_SNratio マニュアル

(The documentation of function sequence_SNratio)

Last Update: 2025/7/23


◆機能・用途(Purpose)

時系列データのシグナル・ノイズ比(S/N比)を計算する。
Compute the signal-to-noise (S/N) ratio of a time series data.


◆形式(Format)

#include <sequence/operation.h>
inline struct sequence sequence_SNratio
(const struct sequence original,
 const double window_length_noise,const double window_length_signal)


◆引数(Arguments)

original 時系列データ。
A time series data.
window_length_noise ノイズレベルの計算に用いる時間窓の長さ(秒)。
The length (s) of a time window used to compute a noise level.
window_length_signal シグナルレベルの計算に用いる時間窓の長さ(秒)。
The length (s) of a time window used to compute a signal level.


◆戻り値(Return value)

各時刻においてその時刻の前window_length_noise秒間のRMS振幅をノイズレベル、 後window_length_signal秒間のRMS振幅をシグナルレベルとしたときの シグナル/ノイズ比を並べた時系列データ。
A time series data composed of the ratio of signal to noise levels at each time. Here, the signal and noise levels are computed using the window_length_signal s after and window_length_noise s before the time, respectively.


◆使用例(Example)

struct sequence data;
struct sequence SNratio=sequence_SNratio(data,100.0,5.0);


◆補足(Additional remarks)

時系列データの先頭のwindow_length_noise秒間、末尾のwindow_length_signal秒間については S/N比を定義できない。 そのため戻り値は引数originalで与えた時系列データよりも window_length_noise+window_length_signal秒だけ短い時系列データとなる。 また引数originalで与えた時系列データの長さが window_length_noise+window_length_signal秒よりも短い場合にはエラーとなる。
The S/N ratios cannot be defined for the first window_length_noise s and last window_length_signal s. Therefore, the length of the time series data of the return value is shorter by window_length_noise + window_length_signal s than that given by argument original. If the length of the time series data given by argument original is less than window_length_noise + window_length_signal s, the program finishes as an error.