Real-time digital signal processing: implementations, ... changes in the input signal is limited by its internal clock rate, so that it may be slow to
Document source : notes.ump.edu.my
Table 4.8 The list of assembly program mag_128.asm
; Compute the magnitude response of the input
;
; Entry:
AR0: input buffer pointer
;
AR1: output buffer pointer
; Exit: None
;
.def
_mag_128
N.set
128
_mag_128
bset
SATD
pshboth
XAR5
mov
#NÀ1, BRC0
; Set BRC0 for loop Ntimes
mov
XAR0, XAR5
bset
FRCT
rptblocal mag_loop-1
mpym
*AR0, *AR5, AC0
; Xr [i]*Xr [i]
macm
*AR0, *AR5, AC0
; Xr [i]*Xr [i] Xi[i]*Xi [i]
mov
hi(saturate(AC0)), *AR1
mag_loop
popboth
XAR5
bclr
SATD
bclr
FRCT
ret
.end
Perform the following steps for Experiment 4C:
1. Write the C program exp4a.c based on the example (or copy from the software
package) that will complete the following tasks:
(a) Compose the complex input sample to Xin [].
(b) Call the subroutine dft_128()to perform DFT.
(c) Call the subroutine mag_128()to compute the squared magnitude spectrum of
the DFT.
2. Write the assembly routine dft_128.asm for the DFT,and write the assembly
routine mag_128.asm for computing the magnitude spectrum (or copy these files
from the software package).
3. Test and debug the programs. Plot the magnitude spectrum (Spectrum [N]) and
the input samples as shown in Figure 4.21.
4. Profile the DFT routine and record the program and data memory usage. Also,
record the clock cycles used for each subroutine.
172
FREQUENCY ANALYSIS
Summary :
Table 4.8 The list of assembly program mag_128.asm ; .def _mag_128 N.set 128 _mag_128 bset SATD pshboth XAR5 mov #NÀ1, BRC0 ; Set BRC0 for loop Ntimes mov XAR0, XAR5 bset FRCT rptblocal mag_loop-1 mpym *AR0, *AR5, AC0 ;
Tags :
input,spectrum,magnitude,assembly,program,routine,write,xar5,subroutine,dft,ar0,software,package