forked from acco/chti23
Transférer les fichiers vers 'soft/PjtKEIL_StepDFT/Src'
DFT partie imaginaire fonctionnelle, DFT totale avancée mais non testée
This commit is contained in:
parent
8864a81d99
commit
552c7a052f
1 changed files with 49 additions and 3 deletions
|
@ -1,6 +1,8 @@
|
|||
PRESERVE8
|
||||
THUMB
|
||||
export DFTReel
|
||||
export DFTImage
|
||||
export DFTTotale
|
||||
import LeSignal
|
||||
|
||||
; ====================== zone de réservation de données, ======================================
|
||||
|
@ -28,12 +30,12 @@ DFTReel proc
|
|||
mov r3, #0
|
||||
|
||||
;;Pour i allant de 0 à M-1 (ici, M = 64)
|
||||
SommeFor
|
||||
SommeForReel
|
||||
;; Rsom += Signal[i] * TabCos[k*i]
|
||||
ldrsh r4, [r0,r3,lsl #1]
|
||||
mul r5, r1, r3
|
||||
and r5, #63
|
||||
mov r7, r5
|
||||
;;mov r7, r5
|
||||
;mul r7, r5
|
||||
ldr r6, =TabCos
|
||||
ldrsh r5, [r6,r5,lsl #1]
|
||||
|
@ -41,7 +43,7 @@ SommeFor
|
|||
mla r2, r4, r5, r2
|
||||
add r3, #1
|
||||
cmp r3, #64
|
||||
bne SommeFor
|
||||
bne SommeForReel
|
||||
;;Fin Pour
|
||||
mov r0, r2
|
||||
pop {pc}
|
||||
|
@ -49,8 +51,52 @@ SommeFor
|
|||
endp
|
||||
;;// Renvoie Rsom, Isom (format 5.27) ou Rsom^2 + Isom^2 (format 10.54)
|
||||
|
||||
;; DFT Partie imaginaire
|
||||
|
||||
DFTImage proc
|
||||
push {lr}
|
||||
mov r2, #0
|
||||
mov r3, #0
|
||||
|
||||
;;Pour i allant de 0 à M-1 (ici, M = 64)
|
||||
SommeForImage
|
||||
;; Rsom += Signal[i] * TabCos[k*i]
|
||||
ldrsh r4, [r0,r3,lsl #1]
|
||||
mul r5, r1, r3
|
||||
and r5, #63
|
||||
;;mov r7, r5
|
||||
;mul r7, r5
|
||||
ldr r6, =TabSin
|
||||
ldrsh r5, [r6,r5,lsl #1]
|
||||
;;smlal r2, r7, r4, r5
|
||||
mla r2, r4, r5, r2
|
||||
add r3, #1
|
||||
cmp r3, #64
|
||||
bne SommeForImage
|
||||
;;Fin Pour
|
||||
mov r0, r2
|
||||
pop {pc}
|
||||
|
||||
endp
|
||||
|
||||
|
||||
DFTTotale proc
|
||||
push {lr}
|
||||
mov r7, r0
|
||||
mov r8, r1
|
||||
bl DFTReel
|
||||
mov r3, r7
|
||||
mov r7, r0
|
||||
mov r0, r4
|
||||
mov r3, r8
|
||||
mov r8, r1
|
||||
mov r1, r3
|
||||
bl DFTImage
|
||||
smull r0, r1, r0, r0
|
||||
smlal r0, r1, r7, r7
|
||||
|
||||
pop {pc}
|
||||
endp
|
||||
|
||||
;Section ROM code (read only) :
|
||||
AREA Trigo, DATA, READONLY
|
||||
|
|
Loading…
Reference in a new issue