Example #1
0
// Zop computes an out-of-place single-precision complex discrete Fourier transform of the
// input vector, either from the time domain to the frequency domain (forward) or from the
// frequency domain to the time domain (inverse).
func (fs *FFTSetupD) Zop(input DSPDoubleSplitComplex, inputStride int, output DSPDoubleSplitComplex, outputStride int, log2n int, direction FFTDirection) {
	var inC C.DSPDoubleSplitComplex
	inC.realp = (*C.double)(&input.Real[0])
	inC.imagp = (*C.double)(&input.Imag[0])
	var outC C.DSPDoubleSplitComplex
	outC.realp = (*C.double)(&output.Real[0])
	outC.imagp = (*C.double)(&output.Imag[0])
	C.vDSP_fft_zopD(fs.cFFTSetupD, &inC, C.vDSP_Stride(inputStride), &outC, C.vDSP_Stride(outputStride), C.vDSP_Length(log2n), C.FFTDirection(direction))
}
Example #2
0
// Complex vector absolute values; double precision.
func ZvabsD(input DSPDoubleSplitComplex, inputStride int, output []float64, outputStride int) {
	var in C.DSPDoubleSplitComplex
	in.realp = (*C.double)(&input.Real[0])
	in.imagp = (*C.double)(&input.Imag[0])
	C.vDSP_zvabsD(&in, C.vDSP_Stride(inputStride), (*C.double)(&output[0]), C.vDSP_Stride(outputStride), C.vDSP_Length(len(output)/outputStride))
}
Example #3
0
// Zip computess an in-place single-precision complex discrete Fourier transform of the
// input/output vector signal, either from the time domain to the frequency domain
// (forward) or from the frequency domain to the time domain (inverse).
func (fs *FFTSetupD) Zip(ioData DSPDoubleSplitComplex, stride, log2n int, direction FFTDirection) {
	var splitComplex C.DSPDoubleSplitComplex
	splitComplex.realp = (*C.double)(&ioData.Real[0])
	splitComplex.imagp = (*C.double)(&ioData.Imag[0])
	C.vDSP_fft_zipD(fs.cFFTSetupD, &splitComplex, C.vDSP_Stride(stride), C.vDSP_Length(log2n), C.FFTDirection(direction))
}