From 017d1129dcbe46a31b6b3b878d07d17d05f09332 Mon Sep 17 00:00:00 2001 From: brunetto Date: Mon, 22 May 2023 11:47:17 +0200 Subject: [PATCH] =?UTF-8?q?Step=5FDFT=20-=20fini=20et=20test=C3=A9=20avec?= =?UTF-8?q?=20signal=20test=20de=20k=3D5,=20A=3D1/2,=20M=3D64?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- soft/PjtKEIL_StepDFT/Src/DFT.s | 18 +++-- soft/PjtKEIL_StepDFT/Src/Signal.asm | 116 +++++++++++++-------------- soft/PjtKEIL_StepDFT/Src/principal.c | 10 ++- soft/PjtKEIL_StepDFT/StepDFT.uvoptx | 63 +++++++++++++-- 4 files changed, 129 insertions(+), 78 deletions(-) diff --git a/soft/PjtKEIL_StepDFT/Src/DFT.s b/soft/PjtKEIL_StepDFT/Src/DFT.s index 7ad12ab..236d130 100644 --- a/soft/PjtKEIL_StepDFT/Src/DFT.s +++ b/soft/PjtKEIL_StepDFT/Src/DFT.s @@ -23,18 +23,20 @@ DFT_ModuleAuCarre proc push {lr} ;partie reelle - ;push {r0} + push {r0} ldr r2,=TabCos bl DFT_Partie - ;mov r3 ,r0 + mov r3 ,r0 ;partie imaginaire - ;pop {r0} - ;ldr r2,=TabSin - ;bl DFT_Partie + pop {r0} + ldr r2,=TabSin + bl DFT_Partie ; calcul dft - ;mul r0, r0 - ;mul r3, r3 - ;add r0, r3 + asr r0, #16 ; 7.9 + mul r0, r0 ; 14.18 + asr r3, #16 ; 7.9 + mul r3, r3 ; 14.18 + add r0, r3 ; 13.19 pop {pc} endp diff --git a/soft/PjtKEIL_StepDFT/Src/Signal.asm b/soft/PjtKEIL_StepDFT/Src/Signal.asm index 5a79596..1a03ed4 100644 --- a/soft/PjtKEIL_StepDFT/Src/Signal.asm +++ b/soft/PjtKEIL_StepDFT/Src/Signal.asm @@ -1,68 +1,68 @@ AREA Signal, DATA, READONLY export LeSignal LeSignal - DCW 0x0fff ; 0 4095 0.99976 - DCW 0x0ff6 ; 1 4086 0.99756 - DCW 0x0fd9 ; 2 4057 0.99048 - DCW 0x0fa8 ; 3 4008 0.97852 - DCW 0x0f64 ; 4 3940 0.96191 - DCW 0x0f0e ; 5 3854 0.94092 - DCW 0x0ea7 ; 6 3751 0.91577 - DCW 0x0e2f ; 7 3631 0.88647 + DCW 0x0800 ; 0 2048 0.50000 + DCW 0x043b ; 1 1083 0.26440 + DCW 0x0159 ; 2 345 0.08423 + DCW 0x000a ; 3 10 0.00244 + DCW 0x009c ; 4 156 0.03809 + DCW 0x02ed ; 5 749 0.18286 + DCW 0x0670 ; 6 1648 0.40234 + DCW 0x0a53 ; 7 2643 0.64526 DCW 0x0da8 ; 8 3496 0.85352 - DCW 0x0d13 ; 9 3347 0.81714 - DCW 0x0c72 ; 10 3186 0.77783 - DCW 0x0bc5 ; 11 3013 0.73560 + DCW 0x0fa8 ; 9 4008 0.97852 + DCW 0x0fd9 ; 10 4057 0.99048 + DCW 0x0e2f ; 11 3631 0.88647 DCW 0x0b10 ; 12 2832 0.69141 - DCW 0x0a53 ; 13 2643 0.64526 - DCW 0x0990 ; 14 2448 0.59766 - DCW 0x08c9 ; 15 2249 0.54907 - DCW 0x0800 ; 16 2048 0.50000 - DCW 0x0737 ; 17 1847 0.45093 - DCW 0x0670 ; 18 1648 0.40234 - DCW 0x05ad ; 19 1453 0.35474 - DCW 0x04f0 ; 20 1264 0.30859 - DCW 0x043b ; 21 1083 0.26440 - DCW 0x038e ; 22 910 0.22217 - DCW 0x02ed ; 23 749 0.18286 - DCW 0x0258 ; 24 600 0.14648 - DCW 0x01d1 ; 25 465 0.11353 - DCW 0x0159 ; 26 345 0.08423 - DCW 0x00f2 ; 27 242 0.05908 + DCW 0x0737 ; 13 1847 0.45093 + DCW 0x038e ; 14 910 0.22217 + DCW 0x00f2 ; 15 242 0.05908 + DCW 0x0000 ; 16 0 0.00000 + DCW 0x00f2 ; 17 242 0.05908 + DCW 0x038e ; 18 910 0.22217 + DCW 0x0737 ; 19 1847 0.45093 + DCW 0x0b10 ; 20 2832 0.69141 + DCW 0x0e2f ; 21 3631 0.88647 + DCW 0x0fd9 ; 22 4057 0.99048 + DCW 0x0fa8 ; 23 4008 0.97852 + DCW 0x0da8 ; 24 3496 0.85352 + DCW 0x0a53 ; 25 2643 0.64526 + DCW 0x0670 ; 26 1648 0.40234 + DCW 0x02ed ; 27 749 0.18286 DCW 0x009c ; 28 156 0.03809 - DCW 0x0058 ; 29 88 0.02148 - DCW 0x0027 ; 30 39 0.00952 - DCW 0x000a ; 31 10 0.00244 - DCW 0x0000 ; 32 0 0.00000 - DCW 0x000a ; 33 10 0.00244 - DCW 0x0027 ; 34 39 0.00952 - DCW 0x0058 ; 35 88 0.02148 - DCW 0x009c ; 36 156 0.03809 - DCW 0x00f2 ; 37 242 0.05908 - DCW 0x0159 ; 38 345 0.08423 - DCW 0x01d1 ; 39 465 0.11353 + DCW 0x000a ; 29 10 0.00244 + DCW 0x0159 ; 30 345 0.08423 + DCW 0x043b ; 31 1083 0.26440 + DCW 0x0800 ; 32 2048 0.50000 + DCW 0x0bc5 ; 33 3013 0.73560 + DCW 0x0ea7 ; 34 3751 0.91577 + DCW 0x0ff6 ; 35 4086 0.99756 + DCW 0x0f64 ; 36 3940 0.96191 + DCW 0x0d13 ; 37 3347 0.81714 + DCW 0x0990 ; 38 2448 0.59766 + DCW 0x05ad ; 39 1453 0.35474 DCW 0x0258 ; 40 600 0.14648 - DCW 0x02ed ; 41 749 0.18286 - DCW 0x038e ; 42 910 0.22217 - DCW 0x043b ; 43 1083 0.26440 + DCW 0x0058 ; 41 88 0.02148 + DCW 0x0027 ; 42 39 0.00952 + DCW 0x01d1 ; 43 465 0.11353 DCW 0x04f0 ; 44 1264 0.30859 - DCW 0x05ad ; 45 1453 0.35474 - DCW 0x0670 ; 46 1648 0.40234 - DCW 0x0737 ; 47 1847 0.45093 - DCW 0x0800 ; 48 2048 0.50000 - DCW 0x08c9 ; 49 2249 0.54907 - DCW 0x0990 ; 50 2448 0.59766 - DCW 0x0a53 ; 51 2643 0.64526 - DCW 0x0b10 ; 52 2832 0.69141 - DCW 0x0bc5 ; 53 3013 0.73560 - DCW 0x0c72 ; 54 3186 0.77783 - DCW 0x0d13 ; 55 3347 0.81714 - DCW 0x0da8 ; 56 3496 0.85352 - DCW 0x0e2f ; 57 3631 0.88647 - DCW 0x0ea7 ; 58 3751 0.91577 - DCW 0x0f0e ; 59 3854 0.94092 + DCW 0x08c9 ; 45 2249 0.54907 + DCW 0x0c72 ; 46 3186 0.77783 + DCW 0x0f0e ; 47 3854 0.94092 + DCW 0x0fff ; 48 4095 0.99976 + DCW 0x0f0e ; 49 3854 0.94092 + DCW 0x0c72 ; 50 3186 0.77783 + DCW 0x08c9 ; 51 2249 0.54907 + DCW 0x04f0 ; 52 1264 0.30859 + DCW 0x01d1 ; 53 465 0.11353 + DCW 0x0027 ; 54 39 0.00952 + DCW 0x0058 ; 55 88 0.02148 + DCW 0x0258 ; 56 600 0.14648 + DCW 0x05ad ; 57 1453 0.35474 + DCW 0x0990 ; 58 2448 0.59766 + DCW 0x0d13 ; 59 3347 0.81714 DCW 0x0f64 ; 60 3940 0.96191 - DCW 0x0fa8 ; 61 4008 0.97852 - DCW 0x0fd9 ; 62 4057 0.99048 - DCW 0x0ff6 ; 63 4086 0.99756 + DCW 0x0ff6 ; 61 4086 0.99756 + DCW 0x0ea7 ; 62 3751 0.91577 + DCW 0x0bc5 ; 63 3013 0.73560 END diff --git a/soft/PjtKEIL_StepDFT/Src/principal.c b/soft/PjtKEIL_StepDFT/Src/principal.c index 1f7621d..3f866e5 100644 --- a/soft/PjtKEIL_StepDFT/Src/principal.c +++ b/soft/PjtKEIL_StepDFT/Src/principal.c @@ -1,12 +1,13 @@ - +#define MSURDEUX 32 #include "DriverJeuLaser.h" +#include int DFT_ModuleAuCarre( short int * Signal64ech, char k); extern short int LeSignal; -int tab [64]; +int tab [MSURDEUX]; int main(void) { @@ -20,10 +21,11 @@ int main(void) //============================================================================ -for (int i=0;i<64;i++) +for (int i=0;i 0 0 - 29 + 31 1 -
134218158
+
134218160
0 0 0 @@ -168,7 +168,39 @@ 1 .\Src\principal.c - \\\Src/principal.c\29 + \\\Src/principal.c\31 + + + 1 + 0 + 24 + 1 +
134218172
+ 0 + 0 + 0 + 0 + 0 + 1 + .\Src\DFT.s + + \\StepDFT\Src/DFT.s\24 +
+ + 2 + 0 + 28 + 1 +
0
+ 0 + 0 + 0 + 0 + 0 + 0 + .\Src\principal.c + +
@@ -185,24 +217,39 @@ 2 1 - r0,0x0A + r0,0x10 3 1 - i,0x0A + r3,0x0A 4 1 - k,0x0A + r5,0x0A + + + 5 + 1 + signal[0] + + + 6 + 1 + tab[0] + + + 7 + 1 + tab[1] 1 0 - tab + r0 0 @@ -226,7 +273,7 @@ 0 0 0 - 1 + 0 0 0 0