訊號被進行各種運算時,訊號日期或時間絕大部分是時間間距固定 (regular),但是總有例外的情形,使用者需要將計算後結果以非等間距 ( Indexed )的展示。Convert To Indexed 可以將 regular 的訊號中時間點會依照另一個 Indexed 訊號的不等間距的時間點,重新組合成一個新的 Indexed 訊號。
參數設定(Properties)
本模組接受一個實數(Real number)、複數(Complex number),單通道(single channel)或多通道(multi-channel),regular 的訊號以及另一個實數(Real number)、複數(Complex number),單通道(single channel)或多通道(multi-channel),Indexed 的訊號;輸出訊號格式為實數、複數,單通道、多通道的Indexed訊號。
範例(Example)
先從 Yahoo Finance : Yahoo Finance Link 下載一筆 GE ( General Electrical Co. ) 2009-01-02 到 2009-12-09 的開盤價,另存 CSV 檔案,由於星期六、日或假期沒有開盤,所以暫且不將日期資料加入,利用 Text Importer 開啟檔案,Data Range / SpecifyTime Column 為 Unchecked 和 Columns: 2 to end,Date Axis/Auto 為 Unchecked,Time Coordinate / Time Unit為 day 以及 Sampling Frequency為 1,讓讀取進來訊號屬於 regular,時間單位為 day。最後連接至 Viewer / Channel Viewer 顯示。
再將 GE Source 連接至 Compute / Filter / Trend Estimator,Trend Estimator 的 Properties 中,Filte Type 為 HighPass,再從 Trend 接至 Viewer /Channel Viewer 顯示。
最後要將日期資訊取代現有的時間軸,將 regular 訊號轉成 Indexed 訊號,利用 Text Importer 再開啟 CSV 檔案,Data Range / Specify Time Column 為 Checked,和 Columns: 2 to end,讀取進來訊號屬於 Indexed,時間單位為 day。
最後將 Trend 運算結果連接 Conversion / Convert to Indexed,接下來將第二次讀取進來的 Source (GE2) 也連接至 Convert to Indexed,最後將 Convert to Indexed 連至 Viewer / Channel Viewer 展示,可以看見有日期的資訊出現在 X 軸。
也可以利用 Data Viewer檢視 Convert to Indexed 的訊號,訊號不會有星期六、日或假期的資料,訊號是一個 Indexed 格式的訊號。
相關指令
Open Data from File,Channel Viewer,Trend Estimator,Data Viewer。
Converted from CHM to HTML with chm2web Standard 2.85 (unicode) |