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

NEW REGISTRATIONS - please contact us if you wish to register on the forum

Conditional selection

DSP related issues, mathematics, processing and techniques

Conditional selection

Postby juha_tp » Mon May 25, 2020 9:44 am

If one wants to stay with DSP code component, how to code conditional selection?

pseudo code:

Code: Select all
switch value
case (1, 3, 5, 7)
...
otherwise // 2, 4, 6, 8
...
end


Any examples out there?
juha_tp
 
Posts: 57
Joined: Fri Nov 09, 2018 10:37 pm

Re: Conditional selection

Postby adamszabo » Mon May 25, 2020 12:31 pm

I believe its only possible with assembler
adamszabo
 
Posts: 657
Joined: Sun Jul 11, 2010 7:21 am

Re: Conditional selection

Postby Spogg » Mon May 25, 2020 3:57 pm

Maybe this will help...

viewtopic.php?f=4&t=8731&hilit=bitmasking

Cheers

Spogg
User avatar
Spogg
 
Posts: 3323
Joined: Thu Nov 20, 2014 4:24 pm
Location: Birmingham, England

Re: Conditional selection

Postby juha_tp » Tue May 26, 2020 7:23 am

Spogg wrote:Maybe this will help...

viewtopic.php?f=4&t=8731&hilit=bitmasking

Cheers

Spogg


I did look that thread earlier but, could not find examples of usage since I need to make at least four operations (calculate coefficients using degree 3 polynomial equations) when the condition is true instead of just making one operation.

I guess "if" type statement could work if condition is checked for every coefficient calculation operation:

Code: Select all
if(x % 2 != 0) a0 = polynomial
if(x % 2 != 0) a1 = ...
if(x % 2 != 0) b0 = ...
if(x % 2 != 0) b1 = ...

if(x % 2 == 0) a0 = ...
...


Could this be possible ... ?
juha_tp
 
Posts: 57
Joined: Fri Nov 09, 2018 10:37 pm

Re: Conditional selection

Postby adamszabo » Tue May 26, 2020 11:47 am

That would use way too much cpu, since it still calculates all your equations even if they are not "enabled"
adamszabo
 
Posts: 657
Joined: Sun Jul 11, 2010 7:21 am

Re: Conditional selection

Postby tulamide » Wed May 27, 2020 12:09 am

First thing that came to my mind was cubic interpolation, but you wouldn't need any conditionals for that, and it seems to be code for a filter. Maybe if you elaborate on the topic? Maybe there is another way?

Simple example, if you're only interested in every second sample, you could use hop(2) and had no need for the conditionals anymore.
"There lies the dog buried" (German saying translated literally)
tulamide
 
Posts: 2687
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: Conditional selection

Postby wlangfor@uoguelph.ca » Wed May 27, 2020 8:41 pm

I'd love to know the answer to this as well.
My youtube channel: DSPplug
My Websites: www.dspplug.com KVRaudio flowstone products
User avatar
wlangfor@uoguelph.ca
 
Posts: 912
Joined: Tue Apr 03, 2018 5:50 pm
Location: North Bay, Ontario, Canada

Re: Conditional selection

Postby juha_tp » Wed May 27, 2020 9:26 pm

What I'm trying to do is a LR crossfeed plug-in without Ruby code. I'm using polynomials to calculate coefficients (in attached example I'm using BLT based implementation).

There's also something wrong with the LPF filter.

EDIT: attached the schematic
Attachments
Linkwitz-Riley Crossfeed_unfinished.fsm
(1.83 KiB) Downloaded 1192 times
Last edited by juha_tp on Sat Jun 06, 2020 5:45 am, edited 4 times in total.
juha_tp
 
Posts: 57
Joined: Fri Nov 09, 2018 10:37 pm

Re: Conditional selection

Postby adamszabo » Thu May 28, 2020 9:04 am

Its best if you post a schematic because we have no idea which filter you are using that is different from the left or right channel, these graphs dont really tell us anything
adamszabo
 
Posts: 657
Joined: Sun Jul 11, 2010 7:21 am

Re: Conditional selection

Postby juha_tp » Thu May 28, 2020 10:12 am

OK, updated my previous post with schematic.
juha_tp
 
Posts: 57
Joined: Fri Nov 09, 2018 10:37 pm

Next

Return to DSP

Who is online

Users browsing this forum: No registered users and 15 guests