本文整理匯總了Golang中C.vDSP_Stride函數的典型用法代碼示例。如果您正苦於以下問題:Golang vDSP_Stride函數的具體用法?Golang vDSP_Stride怎麽用?Golang vDSP_Stride使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了vDSP_Stride函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: 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))
}
示例2: 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)))
}
示例3: Zvcmul
// Zvcmul performs a complex vector conjugate and multiply.
func Zvcmul(input1 DSPSplitComplex, stride1 int, input2 DSPSplitComplex, stride2 int, result DSPSplitComplex, resultStride int) {
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_zvcmul(&in1, C.vDSP_Stride(stride1), &in2, C.vDSP_Stride(stride2), &res, C.vDSP_Stride(resultStride), minLen(len(input1.Real)/stride1, len(input2.Real)/stride2, len(result.Real)/resultStride))
}
示例4: 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)))
}
示例5: Ctoz
// Ctoz copies the contents of an interleaved complex vector C to a split complex vector Z; single precision.
func Ctoz(input []complex64, inputStride int, output DSPSplitComplex, outputStride int) {
var splitComplex C.DSPSplitComplex
splitComplex.realp = (*C.float)(&output.Real[0])
splitComplex.imagp = (*C.float)(&output.Imag[0])
n := 2 * len(output.Real) / outputStride
if n2 := 2 * len(input) / inputStride; n2 < n {
n = n2
}
C.vDSP_ctoz((*C.DSPComplex)(unsafe.Pointer(&input[0])), C.vDSP_Stride(inputStride), &splitComplex, C.vDSP_Stride(outputStride), C.vDSP_Length(n))
}
示例6: 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))
}
示例7: Vsdiv
// Vector scalar divide; single precision.
func Vsdiv(input []float32, inputStride int, divisor float32, output []float32, outputStride int) {
C.vDSP_vsdiv((*C.float)(&input[0]), C.vDSP_Stride(inputStride), (*C.float)(&divisor), (*C.float)(&output[0]), C.vDSP_Stride(outputStride), C.vDSP_Length(len(output)/outputStride))
}
示例8: Vdpsp_byte
// Vdpsp_byte converts a double-precision to single-precision.
// Operate on a byte buffer which contains float64
func Vdpsp_byte(input []byte, inputStride int, output []float32, outputStride int) {
C.vDSP_vdpsp((*C.double)(unsafe.Pointer(&input[0])), C.vDSP_Stride(inputStride), (*C.float)(&output[0]), C.vDSP_Stride(outputStride), minLen(len(input)/8/inputStride, len(output)/outputStride))
}
示例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)))
}
示例10: Vfltu8
// Vfltu8 converts an array of unsigned 8-bit integers to single-precision floating-point values.
func Vfltu8(input []byte, inputStride int, output []float32, outputStride int) {
C.vDSP_vfltu8((*C.uchar)(&input[0]), C.vDSP_Stride(inputStride), (*C.float)(&output[0]), C.vDSP_Stride(outputStride), minLen(len(input)/inputStride, len(output)/outputStride))
}
示例11: Vflt32_byte
// Vflt32_byte converts an array of signed 16-bit integers to single-precision floating-point values.
func Vflt32_byte(input []byte, inputStride int, output []float32, outputStride int) {
C.vDSP_vflt32((*C.int)(unsafe.Pointer(&input[0])), C.vDSP_Stride(inputStride), (*C.float)(&output[0]), C.vDSP_Stride(outputStride), minLen(len(input)/(4*inputStride), len(output)/outputStride))
}
示例12: Vsmsa
// Vsmsa is vector scalar multiply and scalar add; single precision.
// output[n] = input[n] * mult + add
func Vsmsa(input []float32, inputStride int, mult, add float32, output []float32, outputStride int) {
C.vDSP_vsmsa((*C.float)(&input[0]), C.vDSP_Stride(inputStride), (*C.float)(&mult), (*C.float)(&add), (*C.float)(&output[0]), C.vDSP_Stride(outputStride), minLen(len(input)/inputStride, len(output)/outputStride))
}
示例13: Vdbcon
// Vector convert power or amplitude to decibels; single precision.
// α * log10(input(n)/zeroReference) [α is 20 if Amplitude (flag=1), or 10 if F is Power (flag=0)]
func Vdbcon(input []float32, inputStride int, zeroReference float32, output []float32, outputStride int, flag DBFlag) {
C.vDSP_vdbcon((*C.float)(&input[0]), C.vDSP_Stride(inputStride), (*C.float)(&zeroReference), (*C.float)(&output[0]), C.vDSP_Stride(outputStride), C.vDSP_Length(len(output)/outputStride), C.uint(flag))
}
示例14: Vfix16_byte
// Vfix16_byte converts an array of single-precision floating-point values to signed 16-bit integer values, rounding towards zero. Output to a byte stream.
func Vfix16_byte(input []float32, inputStride int, output []byte, outputStride int) {
C.vDSP_vfix16((*C.float)(&input[0]), C.vDSP_Stride(inputStride), (*C.short)(unsafe.Pointer(&output[0])), C.vDSP_Stride(outputStride), C.vDSP_Length(len(output)/2/outputStride))
}
示例15: Vadd
// Vadd adds two vectors.
func Vadd(input1 []float32, input1Stride int, input2 []float32, input2Stride int, output []float32, outputStride int) {
C.vDSP_vadd((*C.float)(&input1[0]), C.vDSP_Stride(input1Stride), (*C.float)(&input2[0]), C.vDSP_Stride(input2Stride), (*C.float)(&output[0]), C.vDSP_Stride(outputStride), minLen(len(input1)/input1Stride, len(input2)/input2Stride, len(output)/outputStride))
}