八點快速富利葉轉換(FFT)
更新日期: 2011年1月31日
程式需要在 REG Lin 模式下執行,因此在選擇新程式位置後,按 5 1 選用REG Lin模式。
注意: 藍色的英文字為統計模式中的變數(Σx 按 Shift 1 2,Σy 按 Shift 1 → 2,Σxy Shift 1 →3),πr 是按 Shift EXP Shift Ans 2
程式 (158 bytes)
ClrStat: ?→M: M - 1 DT: ?→M: 1 , M DT: ?→M:
0 , M - Σy DT: ?→A: ?→B: ?→C: ?→D: ?→X: 0→M:
While M - 8: πr M÷4→Y: Σx + Σxy cos( Y ) + Σy cos( 2Y ) +
A cos( 3Y ) + B cos( 4Y ) + C cos( 5Y )+ D cos( 6Y ) + X cos( 7Y◢
- Σxy sin( Y ) - Σy sin( 2Y ) - A sin( 3Y ) - B sin( 4Y ) - C sin( 5Y ) -
D sin( 6Y )- X sin( 7Y◢ M + 1→M: WhileEnd
Example: Perform a 8-sample FFT for the input sequence x[n]={ 1, 2, 0, 1, 2, 1, 0, 0}
Press Prog 1 1 EXE 2 EXE 0 EXE 1 EXE 2 EXE 1 EXE 0 EXE 0
EXE (read-out: 7) EXE (read-out: 0)
EXE (read-out: - 1) EXE (read-out:-1.4142)
EXE (read-out: 3) EXE (read-out: - 2)
EXE (read-out: - 1) EXE (read-out: -1.4142)
EXE (read-out: - 1) EXE (read-out: 0)
EXE (read-out: - 1) EXE (read-out: 1.4142)
EXE (read-out: 3) EXE (read-out: 2)
EXE (read-out: - 1) EXE (read-out: 1.4142)
Therefore, the result is:
X[0] = 7
X[1] = - 1 - 1.4142 j
X[2] = 3 - 2j
X[3] = - 1 - 1.4142j
X[4] = - 1
X[5] = - 1 + 1.4142j
X[6] = 3 + 2j
X[7] = - 1 + 1.4142j