How to get real-time live data stream from sensor and spectral analysis?

3 ビュー (過去 30 日間)
Zarin
Zarin 2019 年 7 月 23 日
編集済み: Zarin 2019 年 7 月 27 日
I would like to get the real-time live data stream via a serial port (by fread) from sensor and then I want to evaluate the data for fft analysis. Currently, I am doing it by a "for loop" and for each iteration in the "for loop", I am always losing some real-time live data in the fread due to process it in the fft.
So, could you please suggest me that how can I overcome this issue without discard any data due to processing time in the fft? --Is it possible to solve this issue by matlab script or any alternative way like simulink model or data acquisition toolbox or ...? I am looking forward to hearing from you in details.
Thanks in advance.

回答 (2 件)

Andrey Kiselnikov
Andrey Kiselnikov 2019 年 7 月 24 日
Hi, fft is already multithreaded in MATLAB since 2008a
For more productive using of parallel computing, there is parallel computing toolbox https://se.mathworks.com/products/parallel-computing.html
Anyway, I assume that problem somewhere in the architecture of your system, I need more information to help you.
  1 件のコメント
Zarin
Zarin 2019 年 7 月 25 日
編集済み: Zarin 2019 年 7 月 27 日
Hi,
Thanks for your time and fruitful information regarding this issue that fft works for multithread and there is also parallel computing toolbox. But what's about fread getting real-time live data continously and data processing, I meant that without losing any live data due to processing delay in the fft? Do you have some idea how to get it?

サインインしてコメントする。


Andrey Kiselnikov
Andrey Kiselnikov 2019 年 7 月 27 日
Try to read about function "drawnow" may be in will be helpful. https://www.mathworks.com/help/matlab/ref/drawnow.html

カテゴリ

Help Center および File ExchangeScopes and Data Logging についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by