FAQ
FAMOS
シーケンス / 関数top
└スペクトラムキット&周波数解析関係
ID.p007
Q. 定幅トラッキング分析
A.
回転数に回転パルスを入力した場合のトラッキング分析のサンプルシーケンスを示します。



_REV = REV
_DATA = acc
;------------------------------
;エンジンパルスを検索します。
;------------------------------
_res = SearchLevel( _REV, 2, 0, 0, 2, 1, 0, 1)
;回転パルスを検出できない場合、シーケンス終了
_num = Leng?(_res.X)
If _num=0
_Ret = BoxMessage("警告", "回転パルスを検出できませんでした", "!1")
del _*
ExitSequence
End
;------------------------------
;回転数を計算します。
;------------------------------
_res1 = CutIndex( _res.X, 1, _num-1)
_res2 = CutIndex( _res.X, 2, _num)
_DiffTime = _Res2-_Res1
_res.Y =
_DiffTime
_res[_num].Y = _res[_num-1].Y
;------------------------------
;定幅FFT解析
;------------------------------
_WindowWidth = 256
_Result3D =
AmpSpectrumRMS( _DATA, _WindowWidth, 2, 0, 1, 0)
;------------------------------
;
トラッキングデータの取得
;------------------------------
_BlockTime = _WindowWidth * XDel?( _DATA)
_Order = BoxValue?("取得したい次数を入力してください",1,0)
_SegNum = Leng?( _Result3D)/SegLen?(_Result3D)
_ResultTrack = XYof( Leng( 0, _SegNum), Leng( 0, _SegNum))
_i=1
While _i<=_SegNum
_ResultTrack.X = ReplIndex( _ResultTrack.X, 60*1/Value( res,
_BlockTime*(_i-1)), _i)
_Value = Value( _Result3D[_i], _ResultTrack[_i].X/60*_Order)
_ResultTrack.Y = ReplIndex( _ResultTrack.Y, _Value, _i)
_i=_i+1
End
XUnit _ResultTrack rpm
;------------------------------
;結果の保存
;------------------------------
ResultTrack=_ResultTrack ;次数データ(回転数 vs. 次数データ)
Result3D = _Result3D ;3D FFT結果
show ResultTrack
show Result3D
_Ret = BoxMessage("注意", "Result3Dはウォーターフォール表示に
してください","!1")
del _*