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

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

Square root in code

DSP related issues, mathematics, processing and techniques

Square root in code

Postby flowstone » Thu Sep 02, 2010 10:10 am

Hi,

I'm a Flowstone novice trying to make an RMS voltmeter for the output of an audio processing stream. It would be fairly easy to do in code as the square root of the sum of the squares for an adjustable number of samples of the stream, but I don't see a square root function listed in the code expressions. Is there one? If not, how can I do it just in code?

Is there an alternative method using only the components? So far, I am trying to use mono to float from the output of an amplifier, then stack, square, square root. If that's right, all I need to do is trigger the mono to float block on every sample, but I don't see how to do that.

Thanks in advance for any advice and suggestions.
flowstone
 
Posts: 21
Joined: Fri Aug 27, 2010 10:53 pm

Re: Square root in code

Postby Exo » Thu Sep 02, 2010 3:38 pm

Hi Flowstone,

Your right there is no square root in the code component. But there is a square root command in the assembler component, you have to use that. I'm sure it will be implemented in code at some point.

Your method using components will not work because the triggers cannot be sent at sample rate. When working in 'green' the fastest anything can go is about 100hz using the ticker.

I've knocked up a quick example of how to do RMS in Flowstone. Sorry if I've just done it for you but it's easier for me to just do it than it is to try an explain it :D .

Cheers ;)

Exo
Attachments
RMS.fsm
(14.99 KiB) Downloaded 1845 times
Flowstone Guru. Blog and download site for Flowstone.
Best VST Plugins. Initial Audio.
Exo
 
Posts: 426
Joined: Wed Aug 04, 2010 8:58 pm
Location: UK

Re: Square root in code

Postby flowstone » Thu Sep 02, 2010 4:10 pm

Hi Exo,

That great! Thanks very much for your help! Can you recommend a good reference for assembler commands?

Clayton
flowstone
 
Posts: 21
Joined: Fri Aug 27, 2010 10:53 pm

Re: Square root in code

Postby Exo » Thu Sep 02, 2010 4:47 pm

Here's a list of the know supported ASM opcodes

Since Flowstone is based on synthmaker it's a good idea to check out the Synthmaker site and forum lots of useful info over there.

Cheers ;)

Exo
Flowstone Guru. Blog and download site for Flowstone.
Best VST Plugins. Initial Audio.
Exo
 
Posts: 426
Joined: Wed Aug 04, 2010 8:58 pm
Location: UK

Re: Square root in code

Postby admin » Wed Sep 08, 2010 2:15 pm

FYI: Square Root in now added to the list of funtions in the code compoent :)
User avatar
admin
Site Admin
 
Posts: 231
Joined: Tue May 11, 2010 6:30 pm


Return to DSP

Who is online

Users browsing this forum: No registered users and 56 guests