41Z Routine of the week: DFT
|
02-22-2017, 01:54 PM
(This post was last modified: 02-22-2017 08:24 PM by Ángel Martin.)
Post: #1
|
|||
|
|||
41Z Routine of the week: DFT
Discrete Fourier Transform with the 41Z Module.
Not much of a groundbreaking algorithm, the program below uses the straightforward definition to obtain the DFT and inverse DFT of a set of N complex data points, stored in complex data registers ZR01 to ZR0n. You can use the sub-function ZINPT from the module to enter all values. Just enter the sample size in X, and execute ZDFT. The results are stored in complex registers ZRn+1 to ZR(2n). You can use the sub-function ZOUPT to see the values. If you want to apply the inverse DFT to the results you can use REGSWAP to reset the locations: 2,00(2+2n)00(2n). i.e. 2,010|008 for n=4. Then run ZIDFT to obtain the original values (except rounding). Example: DFT [ 1+2i ; 3+4i ; 5+6i ; 7+8i ] = [ 16+20.i ; -8 ; -4-4.i ; -8.i ] IDFT [ 16+20.i ; -8 ; -4-4.i ; -8.i ] = [ 1+2i ; 3+4i ; 5+6i ; 7+8i ] Code: 01 LBL "ZDFT" As always, the execution time can be rather long for large size samples. Using the 41-CL or an emulator in Turbo mode is recommended. Feedback is welcome - would be great to get an FFT implementation as well... any volunteers? "To live or die by your own sword one must first learn to wield it aptly." |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
41Z Routine of the week: DFT - Ángel Martin - 02-22-2017 01:54 PM
RE: 41Z Routine of the week: DFT - gjmcclure - 03-01-2017, 08:26 AM
RE: 41Z Routine of the week: DFT - Ángel Martin - 03-01-2017, 05:05 PM
|
User(s) browsing this thread: 1 Guest(s)