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
Stream FFT and iFFT
Re: Stream FFT and iFFT
Cheers Tronic - that looks very useful.
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
Don't stagnate, mutate to create!
-
trogluddite - Posts: 1730
- Joined: Fri Oct 22, 2010 12:46 am
- Location: Yorkshire, UK
Re: Stream FFT and iFFT
I had a go at the code. After I descrambled it
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.
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 1410 times
-
MyCo - Posts: 718
- Joined: Tue Jul 13, 2010 12:33 pm
- Location: Germany
Re: Stream FFT and iFFT
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 1383 times
-
MyCo - Posts: 718
- Joined: Tue Jul 13, 2010 12:33 pm
- Location: Germany
Re: Stream FFT and iFFT
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.
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 1441 times
-
MyCo - Posts: 718
- Joined: Tue Jul 13, 2010 12:33 pm
- Location: Germany
Re: Stream FFT and iFFT
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!
Fantastic work, many thanks!
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
Don't stagnate, mutate to create!
-
trogluddite - Posts: 1730
- Joined: Fri Oct 22, 2010 12:46 am
- Location: Yorkshire, UK
Re: Stream FFT and iFFT
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.
-
MyCo - Posts: 718
- Joined: Tue Jul 13, 2010 12:33 pm
- Location: Germany
Re: Stream FFT and iFFT
v3 is around 2x slower than v2, is this correct? (looks like on my both C2D)
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
Feel free to donate. Thank you for your contribution.
- tester
- Posts: 1786
- Joined: Wed Jan 18, 2012 10:52 pm
- Location: Poland, internet
Re: Stream FFT and iFFT
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!
Don't stagnate, mutate to create!
-
trogluddite - Posts: 1730
- Joined: Fri Oct 22, 2010 12:46 am
- Location: Yorkshire, UK
Re: Stream FFT and iFFT
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.
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.
-
digitalwhitebyte - Posts: 106
- Joined: Sat Jul 31, 2010 10:20 am
Re: Stream FFT and iFFT
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.
-
MyCo - Posts: 718
- Joined: Tue Jul 13, 2010 12:33 pm
- Location: Germany
Who is online
Users browsing this forum: No registered users and 30 guests