original | フィルターを掛ける前の時系列データ。 The original time series data before the filtering. |
fc | 使用する\(f_c\)の値[Hz]。
フィルターのコーナー周波数を表す。 The value of \(f_c\) used [Hz], which represents the corner frequency of the filter. |
n | 使用する\(n\)の値。
フィルターの極の数を表す。 The value of \(n\) used, which represents the number of poles of the filter. ゼロ位相のフィルターは最小位相のフィルターを 時間の順方向と逆方向に1回ずつ掛けることで実装する。 この関数ではその2回分を合わせた合計の極の数を\(n\)とおいているので、 \(n\)は偶数でなければならない。 また、この\(n\)の定義は Seismic Analysis Code (SAC) のゼロ位相フィルターで用いられる\(n\)の定義とは異なる点にも留意。 SACではゼロ位相フィルターの構成要素である最小位相フィルターの 1回あたりの極の数を指定する仕様になっており、 例えばSACの\(n=2\)はこの関数の\(n=4\)と同義である。 The zero-phase filter is implemented by applying a minimum phase filter along a normal order of time, and then a reversed order of time. The definition of \(n\) in this function is the total number of poles, i.e., the sum of the numbers of poles in the normal and reversed filters. Therefore \(n\) must be an even number. Also note that this definition of \(n\) is different from that in a zero-phase filter of Seismic Analysis Code (SAC); in SAC, the number of poles for each minimum phase filter is specified. For example, \(n=2\) in SAC is equivalent to \(n=4\) in this function. |
funcgen impulse delta 0.01 npts 10001 w input.sac |
r input.sac lp bu co 0.5 n 1 p 2 w lp0.5n2_SAC.sac |
#include <inc.h> int main(void) { struct sac_timeseq raw,filtered; raw=read_sac_timeseq("input.sac"); filtered.data=saito_butterworth_lp_zerophase(raw.data,0.5,2); filtered.header=copy_sac_header(raw.header); write_sac_timeseq("lp0.5n2_ymaeda_opentools.sac",filtered); return 0; } |
r lp0.5n2_SAC.sac lp0.5n2_ymaeda_opentools.sac qdp off color red increment on list red green width list 3 1 increment p2 |