李寧,秦樹人,吳瑩
(重慶大學(xué)測試中心,重慶 400044)
摘要:在信號采集和處理過程中,Visual C++存在數(shù)據(jù)處理和結(jié)果顯示方面的不足,Matlab存在可視化和數(shù)據(jù)采集方面的不足,本文在Visual C++環(huán)境下調(diào)用Matlab Engine函數(shù),有效地解決了這兩方面的問題;采用多線程編程技術(shù),同時(shí)采集和顯示信號,有效地防止了采樣過程中的掉點(diǎn)。利用本方法對UA302型采集卡采集到的信號進(jìn)行處理,得到了滿意的結(jié)果。
關(guān)鍵詞:Visual C++;Matlab Engine;多線程技術(shù);UA302采集卡
中圖分類號:TP311.5文獻(xiàn)標(biāo)識碼:A文章編號:1672-4984(2006)03-0082-04
Singal sampling and processing based on mixed programming with multi-thread VC++ and Matlab
LI Ning,QIN Shu-ren,WU Ying
(Test Center, Chongqing University,Chongqing 400044,China)
Abstract:In signal sampling and processing system, VC shows inefficiency in data procession and results demonstration, while Matlab shows its inefficiency in virtualization and data acquisition. This paper showed a mixed programming used by invoking the Matlab engine in VC environment could solve two problems effectively. Multi-thread technology was developed to realize the synchronization of signal sampling and demonstration and prevented the signal gathering from missing sample spots. An example of a sine wave acquired from UA302 using this technique was also introduced in the paper, which has been proved to be feasible in practice.
Key words:Visual C++;Matlab engine; Multi-thread technology; UA302