當前位置: 首頁>>代碼示例>>Golang>>正文


Golang C.vDSP_Length函數代碼示例

本文整理匯總了Golang中C.vDSP_Length函數的典型用法代碼示例。如果您正苦於以下問題:Golang vDSP_Length函數的具體用法?Golang vDSP_Length怎麽用?Golang vDSP_Length使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了vDSP_Length函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: minLen

func minLen(size ...int) C.vDSP_Length {
	min := size[0]
	for i := 1; i < len(size); i++ {
		if size[i] < min {
			min = size[i]
		}
	}
	return C.vDSP_Length(min)
}
開發者ID:samuel,項目名稱:go-accelerate,代碼行數:9,代碼來源:dsp.go

示例2: CreateFFTSetupD

func CreateFFTSetupD(log2n int, radix FFTRadix) (*FFTSetupD, error) {
	fftSetup := C.vDSP_create_fftsetupD(C.vDSP_Length(log2n), C.FFTRadix(radix))
	if fftSetup == nil {
		return nil, ErrFailedToCreateFFTSetup
	}
	setup := &FFTSetupD{fftSetup}
	runtime.SetFinalizer(setup, destroyFFTSetupD)
	return setup, nil
}
開發者ID:samuel,項目名稱:go-accelerate,代碼行數:9,代碼來源:fftd.go

示例3: Zidotpr

// Zidotpr calculates the conjugate dot product (or inner dot product) of complex vectors A and B and leave the result in complex vector C; single precision.
func Zidotpr(input1 DSPSplitComplex, stride1 int, input2 DSPSplitComplex, stride2 int, result DSPSplitComplex) {
	var in1 C.DSPSplitComplex
	in1.realp = (*C.float)(&input1.Real[0])
	in1.imagp = (*C.float)(&input1.Imag[0])
	var in2 C.DSPSplitComplex
	in2.realp = (*C.float)(&input2.Real[0])
	in2.imagp = (*C.float)(&input2.Imag[0])
	var res C.DSPSplitComplex
	res.realp = (*C.float)(&result.Real[0])
	res.imagp = (*C.float)(&result.Imag[0])
	C.vDSP_zidotpr(&in1, C.vDSP_Stride(stride1), &in2, C.vDSP_Stride(stride2), &res, C.vDSP_Length(len(result.Real)))
}
開發者ID:samuel,項目名稱:go-accelerate,代碼行數:13,代碼來源:dsp.go

示例4: Vmul

// Multiplies vector A by vector B and leaves the result in vector C; single precision.
func Vmul(input1 []float32, stride1 int, input2 []float32, stride2 int, output []float32, outputStride int) {
	C.vDSP_vmul((*C.float)(&input1[0]), C.vDSP_Stride(stride1), (*C.float)(&input2[0]), C.vDSP_Stride(stride2), (*C.float)(&output[0]), C.vDSP_Stride(outputStride), C.vDSP_Length(len(output)/outputStride))
}
開發者ID:samuel,項目名稱:go-accelerate,代碼行數:4,代碼來源:dsp.go

示例5: Vavlin

// Vector linear average; single precision.
func Vavlin(input []float32, inputStride int, count float32, output []float32, outputStride int) {
	C.vDSP_vavlin((*C.float)(&input[0]), C.vDSP_Stride(inputStride), (*C.float)(&count), (*C.float)(&output[0]), C.vDSP_Stride(outputStride), C.vDSP_Length(len(output)/outputStride))
}
開發者ID:samuel,項目名稱:go-accelerate,代碼行數:4,代碼來源:dsp.go

示例6: BlkmanWindow

// BlkmanWindow creates a single-precision Blackman window.
func BlkmanWindow(output []float32, flag WindowFlag) {
	C.vDSP_blkman_window((*C.float)(&output[0]), C.vDSP_Length(len(output)), C.int(flag))
}
開發者ID:samuel,項目名稱:go-accelerate,代碼行數:4,代碼來源:dsp.go

示例7: Meanv

// Meanv returns the mean of the input vector.
func Meanv(input []float32, stride int) float32 {
	var mean C.float
	C.vDSP_meanv((*C.float)(&input[0]), C.vDSP_Stride(stride), &mean, C.vDSP_Length(len(input)/stride))
	return float32(mean)
}
開發者ID:samuel,項目名稱:go-accelerate,代碼行數:6,代碼來源:dsp.go

示例8: Vneg

// Vector negative values; single precision.
func Vneg(input []float32, inputStride int, output []float32, outputStride int) {
	C.vDSP_vneg((*C.float)(&input[0]), C.vDSP_Stride(inputStride), (*C.float)(&output[0]), C.vDSP_Stride(outputStride), C.vDSP_Length(len(output)/outputStride))
}
開發者ID:samuel,項目名稱:go-accelerate,代碼行數:4,代碼來源:dsp.go

示例9: Zvphas

// Zvphas calculates the complex vector phase.
func Zvphas(input DSPSplitComplex, inputStride int, output []float32, outputStride int) {
	var srcC C.DSPSplitComplex
	srcC.realp = (*C.float)(&input.Real[0])
	srcC.imagp = (*C.float)(&input.Imag[0])
	C.vDSP_zvphas(&srcC, C.vDSP_Stride(inputStride), (*C.float)(&output[0]), C.vDSP_Stride(outputStride), C.vDSP_Length(len(output)))
}
開發者ID:samuel,項目名稱:go-accelerate,代碼行數:7,代碼來源:dsp.go

示例10: Zrdesamp

// Zrdesamp performs a complex-real downsample with anti-aliasing.
func Zrdesamp(input DSPSplitComplex, decimationFactor int, coefficients []float32, output DSPSplitComplex) {
	var srcC C.DSPSplitComplex
	srcC.realp = (*C.float)(&input.Real[0])
	srcC.imagp = (*C.float)(&input.Imag[0])
	var dstC C.DSPSplitComplex
	dstC.realp = (*C.float)(&output.Real[0])
	dstC.imagp = (*C.float)(&output.Imag[0])
	C.vDSP_zrdesamp(&srcC, C.vDSP_Stride(decimationFactor), (*C.float)(&coefficients[0]), &dstC, C.vDSP_Length(len(output.Real)), C.vDSP_Length(len(coefficients)))
}
開發者ID:samuel,項目名稱:go-accelerate,代碼行數:10,代碼來源:dsp.go

示例11: Desamp

// Desamp performs convolution with decimation.
func Desamp(input []float32, desamplingFactor int, coeff []float32, output []float32) {
	C.vDSP_desamp((*C.float)(&input[0]), C.vDSP_Stride(desamplingFactor), (*C.float)(&coeff[0]), (*C.float)(&output[0]), C.vDSP_Length(len(output)), C.vDSP_Length(len(coeff)))
}
開發者ID:samuel,項目名稱:go-accelerate,代碼行數:4,代碼來源:dsp.go

示例12: Ztoc_byte

// Ztoc_byte copies the contents of a split complex vector Z to an interleaved complex vector C; single precision. Operate on a byte buffer which contains complex64
func Ztoc_byte(input DSPSplitComplex, inputStride int, output []byte, outputStride int) {
	var splitComplex C.DSPSplitComplex
	splitComplex.realp = (*C.float)(&input.Real[0])
	splitComplex.imagp = (*C.float)(&input.Imag[0])
	C.vDSP_ztoc(&splitComplex, C.vDSP_Stride(inputStride), (*C.DSPComplex)(unsafe.Pointer(&output[0])), C.vDSP_Stride(outputStride), C.vDSP_Length(len(output)/4/outputStride))
}
開發者ID:samuel,項目名稱:go-accelerate,代碼行數:7,代碼來源:dsp.go

示例13: Zop

// 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))
}
開發者ID:samuel,項目名稱:go-accelerate,代碼行數:12,代碼來源:fftd.go

示例14: Zip

// 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))
}
開發者ID:samuel,項目名稱:go-accelerate,代碼行數:9,代碼來源:fftd.go

示例15: Vsadd

// Vector scalar add; single precision.
func Vsadd(input []float32, inputStride int, add float32, output []float32, outputStride int) {
	C.vDSP_vsadd((*C.float)(&input[0]), C.vDSP_Stride(inputStride), (*C.float)(&add), (*C.float)(&output[0]), C.vDSP_Stride(outputStride), C.vDSP_Length(len(output)/outputStride))
}
開發者ID:samuel,項目名稱:go-accelerate,代碼行數:4,代碼來源:dsp.go


注:本文中的C.vDSP_Length函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。