RMS Analysis on BIN File in Simulink

1 回表示 (過去 30 日間)
Najla
Najla 2024 年 8 月 22 日
回答済み: Sahas 2024 年 8 月 23 日
I am trying to import a BIN file into Simulink and analyze it for RMS. I currently have the sine wave, RMS, and scope blocks, and I can generate a sample sine wave, but I have no way of importing my BIN files. They are large, and I attempted using the Binary File Reader block, and while it started creating a sine wave, it was taking too long to run. How do I make this process more efficient?

回答 (1 件)

Sahas
Sahas 2024 年 8 月 23 日
Hi @Najla,
To reduce the simulation time and make it more efficient, try out the following settings in the blocks and the model:
  • Increase the “sample time” to reduce the number of computations.
  • Use a “Fixed-Step Discrete Solver” that matches or is a multiple of the sample time of the model.
  • Increase the “step size” to reduce the number of solver iterations.
Refer to the following MathWorks documentation links for more information of the abovementioned steps:
Take help from the following example of “Writing and Reading Binary Files in Simulink” for detailed steps of performing reading and writing operations on binary files: https://www.mathworks.com/help/dsp/ug/write-and-read-binary-files-in-simulink.html
You can also utilize the "readData.slx" Simulink model of the example and add an “RMS” block inside it. Update the "File name" parameter in the "Binary File Reader" block to point to your “.bin” file and adjust other configuration settings as needed. Since this is a MathWorks documentation example model, it is already designed for optimal performance.
I hope this is beneficial!

カテゴリ

Help Center および File ExchangeInteractive Model Editing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by