Re-Initialize Array

DSP related issues, mathematics, processing and techniques
Post Reply
User avatar
aronb
Posts: 154
Joined: Sun Apr 17, 2011 3:08 am
Location: Florida, USA
Contact:

Re-Initialize Array

Post by aronb »

Hi,

I am trying to write a quick DSP function that needs to use an array. I can initialize the array to be the correct value (float buffer[256] = -0.99) like on page 242? Of the user manual, works fine. I use the array to find the maximum of a set of waves, just read the values into the array with an index. Again works fine.

Now...

I need to re-initialize the array back to a value of -0.99 after I have done this some number of times (in my case 5 times sometimes a few more or less).
I do not see a way to re-initialize the array back to a known number using the standard DSP commands. Think of it like “clear array”. I also tried the “loop(256) { ...(index through array, set to a number)... }” command and that works fine, but I cannot figure out how to only have “loop” work after some number of cycles.
Ideally it would take an external “reset” (streamin reset) and clear the array on command... but again see no way to do that.

So again, how can you re-initialize an array in a DSP program after the first time of initialization?

Thanks for any and all help,

Aron
User avatar
martinvicanek
Posts: 1334
Joined: Sat Jun 22, 2013 8:28 pm

Re: Re-Initialize Array

Post by martinvicanek »

You can't do that in DSP code, but you can do it in ASM. KG has a good ASM tutorial on the FS Guru site. ;)
Post Reply