フィルターのクリア

How to convert a square wave to frequency domain in Matlab or simulink

5 ビュー (過去 30 日間)
yingcheng zan
yingcheng zan 2020 年 6 月 25 日
コメント済み: yingcheng zan 2020 年 7 月 9 日
Hi all,
I am so grateful, if you can give me some hints and advice for this issue.
I read a analog signal from my Arduino which is a square wave signal. I would like to obtain the frequency of this signal to do further control work. However, I do not know how to obtain it.
(1) I found some models with FFT function in simulink, but the input signal is DSP sine wave signal in these models. If I replace the input signal (DSP sine wave) with the square wave obtained from Arduino, these models will not work.
(2) If I do it in Matlab rather than Simulink, which fuction is valid in this case? And how can I convert the continuous signal in to frequency domain (or just get the value of the frequency) in Matlab?

採用された回答

Shivam Kumar Singh
Shivam Kumar Singh 2020 年 7 月 5 日
You can use fft() function in Matlab.
  1 件のコメント
yingcheng zan
yingcheng zan 2020 年 7 月 9 日
Thank you so much! I already tried this function, and it's very useful.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeTransforms についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by