Index: trunk/psLib/src/fft/Makefile.am
===================================================================
--- trunk/psLib/src/fft/Makefile.am	(revision 18955)
+++ trunk/psLib/src/fft/Makefile.am	(revision 18956)
@@ -5,4 +5,5 @@
 libpslibfft_la_CPPFLAGS = $(SRCINC) $(PSLIB_CFLAGS) $(FFTW3_CFLAGS)
 libpslibfft_la_SOURCES = \
+	psFFT.c \
 	psImageFFT.c \
 	psVectorFFT.c
@@ -11,4 +12,5 @@
 
 pkginclude_HEADERS = \
+	psFFT.h \
 	psVectorFFT.h \
 	psImageFFT.h
Index: trunk/psLib/src/fft/psFFT.c
===================================================================
--- trunk/psLib/src/fft/psFFT.c	(revision 18956)
+++ trunk/psLib/src/fft/psFFT.c	(revision 18956)
@@ -0,0 +1,31 @@
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <fftw3.h>
+
+#include "psAssert.h"
+#include "psLogMsg.h"
+#include "psFFT.h"
+
+static int numThreads = 0;          // Number of threads to use with FFTW
+
+bool psFFTThreads(int threads)
+{
+    PS_ASSERT_INT_NONNEGATIVE(threads, false);
+#ifdef HAVE_FFTW_THREADS
+    if (threads > 0) {
+        if (numThreads == 0) {
+            fftwf_init_threads();
+        }
+        fftwf_plan_with_nthreads(threads);
+    } else {
+        fftwf_cleanup_threads();
+    }
+    numThreads = threads;
+    return true;
+#else
+    psWarning("No thread support for FFTW.");
+    return false;
+#endif
+}
Index: trunk/psLib/src/fft/psFFT.h
===================================================================
--- trunk/psLib/src/fft/psFFT.h	(revision 18956)
+++ trunk/psLib/src/fft/psFFT.h	(revision 18956)
@@ -0,0 +1,10 @@
+#ifndef PS_FFT_H
+#define PS_FFT_H
+
+/// Set number of threads to use with all FFTs
+///
+/// Pass zero to turn off threading
+bool psFFTThreads(int threads           // Number of threads
+    );
+
+#endif
