[Sc-devel] FFT ugen using FFTW
Joshua Parmenter
josh at realizedsound.net
Mon Jul 30 12:09:14 PDT 2007
Wow... very cool Dan. I'll build it and test it this afternoon, and
think this is a great discussion to have on the list (personally).
So... does this remove the need to use powers of 2 in the buffer?
Best,
Josh
On Jul 30, 2007, at 10:32 AM, Dan Stowell wrote:
> Dear all,
>
> Attached is code for an "FFTW" ugen, which is essentially the FFT ugen
> rewritten to use the fftw library. I've written this as a new ugen
> rather than a patch to the core ugen, but **only as a temporary
> measure** - primarily to facilitate comparison. As has been discussed,
> FFT stuff should be a dev discussion topic at symposium, and this is
> some food for thought.
>
> This is a compatibility-oriented rewrite but also generalises the ugen
> slightly to allow different amounts of overlap and different types of
> window function. The output data format, buffer requirements, etc, are
> the same as for FFT() so it should behave in exactly the same way -
> you can use it with PV ugens followed by IFFT.
>
> The generalisations mean that one or two of the optimisation tricks
> from the original ugen are removed. Despite this, the CPU efficiency
> of this ugen is comparable or better, in my tests.
>
> One route could be that this becomes the replacement for the FFT ugen
> in the core distro, if it is felt to be advantageous. I'm not planning
> to do anything like that before those symposium discussions (unless
> there's real strong consensus on the mailing list :). But in the
> long-term I don't particularly want to maintain a separate FFTW ugen.
>
> To compile it you need the single-precision version of FFTW. In Xcode,
> you just need to add libfftw3f.a to the target.
>
> Efficiency comparisons: I run 100 of each ugen (code is in the
> helpfile) and watch the CPU usage in Activity Monitor, and these are
> my results:
>
> PPC G4 Mac PowerBook, 1.67 GHz:
> Idle: 2.9 %
> FFT: 48.5 %
> FFTW: 50.1 %
>
> Intel Core 2 Duo iMac, 2 GHz:
> Idle: 2.6 %
> FFT: 31.5 %
> FFTW: 23.2 %
>
> I'd appreciate reports of tests on other systems, and other feedback
> too of course.
>
> Dan
>
> --
> http://
> www.mcld.co.uk<fftw_ugen.zip>_________________________________________
> ______
> Sc-devel mailing list
> Sc-devel at create.ucsb.edu
> http://www.create.ucsb.edu/mailman/listinfo/sc-devel
******************************************
Joshua D. Parmenter
http://www.realizedsound.net/josh/
“Every composer – at all times and in all cases – gives his own
interpretation of how modern society is structured: whether actively
or passively, consciously or unconsciously, he makes choices in this
regard. He may be conservative or he may subject himself to continual
renewal; or he may strive for a revolutionary, historical or social
palingenesis." - Luigi Nono
More information about the Sc-devel
mailing list