Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Function CFourier_fix_coef(w_B, addr_cell) As Double
- 'Const Ts As Double = 1 / 1200
- Dim C(24) As Double
- ' Цикл для вычисления коэффициентов
- For i = 1 To 24
- C(i) = Sin((i - 1) * w_B / 1200)
- Next i
- ' Цикл для вычисления орт.сост.
- a = 0
- If Range(addr_cell).Row < 24 + 3 Then
- start_row = 28 - Range(addr_cell).Row
- Else
- start_row = 1
- End If
- For i = start_row To 24
- x = Range(addr_cell).Offset(i - 24, 0)
- 'If IsNumeric(x) Then
- a = a + x * C(i)
- 'End If
- Next i
- a = a * 2 / 24
- CFourier_fix_coef = a
- End Function
- Function SFourier_fix_coef(w_B, addr_cell) As Double
- Dim S(24) As Double
- ' Цикл для вычисления коэффициентов
- For i = 1 To 24
- S(i) = Cos((i - 1) * w_B / 1200)
- Next i
- ' Цикл для вычисления орт.сост.
- a = 0
- If Range(addr_cell).Row < 24 + 3 Then
- start_row = 28 - Range(addr_cell).Row
- Else
- start_row = 1
- End If
- For i = start_row To 24
- x = Range(addr_cell).Offset(i - 24, 0)
- 'If IsNumeric(x) Then
- a = a + x * S(i)
- 'End If
- Next i
- a = a * 2 / 24
- SFourier_fix_coef = a
- End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement