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

fast array resample in ruby?

For general discussion related FlowStone

fast array resample in ruby?

Postby tester » Mon Jun 13, 2016 2:36 pm

Can someone help with ruby code for fast array resample?

Actually downsample, so for example input is "44100 x time" samples long and destination should be "600 x time" samples long. Since this is calculated many times per shot, it would be good to speed it up a little.
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
tester
 
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

Re: fast array resample in ruby?

Postby TheOm » Mon Jun 13, 2016 3:09 pm

Why ruby? I doubt that you can get faster than the resample primitive with ruby. Maybe in ASM.
Also what kind of interpolation do you need?
TheOm
 
Posts: 103
Joined: Tue Jan 28, 2014 7:35 pm
Location: Germany

Re: fast array resample in ruby?

Postby tester » Mon Jun 13, 2016 5:40 pm

I'm doing a statistical analyzer of audio textures. The signal path is similar to what is in attached file, with the exception that everything goes through analyzer prims, to produce arrays, that go through statistical analysis...

Basically, the concept is this. Signals goes through c.a. 900 filters (32 main filters and 20 + 7 filters per main slot in second order). Each filter produces an envelope at maximum rate around 200-250Hz, each about 10 seconds long. These envelopes are stored to memory via mem prims. So there are about 900 envelopes, each SR*t samples long. At 44.1k or more - this would take a lot of memory, plus statistical module would have too much of unnecessary work.

After filtered samples are stored to memory, serialized multiplexer just brings appropriate mems (various combinations), converts them back to arrays, and arrays are pushed through statistics. The statistics are generally wired, but there are still some trigger and normalization issues to deal with, but it's a second part. Third step (not touched yet) is a simple neural network, that learns from gathered statistics and produces identification ranges... :mrgreen:

Anyway. What I need at this point is a good way to resample these arrays (portions of filtered streamy signals), and it's possible that it could go with additional LP filters combined with resampler, to avoid aliasing (I assumed, that current filtration may do a decent job, but not tested it yet). Simple linear interpolatio should be enough.

BTW, filters are not optimized yet, I just experimentally selected which ones will do probably good job in such small ranges.
Attachments
signalpath.fsm
(20.92 KiB) Downloaded 916 times
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
tester
 
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

Re: fast array resample in ruby?

Postby tester » Tue Jun 14, 2016 11:02 am

I think I found another way to deal with resample/downsample stuff.

Following schematic is an example. To downsample by factor x100 it would just require 100 such modules as inside.

//edit: solved
Attachments
testmem-resample.fsm
(2.16 KiB) Downloaded 822 times
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
tester
 
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet


Return to General

Who is online

Users browsing this forum: No registered users and 39 guests