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

How to calculate digital roots in DSP?

DSP related issues, mathematics, processing and techniques

How to calculate digital roots in DSP?

Postby guyman » Mon Apr 02, 2018 7:38 pm

I'd like to learn about modular iterations and operations in dsp code. wiki on subject > https://en.wikipedia.org/wiki/Digital_root

example..

dr(45) = 9
4+5 = 9

or

dr(1618) = 16
1 + 6 + 1 + 8 = 16

or to further reduce to one digit

1 + 6 = 7

how do we perform these modular operations in DSP code?

streamin x;
streamout out;
float y;
y = dr(x);
out = y;
User avatar
guyman
 
Posts: 167
Joined: Fri Mar 02, 2018 8:27 pm

Re: How to calculate digital roots in DSP?

Postby martinvicanek » Tue Apr 03, 2018 10:14 am

Code: Select all
streamin n;
streamout dr;
dr = 1 + (n - 1)%9;
User avatar
martinvicanek
 
Posts: 1003
Joined: Sat Jun 22, 2013 8:28 pm


Return to DSP

Who is online

Users browsing this forum: No registered users and 1 guest