How can I storage data in simulink to use it as one set of data?

3 vues (au cours des 30 derniers jours)
Ali Hadelli
Ali Hadelli le 26 Fév 2023
Commenté : Ali Hadelli le 6 Mar 2023
Hey guys,
I'm very familiar with Matlab but new to simulink. Beside the simulink onramp I havent done something practical by my own yet. So I have a very general question for which i couldnt find an answer.
For my model, I load variables from workspace into constant blocks in simulink as an input. The constants are column vectors that contain for instance 300 stemps of acceleration data. I calculate a few basic mathematical operations row by row and thats works fine.
But now I want to do a FFT in simulink. And for that I have to put the whole vector into the fft-function block to do the fft. How do I do this? Because simulinks reads the row of the vectors sequentially and does a fft for each row, which makes no sense. I need a block, that saves/storages/buffers (you name it) the rows of the vector, so that I can use the whole vector for the fft in one step.
I hope I explained my problem comprehensibly.

Réponse acceptée

Swaraj
Swaraj le 6 Mar 2023
To perform an FFT on the entire vector in one step in Simulink, you can use the Buffer block to store the entire vector and then feed it into the FFT block.
Set the Output Buffer Size parameter as per the requirement.
The Buffer block always performs frame-based processing. The block redistributes the data in each column of the input to produce an output with a different frame size. Buffering a signal to a larger frame size yields an output with a slower frame rate than the input.
See below link for details.

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by