call 函数未定义,是否格式不对
我想用音频波形转换频谱,已经做了模 kkfft.bas在调用时出错,不明白,请指导,谢谢。
Private Sub Timer2_Timer()
Dim value As Integer, i As Integer
Randomize
value = Int(200 * Rnd + (-100))
List1.AddItem value
If List1.ListCount > 0 And (List1.ListCount Mod 128 = 0) Then
Picture1.Cls
For i = List1.ListCount - 128 To List1.ListCount - 1
xr(128 - (List1.ListCount - i)) = Val(List1.List(i))
xi(128 - (List1.ListCount - i)) = 0
Next
'FFT变换
' Call kkfft0(pr(), pi(), 128, 1) '出错处---函数未定义
'绘图
Picture1.Scale (0, 100)-(127, -100)
Picture1.DrawWidth = 1
For i = 0 To 127
Picture1.Line (i, Abs(xr(i)))-(i + 1, Abs(xr(i + 1))), vbBlue
Next i
End If
End Sub
---------------------
以下为call 的fftt.bas 的前面部分。
Public Sub kkfft(ByRef pr() As Double, _
ByRef pi() As Double, _
ByRef fr() As Double, _
ByRef fi() As Double, _
ByVal n As Integer, _
ByVal k As Integer, ByVal L As Integer)
Dim it As Integer
Dim m As Integer
Dim iis As Integer
Dim i As Integer
Dim j As Integer
Dim nv As Integer
Dim l0 As Integer
Dim p, q, s, vr, vi, poddr, poddi As Double
For it = 0 To n - 1
m = it
iis = 0
For i = 0 To k - 1
j = Int(m / 2)
iis = 2 * iis + (m - 2 * j)
m = j
Next
fr(it) = pr(iis)
fi(it) = pi(iis)
Next。。。。。。。。