真心求教,快速傅里叶变换FFT的滚屏显示
FFT变换.zip
(2.2 KB)
各位版主朋友,附件里是一个快速傅里叶变换的程序,我用随机数模拟采集的数据,然后对这些数据做FFT运算,我想实现的功能是每次对128个数据实现完FFT运算并且输出图像以后,屏幕cls,紧接着输出下面128个数的FFT运算,以此类推,实现滚屏显示,希望各位版主大神帮帮忙!
Dim i As Integer Dim xr(128) As Double Dim xi(128) As Double Dim IaIn(0 To 127) As Double Private Sub Command1_Click() Picture1.AutoRedraw = True Timer1.Enabled = True '赋值,IaIn(i)是采得的数据。 For i = 0 To 127 IaIn(i) = Val(List1.List(i)) xr(i) = IaIn(i) xi(i) = 0 Next 'FFT变换 Call FFT0(xr(), xi(), 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 Sub Private Sub Command2_Click() Timer1.Enabled = False End Sub Private Sub Command3_Click() End End Sub Private Sub Timer1_Timer() Dim value As Integer Randomize value = Int(200 * Rnd + (-100)) List1.AddItem value End Sub