Index: src/fft.c
===================================================================
--- src/fft.c	(revision f8714ee0615e25a50d77668df664535665a46bf7)
+++ src/fft.c	(revision f88a3262187e339c5d65f07175fdc875bb4376c5)
@@ -78,4 +78,5 @@
 void del_aubio_fft(aubio_fft_t * s) {
 	aubio_fft_free(s);
+        AUBIO_FREE(s);
 }
 
@@ -111,2 +112,55 @@
 }
 
+
+/* new interface aubio_mfft */
+struct _aubio_mfft_t {
+        aubio_fft_t * fft;      /* fftw interface */
+        fft_data_t ** spec;     /* complex spectral data */
+        uint_t winsize;
+        uint_t channels;
+};
+
+aubio_mfft_t * new_aubio_mfft(uint_t winsize, uint_t channels){
+        uint_t i;
+	aubio_mfft_t * fft = AUBIO_NEW(aubio_mfft_t);
+	fft->winsize       = winsize;
+	fft->channels      = channels;
+	fft->fft           = new_aubio_fft(winsize);
+	fft->spec          = AUBIO_ARRAY(fft_data_t*,channels);
+        for (i=0; i < channels; i++)
+                fft->spec[i] = AUBIO_ARRAY(fft_data_t,winsize);
+        return fft;
+}
+
+/* execute stft */
+void aubio_mfft_do (aubio_mfft_t * fft,fvec_t * in,cvec_t * fftgrain){
+        uint_t i=0;
+        /* execute stft */
+        for (i=0; i < fft->channels; i++) {
+                aubio_fft_do (fft->fft,in->data[i],fft->spec[i],fft->winsize);
+                /* put norm and phase into fftgrain */
+                aubio_fft_getnorm(fftgrain->norm[i], fft->spec[i], fft->winsize/2+1);
+                aubio_fft_getphas(fftgrain->phas[i], fft->spec[i], fft->winsize/2+1);
+        }
+}
+
+/* execute inverse fourier transform */
+void aubio_mfft_rdo(aubio_mfft_t * fft,cvec_t * fftgrain, fvec_t * out){
+        uint_t i=0,j;
+        for (i=0; i < fft->channels; i++) {
+                for (j=0; j<fft->winsize/2+1; j++) {
+                        fft->spec[i][j]  = CEXPC(I*unwrap2pi(fftgrain->phas[i][j]));
+                        fft->spec[i][j] *= fftgrain->norm[i][j];
+                }
+                aubio_fft_rdo(fft->fft,fft->spec[i],out->data[i],fft->winsize);
+        }
+}
+
+void del_aubio_mfft(aubio_mfft_t * fft) {
+        uint_t i;
+        for (i=0; i < fft->channels; i++)
+                AUBIO_FREE(fft->spec[i]);
+        AUBIO_FREE(fft->spec);
+	aubio_fft_free(fft->fft);
+        AUBIO_FREE(fft);        
+}
Index: src/fft.h
===================================================================
--- src/fft.h	(revision f8714ee0615e25a50d77668df664535665a46bf7)
+++ src/fft.h	(revision f88a3262187e339c5d65f07175fdc875bb4376c5)
@@ -56,4 +56,12 @@
 void aubio_fft_getphas(smpl_t * phase, fft_data_t * spectrum, uint_t size);
 
+
+typedef struct _aubio_mfft_t aubio_mfft_t;
+aubio_mfft_t * new_aubio_mfft(uint_t winsize, uint_t channels);
+void aubio_mfft_do (aubio_mfft_t * fft,fvec_t * in,cvec_t * fftgrain);
+void aubio_mfft_rdo(aubio_mfft_t * fft,cvec_t * fftgrain, fvec_t * out);
+void del_aubio_mfft(aubio_mfft_t * fft);
+
+
 #ifdef __cplusplus
 }
Index: src/phasevoc.c
===================================================================
--- src/phasevoc.c	(revision f8714ee0615e25a50d77668df664535665a46bf7)
+++ src/phasevoc.c	(revision f88a3262187e339c5d65f07175fdc875bb4376c5)
@@ -33,11 +33,9 @@
 	uint_t channels;
 	/** spectral data */
-	aubio_fft_t * spectrum;
+	aubio_mfft_t * fft;
 	/**cur output grain 		[win_s] */
 	fvec_t * synth;		 
 	/**last input frame 		[win_s-hop_s] */
 	fvec_t * synthold; 
-	/**current spectrum 		[win_s] */
-	fft_data_t ** spec;
 	/**current input grain		[win_s] */
 	fvec_t * data;		 
@@ -49,8 +47,4 @@
 
 
-/** memory allocation */
-static aubio_pvoc_t * aubio_pvoc_malloc (uint_t win_s, uint_t hop_s, uint_t channels);
-/** object deletion */
-static void aubio_pvoc_free (aubio_pvoc_t *pv);
 /** returns data and dataold slided by hop_s */
 static void aubio_pvoc_swapbuffers(
@@ -75,23 +69,18 @@
 		/* windowing */
 		for (j=0; j<pv->win_s; j++) pv->data->data[i][j] *= pv->w[j];
-		/* fftshift */
-		vec_shift(pv->data);
-		/* calculate fft */
-		aubio_fft_do(pv->spectrum,pv->data->data[i],pv->spec[i],pv->win_s);
-		/* put norm and phase to fftgrain */
-		aubio_fft_getnorm(fftgrain->norm[i], pv->spec[i], pv->win_s/2+1);
-		aubio_fft_getphas(fftgrain->phas[i], pv->spec[i], pv->win_s/2+1);
-	}
+        }
+        /* shift */
+        vec_shift(pv->data);
+	/* calculate fft */
+        aubio_mfft_do (pv->fft,pv->data,fftgrain);
 }
 
 void aubio_pvoc_rdo(aubio_pvoc_t *pv,cvec_t * fftgrain, fvec_t * synthnew) {
 	uint_t i,j;
+	/* calculate rfft */
+        aubio_mfft_rdo(pv->fft,fftgrain,pv->synth);
+        /* unshift */
+        vec_shift(pv->synth);
 	for (i=0; i<pv->channels; i++) {
-		for (j=0; j<pv->win_s/2+1; j++) {
-			pv->spec[i][j]  = CEXPC(I*unwrap2pi(fftgrain->phas[i][j]));
-			pv->spec[i][j] *= fftgrain->norm[i][j];
-		}
-		aubio_fft_rdo(pv->spectrum,pv->spec[i],pv->synth->data[i],pv->win_s);
-		vec_shift(pv->synth);
 		for (j=0; j<pv->win_s; j++) pv->synth->data[i][j] *= pv->w[j];
 		aubio_pvoc_addsynth(pv->synth->data[i],pv->synthold->data[i],
@@ -100,30 +89,20 @@
 }
 
-void del_aubio_pvoc(aubio_pvoc_t *pv) {
-	aubio_pvoc_free(pv);
-}
-
 aubio_pvoc_t * new_aubio_pvoc (uint_t win_s, uint_t hop_s, uint_t channels) {
-	aubio_pvoc_t * pv = aubio_pvoc_malloc(win_s, hop_s, channels);
-	window(pv->w,pv->win_s,hanningz);
-	return pv;
-}
-
-static aubio_pvoc_t * aubio_pvoc_malloc (uint_t win_s, uint_t hop_s, uint_t channels) {
-	uint_t i;
-
 	aubio_pvoc_t * pv = AUBIO_NEW(aubio_pvoc_t);
 
 	if (win_s < 2*hop_s) {
-		AUBIO_ERR("Window size is smaller than twice the hop size!\n");
-		return 0;
+		AUBIO_ERR("Hop size bigger than half the window size!\n");
+		AUBIO_ERR("Resetting hop size to half the window size.\n");
+                hop_s = win_s / 2;
 	}
 
 	if (hop_s < 1) {
 		AUBIO_ERR("Hop size is smaller than 1!\n");
-		return 0;
+		AUBIO_ERR("Resetting hop size to half the window size.\n");
+                hop_s = win_s / 2;
 	}
 	
-	pv->spectrum = new_aubio_fft(win_s);
+	pv->fft      = new_aubio_mfft(win_s,channels);
 
 	/* remember old */
@@ -135,8 +114,5 @@
 	pv->synthold = new_fvec (win_s-hop_s, channels);
 	pv->w        = AUBIO_ARRAY(smpl_t,win_s);
-
-	pv->spec     = AUBIO_ARRAY(fft_data_t*,channels);
-	for (i=0; i<channels; i++) 
-		pv->spec[i] = AUBIO_ARRAY(fft_data_t,win_s);
+	window(pv->w,win_s,hanningz);
 
 	pv->channels = channels;
@@ -147,7 +123,5 @@
 }
 
-static void aubio_pvoc_free (aubio_pvoc_t *pv) {
-	uint_t i;
-	del_aubio_fft(pv->spectrum);
+void del_aubio_pvoc(aubio_pvoc_t *pv) {
 	del_fvec(pv->data);
 	del_fvec(pv->synth);
@@ -155,13 +129,9 @@
 	del_fvec(pv->synthold);
 	AUBIO_FREE(pv->w);
-	for (i=0; i< pv->channels; i++) {
-	        AUBIO_FREE(pv->spec[i]);
-	}
-	AUBIO_FREE(pv->spec);
 	AUBIO_FREE(pv);
 }
 
-static void aubio_pvoc_swapbuffers(smpl_t * data, smpl_t * dataold, const smpl_t * datanew, 
-		uint_t win_s, uint_t hop_s)
+static void aubio_pvoc_swapbuffers(smpl_t * data, smpl_t * dataold, 
+                const smpl_t * datanew, uint_t win_s, uint_t hop_s)
 {
 	uint_t i;
@@ -174,6 +144,6 @@
 }
 
-static void aubio_pvoc_addsynth(const smpl_t * synth, smpl_t * synthold, smpl_t * synthnew, 
-		uint_t win_s, uint_t hop_s)
+static void aubio_pvoc_addsynth(const smpl_t * synth, smpl_t * synthold, 
+                smpl_t * synthnew, uint_t win_s, uint_t hop_s)
 {
 	uint_t i;
