This question is closed. Reopen it to edit or answer.

How to feed a variable back into a While Iterator Block in Simulink?

1 view (last 30 days)
Sriram Padavettan
Sriram Padavettan on 29 Jul 2020
Closed: MATLAB Answer Bot on 20 Aug 2021
I'm new to Simulink and need to implement a while loop to accomplish a task. This while loop should basically add to a matrix that functions as an accumulator. I'm not sure how to feed that accumulator array back to the while loop such that it repeatedly adds to it. Below is the pseudocode for the loop I am trying to implement. It basically:
BEFORE LOOP: initialize empty 1024x1 sample buffer, 1x13 result matrix
*************LOOP STARTS****************
  • Reads 512 Audio samples
If first iteration, fill first half of sample buffer with 512 read samples
If second iteration, fill second half of sample buffer with 512 read samples
If any subsequent iteration, slide second half of sample buffer to first half and fill the second half with 512 read samples
  • Perform an STFT on the size 1024 buffer of samples, then calculate 13 MFCC's from that STFT (this results in a 1x13 matrix)
  • add this 1x13 matrix to the 1x13 result array
**********LOOP ENDS****************
AFTER LOOP: Divide result array by 280
Heres the same pseudocode written in a text editor if it makes it easier to understand:
This loop should execute for 280 iterations. Can anyone help me figure out how to implement it?

Answers (0)

Community Treasure Hunt

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

Start Hunting!

Translated by