From 945217f495fc2f4b6b058fe4599820f7a71e422c Mon Sep 17 00:00:00 2001 From: Sanim G Date: Wed, 17 May 2023 12:10:23 +0200 Subject: [PATCH] dft --- soft/PjtKEIL_StepDFT/Src/DFT.s | 55 ++++++++++++++++++++++++----- soft/PjtKEIL_StepDFT/StepDFT.uvoptx | 44 ++++++++++++----------- 2 files changed, 70 insertions(+), 29 deletions(-) diff --git a/soft/PjtKEIL_StepDFT/Src/DFT.s b/soft/PjtKEIL_StepDFT/Src/DFT.s index f246e07..4cd502e 100644 --- a/soft/PjtKEIL_StepDFT/Src/DFT.s +++ b/soft/PjtKEIL_StepDFT/Src/DFT.s @@ -31,31 +31,68 @@ DFT_ModuleAuCarre proc push {r7} push {r8} push {r9} + push {r10} + push {r11} + push {r12} + LDR r4,=TabCos LDR r5,=TabSin MOV r8,#0 ; Xreel MOV r9,#64 ; max + MOV r0,#0 Loop - LDRSH r6,[r4,r3] - LDRSH r7,[r2,r3] - MUL r6,r1,r6 ; mul cos par k - MUL r6,r7,r6 ; mul cos et val res en (5.27) + ;calcul de p=k*n[M] dans r11 + push {r0} + push {r4} + mul r0,r1,r3 + and r0,r0,#63 + mov r4,#2 + MUL r11,r0,r4 + pop{r4} + pop {r0} - ADD r8,r6 - + LDRSH r6,[r4,r11] ; load le cos (1.15) + LDRSH r10,[r5,r11] ; load le sin (1.15) + + push{r0} + push{r1} + mov r0,#2 + mul r1,r3,r0 + LDRSH r7,[r2,r1] ; load le signal (format 4.12) + pop{r1} + pop{r0} + + MUL r6,r7,r6 ; mul cos et val res en (5.27) + MUL r10,r7,r10 ; mul sin et val res resultat en (5.27) + + ADD r8,r6 ; sum partie reel + ADD r0,r10 ; sum partie imaginaire ADD r3,#1 - MOV r9,#64 CMP r3,r9 + pop{r5} + pop{r5} BNE Loop - mov r8,r0 + push {r1} + push {r11} + UMLAL r11,r12,r8,r8 ; format (10.54) avec 2 registre de 32bits chacun (R11(low) et R12(high)) + UMLAL r1,r7,r0,r0 ; format (10.54) avec 2 registre de 32bits chacun (R1(low) et R7(high)) + pop {r11} + pop{r1} + + mov r0,#0 + ADD r0,r12,r7 ; r0 au format (10.22) + + pop {r12} + pop {r11} + pop {r10} pop {r9} pop {r8} pop {r7} pop {r6} - pop {r4} pop {r5} + pop {r4} bx lr ENDFUNC diff --git a/soft/PjtKEIL_StepDFT/StepDFT.uvoptx b/soft/PjtKEIL_StepDFT/StepDFT.uvoptx index 7fee9e0..f369966 100644 --- a/soft/PjtKEIL_StepDFT/StepDFT.uvoptx +++ b/soft/PjtKEIL_StepDFT/StepDFT.uvoptx @@ -157,9 +157,9 @@ 0 0 - 40 + 49 1 -
134218414
+
134218438
0 0 0 @@ -168,36 +168,40 @@ 1 .\Src\DFT.s - \\StepDFT\Src/DFT.s\40 -
- - 1 - 0 - 39 - 1 -
0
- 0 - 0 - 0 - 0 - 0 - 0 - .\Src\DFT.s - - + \\StepDFT\Src/DFT.s\49
0 1 - r6 + r8 1 1 r0 + + 2 + 1 + r10 + + + 3 + 1 + r6 + + + 4 + 1 + r7 + + + 5 + 1 + r11 + 0