#ifndef	V_FFT_H
#define	V_FFT_H

/*
 * Prototypes of the callback routines for FFT helper functions
 */
typedef vboolean (V_CALL *cplx_cart_transform_t)(void_p arg,
	u32_t row_freq,u32_t col_freq,
	vboolean neg_freq,vec_t re_im[]);

typedef vboolean (V_CALL *cplx_polar_transform_t)(void_p arg,
	u32_t row_freq,u32_t col_freq,
	vboolean neg_freq,vec_t magphase[]);

typedef vboolean (V_CALL *cplx_cart_transform_pair_t)(void_p arg,
	u32_t row_freq,u32_t col_freq,
	vboolean neg_freq,vec_t re_im1[],vec_t re_im2[]);

typedef vboolean (V_CALL *cplx_polar_transform_pair_t)(void_p arg,
	u32_t row_freq,u32_t col_freq,
	vboolean neg_freq,vec_t mag_phase1[],vec_t mag_phase2[]);

#ifdef  __cplusplus
extern  "C" {
#endif      /* __cplusplus */
	vhandle_t	V_GLOBAL	fftCreateContext(u32_t size_power,vboolean fft_real);
	vboolean	V_GLOBAL	fftForward(vhandle_t context,vec_t *samples);
	vboolean	V_GLOBAL	fftInverse(vhandle_t context,vec_t *samples);
	/* *len_ret = 2 ^ size_power */
	vboolean	V_GLOBAL fftGetLen(vhandle_t context,u32_t *len_ret);
	void	V_GLOBAL	fftDestroyContext(vhandle_t handle);
	/* see source for comments */
	vhandle_t	V_GLOBAL	fftRVMCreateContext(u32_t num_rows,u32_t num_cols);
	vboolean	V_GLOBAL	fftRVMGetSize(vhandle_t context,
		u32_p num_rows_ret,u32_p num_cols_ret);
	vboolean	V_GLOBAL	fftRVMForward(vhandle_t context,matrix_p rvm);
	vboolean	V_GLOBAL	fftRVMInverse(vhandle_t context,matrix_p rvmft);
	void		V_GLOBAL	fftRVMDestroyContext(vhandle_t handle);
	void	V_GLOBAL	matRVMFTUnpackZeroColumn(vector_p zero,vector_p middle,matrix_p rvmft);
	void	V_GLOBAL	matRVMFTPackZeroColumn(matrix_p rvmft,vector_p zero,vector_p middle);
	void	V_GLOBAL	matRVMFTMultiply(matrix_p dest,matrix_p multiplier);
	void	V_GLOBAL	matRVMFTDivide(matrix_p dest,matrix_p divisor);
	vboolean	V_GLOBAL	matRVMFTWalkCartesian(matrix_p rvmft,
		u32_t col_freq_start,u32_t row_freq_start,
		u32_t col_freq_end,u32_t row_freq_end,
		cplx_cart_transform_t callback_proc,void_p callback_arg);
	vboolean	V_GLOBAL	matRVMFTWalkCartesianPair(matrix_p rvmft1,matrix_p rvmft2,
		u32_t col_freq_start,u32_t row_freq_start,
		u32_t col_freq_end,u32_t row_freq_end,
		cplx_cart_transform_pair_t callback_proc,void_p callback_arg);
	vboolean	V_GLOBAL	matRVMFTWalkPolar(matrix_p rvmft,
		u32_t col_freq_start,u32_t row_freq_start,
		u32_t col_freq_end,u32_t row_freq_end,
		cplx_polar_transform_t callback_proc,void_p callback_arg);
	vboolean	V_GLOBAL	matRVMFTWalkPolarPair(matrix_p rvmft1,matrix_p rvmft2,
		u32_t col_freq_start,u32_t row_freq_start,
		u32_t col_freq_end,u32_t row_freq_end,
		cplx_polar_transform_pair_t callback_proc,void_p callback_arg);
	void	V_GLOBAL	matRVMFTLowPass(matrix_p rvmft,u32_t cutoff);
	void	V_GLOBAL	matRVMFTHighPass(matrix_p rvmft,u32_t cutoff);
	void	V_GLOBAL	matRVMFTBandPass(matrix_p rvmft,u32_t cutoff_lower,u32_t cutoff_upper);
	void	V_GLOBAL	matRVMFTBandReject(matrix_p rvmft,u32_t cutoff_lower,u32_t cutoff_upper);
#ifdef  __cplusplus
}
#endif      /* __cplusplus */

#endif	/* !V_FFT_H */
