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

Ruby Complex FFT CPU speed

DSP related issues, mathematics, processing and techniques

Ruby Complex FFT CPU speed

Postby chackl » Fri Jan 17, 2020 1:13 pm

Hi!

The last days i made some tests about doing FFTs and iFFTs in ruby.

I've tested those FFT codes in ruby:
https://github.com/CompScienceClub/ruby-fft
https://rosettacode.org/wiki/Fast_Fouri ... sform#Ruby
http://www.gregfjohnson.com/fftruby/

All seem pretty to be the same - the fist is a little faster because it creates a storage-map
Both are also reversible - so calculating an iFFT brings up most the original signal.

BUT:
If i run the for example for rate 44100 as a buffer of 512 signals (so i need to do 44100/512 FFTs) results in taking about 3-4 seconds for 1 second of a signal (mono).

So i found this here (Something that i've seen impossible in SynthMaker times):
viewtopic.php?f=4&t=1510&start=0
And this thing is pretty fast :)

So just a question to the ruby-freaks here if there is a better code for ruby?

The goal is to read a wav-file in ruby, do some fft operations and write it to another wav-file. This already worked but with speeds that are quite sad.
(As i multithreaded the script it is just for testing proposes loaded in FlowStone)

kind regards, chackl
100% accuracy is the guarantee to your success. The value alters if you combine it with musical creativity.
User avatar
chackl
 
Posts: 233
Joined: Tue Aug 17, 2010 8:46 pm
Location: Austria / Salzburg

Re: Ruby Complex FFT CPU speed

Postby martinvicanek » Fri Jan 17, 2020 1:46 pm

This may be related to your project
viewtopic.php?f=2&t=3972&p=22927&hilit=Clone#p22958
Fft of an entire track, performance is acceptable.
User avatar
martinvicanek
 
Posts: 1318
Joined: Sat Jun 22, 2013 8:28 pm

Re: Ruby Complex FFT CPU speed

Postby trogluddite » Fri Jan 17, 2020 4:35 pm

I doubt that the Ruby could be made to run much faster; it's just inherent in Ruby being an interpreted language that it can't process such huge chunks of data at "real-time" like speeds. I could be done using a Ruby C-extension (i.e. C++ code using the Ruby API to create a new Ruby "primitive"), but if you were going to do that, the FS DLL component might be the easier route.

The main issue with the ASM FFT that you linked to is that it's designed to work in real-time from a stream rather than off-line. I think that the code could possibly be adapted to work off-line by using Ruby Frames created from your file reader (the code essentially makes its own equivalent of Frames internally) - but that might need some help from MyCo, as he upgraded my original FFT ASM code in some very clever ways that I'm not sure I quite understand! Unless MV's solution already works for what you need, of course.
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
User avatar
trogluddite
 
Posts: 1730
Joined: Fri Oct 22, 2010 12:46 am
Location: Yorkshire, UK

Re: Ruby Complex FFT CPU speed

Postby chackl » Fri Jan 17, 2020 7:49 pm

Hi!

Thanks.
In the link there is now this code:
https://blog.mro.name/2011/04/simple-ru ... transform/

I just implimented it at it realy runs much faster than the rosetta-code FFT.

The problem is that i realy do not understand asm in any case if i have no debugger that is able to do step by step.

This code fits my needs for the moment.
100% accuracy is the guarantee to your success. The value alters if you combine it with musical creativity.
User avatar
chackl
 
Posts: 233
Joined: Tue Aug 17, 2010 8:46 pm
Location: Austria / Salzburg


Return to DSP

Who is online

Users browsing this forum: No registered users and 10 guests