RMS Analysis on BIN File in Simulink

1 visualizzazione (ultimi 30 giorni)
Najla
Najla il 22 Ago 2024
Risposto: Sahas il 23 Ago 2024
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?

Risposte (1)

Sahas
Sahas il 23 Ago 2024
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!

Categorie

Scopri di più su Interactive Model Editing in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by