This commit is contained in:
Sanim G 2023-05-17 12:10:23 +02:00
parent 0629a49487
commit 945217f495
2 changed files with 70 additions and 29 deletions

View file

@ -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
;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}
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
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

View file

@ -157,9 +157,9 @@
<Bp>
<Number>0</Number>
<Type>0</Type>
<LineNumber>40</LineNumber>
<LineNumber>49</LineNumber>
<EnabledFlag>1</EnabledFlag>
<Address>134218414</Address>
<Address>134218438</Address>
<ByteObject>0</ByteObject>
<HtxType>0</HtxType>
<ManyObjects>0</ManyObjects>
@ -168,36 +168,40 @@
<BreakIfRCount>1</BreakIfRCount>
<Filename>.\Src\DFT.s</Filename>
<ExecCommand></ExecCommand>
<Expression>\\StepDFT\Src/DFT.s\40</Expression>
</Bp>
<Bp>
<Number>1</Number>
<Type>0</Type>
<LineNumber>39</LineNumber>
<EnabledFlag>1</EnabledFlag>
<Address>0</Address>
<ByteObject>0</ByteObject>
<HtxType>0</HtxType>
<ManyObjects>0</ManyObjects>
<SizeOfObject>0</SizeOfObject>
<BreakByAccess>0</BreakByAccess>
<BreakIfRCount>0</BreakIfRCount>
<Filename>.\Src\DFT.s</Filename>
<ExecCommand></ExecCommand>
<Expression></Expression>
<Expression>\\StepDFT\Src/DFT.s\49</Expression>
</Bp>
</Breakpoint>
<WatchWindow1>
<Ww>
<count>0</count>
<WinNumber>1</WinNumber>
<ItemText>r6</ItemText>
<ItemText>r8</ItemText>
</Ww>
<Ww>
<count>1</count>
<WinNumber>1</WinNumber>
<ItemText>r0</ItemText>
</Ww>
<Ww>
<count>2</count>
<WinNumber>1</WinNumber>
<ItemText>r10</ItemText>
</Ww>
<Ww>
<count>3</count>
<WinNumber>1</WinNumber>
<ItemText>r6</ItemText>
</Ww>
<Ww>
<count>4</count>
<WinNumber>1</WinNumber>
<ItemText>r7</ItemText>
</Ww>
<Ww>
<count>5</count>
<WinNumber>1</WinNumber>
<ItemText>r11</ItemText>
</Ww>
</WatchWindow1>
<Tracepoint>
<THDelay>0</THDelay>