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

Stream FFT and iFFT

DSP related issues, mathematics, processing and techniques

Re: Stream FFT and iFFT

Postby trogluddite » Wed Jun 19, 2013 7:08 pm

Cheers Tronic - that looks very useful. :D
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: 1522
Joined: Fri Oct 22, 2010 12:46 am
Location: Yorkshire, UK

Re: Stream FFT and iFFT

Postby MyCo » Wed Jun 19, 2013 7:16 pm

I had a go at the code. After I descrambled it :mrgreen:

I just replaced the inner loop with a real SSE. It basically calculates the real and the imaginary part simultanously. This reduced the CPU usage down to 1/3 !!!

I guess this can be improved a lot more. Especially the bit reordering part can get reduced. As it is a fixed FFT, you could save the reordering pattern in stage 0 into an array and when a sample comes in, you put it to the right spot using this array.
Attachments
Stream FFT v001 Build 8 +MyCo.fsm
(157.23 KiB) Downloaded 567 times
User avatar
MyCo
 
Posts: 758
Joined: Tue Jul 13, 2010 12:33 pm
Location: Germany

Re: Stream FFT and iFFT

Postby MyCo » Wed Jun 19, 2013 11:15 pm

I've done a little bit more cleaning. The main FFT processing part is now ready for variable FFT sizes.
Attachments
Stream FFT v2 (trogluddite, MyCo).fsm
(156.61 KiB) Downloaded 582 times
User avatar
MyCo
 
Posts: 758
Joined: Tue Jul 13, 2010 12:33 pm
Location: Germany

Re: Stream FFT and iFFT

Postby MyCo » Thu Jun 20, 2013 3:56 am

Done!

This is now a flexible version, it has no hard code FFT Size anymore... although I haven't tested it yet. For absoulte flexibility, we have to move some code from stage0 into stage1, haven't done this yet.

I've also changed the bit reversal method. Instead of rearranging the buffer once, it does it every sample now. This doesn't make a huge difference on large audio buffer sizes. But when the buffer is smaller then the FFT size, this should give a performance boost.

I've removed the sine table creation stuff. Instead it uses the wavetable that FS already has. Saves a little bit memory... the performance isn't better.
Attachments
Stream FFT v3 (trogluddite, MyCo).fsm
(153.76 KiB) Downloaded 606 times
User avatar
MyCo
 
Posts: 758
Joined: Tue Jul 13, 2010 12:33 pm
Location: Germany

Re: Stream FFT and iFFT

Postby trogluddite » Thu Jun 20, 2013 8:49 am

Wow, MyCo, you really hit the turbo fuel-injection there - even my little Atom netbook now runs it at sensible CPU loads!
Fantastic work, many thanks! :D
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: 1522
Joined: Fri Oct 22, 2010 12:46 am
Location: Yorkshire, UK

Re: Stream FFT and iFFT

Postby MyCo » Thu Jun 20, 2013 3:40 pm

Would be cool to benchmark this code against pure C/C++ code. It's surely not the fastest code around, but I think it beats pure C/C++ versions.
User avatar
MyCo
 
Posts: 758
Joined: Tue Jul 13, 2010 12:33 pm
Location: Germany

Re: Stream FFT and iFFT

Postby tester » Thu Jun 20, 2013 7:04 pm

v3 is around 2x slower than v2, is this correct? (looks like on my both C2D)
Need to take a break? Looking for relaxing sounds? I have something right for you.
(by purchasing, you are also supporting further development of related projects).
Thank you for your contribution.
tester
 
Posts: 1723
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

Re: Stream FFT and iFFT

Postby trogluddite » Thu Jun 20, 2013 7:16 pm

About 50% more for v2 on my systems - that tallies quite well with the results I got when I traded "one shot" for "continuous" bit-reversal, though that could just be a coincidence. A lot will depend on CPU cache size/performance, so results will likely vary quite a bit between systems. Still WAY faster than my original port, though!
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: 1522
Joined: Fri Oct 22, 2010 12:46 am
Location: Yorkshire, UK

Re: Stream FFT and iFFT

Postby digitalwhitebyte » Thu Jun 20, 2013 10:18 pm

great job guys.
is coming, a stable version of a MEMin and MEMout in ASM code.
finally found a way, without using any primitive hidden.
will post as soon as ready, I'm working on, testing it, to make it easily understandable and usable.
User avatar
digitalwhitebyte
 
Posts: 108
Joined: Sat Jul 31, 2010 10:20 am

Re: Stream FFT and iFFT

Postby MyCo » Fri Jun 21, 2013 1:13 am

trogluddite wrote:About 50% more for v2 on my systems - that tallies quite well with the results I got when I traded "one shot" for "continuous" bit-reversal, though that could just be a coincidence.


In v3 is the output connected to DirectSound, in v2 it is not. v3 is even without disconnection faster here. I have an my AMD, though.
User avatar
MyCo
 
Posts: 758
Joined: Tue Jul 13, 2010 12:33 pm
Location: Germany

PreviousNext

Return to DSP

Who is online

Users browsing this forum: No registered users and 6 guests

cron