📄 form1.frm
字号:
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 6045
ClientLeft = 60
ClientTop = 345
ClientWidth = 6510
LinkTopic = "Form1"
ScaleHeight = 6045
ScaleWidth = 6510
StartUpPosition = 3 'Windows Default
Begin VB.ListBox List2
Height = 4935
Left = 3480
TabIndex = 4
Top = 840
Width = 2775
End
Begin VB.ListBox List1
Height = 4935
Left = 360
TabIndex = 3
Top = 960
Width = 2895
End
Begin VB.CommandButton Command1
Caption = "计算"
Height = 375
Left = 3840
TabIndex = 2
Top = 120
Width = 1455
End
Begin VB.TextBox Text1
Height = 375
Left = 1320
TabIndex = 0
Top = 120
Width = 2295
End
Begin VB.Label Label1
Caption = "FRQ"
Height = 255
Left = 360
TabIndex = 1
Top = 120
Width = 855
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim y1 As Double
Dim y2 As Double
Dim temp As Double
Dim y As Double
Dim frq As Double
Dim i As Double
Dim resultstr As String
List1.Clear
y1 = 0
temp = -905
y2 = temp
temp = 15333
i = 0
While (i < 500)
y = 2 * temp * y1 / 32768 - y2
y2 = y1
y1 = y
resultstr = Str(i) & " " & Str(CLng(y1))
List1.AddItem (resultstr)
i = i + 1
Wend
frq = Int(Text1.Text)
y1 = 0
y2 = -Sin(2 * 3.1415926 * frq / 8000)
i = 0
While (i < 500)
y = 2 * Cos(2 * 3.1415926 * frq / 8000) * y1 - y2
y2 = y1
y1 = y
resultstr = Str(i) & " " & Str(CLng(y1 * 1024)) 'q值为10
List2.AddItem (resultstr)
i = i + 1
Wend
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -