Support

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

Buffers

DSP related issues, mathematics, processing and techniques

Buffers

Postby Rocko » Tue Jan 12, 2016 1:33 pm

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?

Code: Select all
monoin in;
monoout out;

float buffer[2];


out = buffer[0];

buffer[0] = buffer[1];

buffer[1] = in ;


Thanks
Rocko
 
Posts: 179
Joined: Tue May 15, 2012 12:42 pm

Re: Buffers

Postby martinvicanek » Tue Jan 12, 2016 11:15 pm

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):
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.
User avatar
martinvicanek
 
Posts: 1081
Joined: Sat Jun 22, 2013 8:28 pm

Re: Buffers

Postby Rocko » Wed Jan 13, 2016 9:54 am

Thanks Martin - appreciated !!
Rocko
 
Posts: 179
Joined: Tue May 15, 2012 12:42 pm


Return to DSP

Who is online

Users browsing this forum: No registered users and 10 guests

cron