Azzera filtri
Azzera filtri

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

1 visualizzazione (ultimi 30 giorni)
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.

Risposta accettata

Swaraj
Swaraj il 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.

Più risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by