If you have a problem or need to report a bug please email : support@dsprobotics.com
There are 3 sections to this support area:
DOWNLOADS: access to product manuals, support files and drivers
HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects
USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here
NEW REGISTRATIONS - please contact us if you wish to register on the forum
Users are reminded of the forum rules they sign up to which prohibits any activity that violates any laws including posting material covered by copyright
Buffers
3 posts
• Page 1 of 1
Buffers
Hi all,
I'm trying to run a simple buffer, using arrays ('DSP code module'), without success.
It seems like a simple syntax issue... Could you help?
What am I doing wrong?
Thanks
I'm trying to run a simple buffer, using arrays ('DSP code module'), without success.
It seems like a simple syntax issue... Could you help?
What am I doing wrong?
- Code: Select all
monoin in;
monoout out;
float buffer[2];
out = buffer[0];
buffer[0] = buffer[1];
buffer[1] = in ;
Thanks
- Rocko
- Posts: 186
- Joined: Tue May 15, 2012 12:42 pm
Re: Buffers
That's a limitation of FS's array implementation: you can't use different array elements in one equation.
Your example would work with a termporary - uhm - buffer (temp variable):
But that's of course kinda pointless. When using arrays, you do not want to move the data like in a fire brigade. Look inside the stock delay, there is a ring buffer.
Your example would work with a termporary - uhm - buffer (temp variable):
- Code: Select all
monoin in;
monoout out;
float buffer[2];
float temp;
out = buffer[0];
temp = buffer[1];
buffer[0] = temp;
buffer[1] = in ;
But that's of course kinda pointless. When using arrays, you do not want to move the data like in a fire brigade. Look inside the stock delay, there is a ring buffer.
-
martinvicanek - Posts: 1328
- Joined: Sat Jun 22, 2013 8:28 pm
3 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 32 guests