0% found this document useful (0 votes)
21 views20 pages

Common DSP Algorithms

2

Uploaded by

dowoc61946
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views20 pages

Common DSP Algorithms

2

Uploaded by

dowoc61946
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 20

COMMON DSP ALGORITHMS ∞

𝑦 (𝑛)= ∑ 𝑎 ( 𝑘 ) 𝑥 (𝑛+𝑘)
𝑘=− ∞ ∞

• Correlation 𝑦 ( 𝑛 ) =𝑥 ( 𝑛 ) ∗ h (𝑛 )= ∑ 𝑥 ( 𝑘) h (𝑛−𝑘)
𝑀−1 𝑘=− ∞
• Convolution 𝑦 (𝑛)= ∑ 𝑏𝑘 𝑥 (𝑛−𝑘)
• Digital Filters 𝑘=0

• Stochastic-gradient & Least-mean-square adaptive filters


• Block Matching for Motion Estimation
• Discrete Cosine Transform
• Vector Quantization
• Viterbi Algorithm
• Decimator & Interpolator
• Wavelet & Filter Banks
1
ALTERNATIVE
ARCHITECTURES
7-Tap Linear Phase FIR Filter
𝑦 ( 𝑛 ) =𝑏 0 𝑥 ( 𝑛 ) + 𝑏1 𝑥 ( 𝑛 −1 )+ 𝑏2 𝑥 ( 𝑛− 2 ) +𝑏 3 𝑥 ( 𝑛 −3 ) +𝑏0 𝑥 ( 𝑛 −6 ) +𝑏1 𝑥 ( 𝑛 −5 ) + 𝑏2 𝑥 (𝑛 − 4 )

Direct Broadcast

2
ALTERNATIVES AT ALGORITHMIC
LEVEL
DCT as a matrix computation

• The N-point 1D-DCT requires N2 multiplications and additions. For 2D-DCT,


direct computation requires N4 multiplications and additions
• If the separability of 2D-DCT is exploited, it can be computed by performing N
1D-DCTs on the rows of the image block followed by N 1D-DCTs on the
resulting columns
• 2D-DCT requires 2N3 multiply-add operations
3
REPRESENTATION OF DSP
ALGORITHMS AND TERMINOLOGY
• Iteration – execution of all computations in an algorithm once
• Iteration period – time required to execute one iteration
• Iteration rate – reciprocal of iteration period
• Sampling rate (throughput) – number of samples processed per second
• Critical path – longest path between inputs and outputs in a combinational
logic circuit
• – longest path between any two storage elements in a sequential
circuit
(define the minimum clock period i.e. max clock frequency)
• Latency – difference between the time an output is generated and the time at
which its corresponding input is received by the system

Note: sampling rate does not necessarily equal clock frequency in DSP
4
Graphical Representation
to Support Architectural Design of DSP
• Graphical representations are efficient for investigating and
analyzing data flow properties of DSP algorithm and for
exploiting the inherent parallelism among different subtasks.
More importantly, graphical representations can be used to
map DSP algorithms to hardware implementations.
• Four types of directed graph representation will be used
Block Diagram
Signal Flow Graph SFG
Data Flow Graph DFG
Dependent Graph DG
5
BLOCK DIAGRAM
• A block diagram consists of functional blocks connected
with directed edges, which represent the data flow from
its input block to its output block

3-tap FIR Filter y(n)=b0x(n)+b1x(n-1)+b2x(n-2)

6
SIGNAL FLOW GRAPH
• SFG is collection of nodes and directed edges
Node – represent computation
Edge – linear transformation of signals at the node on the input side of
the edge to signals at the node on the output side
• There are two special nodes
Source node – signals injected into the system
Sink node – signals extracted from the system
3-tap FIR Filter

7
FORM TRANSFORM OF SFG
• Transposition – reversing the directions of all the edges,
exchanging the input and output nodes while keeping
the edge gain or edge delay unchanged

8
DATA FLOW GRAPH
• A directed graph has nodes representing computations and directed edges
representing data paths (communications between nodes), and each edge has
a non-negative number of delays associated with it. Associated with node is its
execution time in terms of normalized time units.
• The data flow graph captures the data-driven property of a DSP system, where
all the input data are available. A node with multiple input edges can only be
fired after all its precedent nodes have fired. This imposes the precedence
constraint on a DFG.
Intra-iteration precedence constraint – edge has no delay
Inter-iteration precedence constraint – edge has(2)one or more delays

y(n) = ay(n-1) + x(n)

9
Different Forms of DFG for 3-tap
FIR Filter

10
Synchronous Data Flow
• Special case of data flowGraph
graph where the number of data
samples produced or consumed by each node in each
execution is specified a priori

• For a multi-rate system

2 𝑓 𝐵 2𝑓 𝐴
𝑓 𝐶= =
3 5
• Unfolded graph

11
DEPENDENCE GRAPH
• Show only the dependence of computations in an algorithm. In
a DG, a new node created whenever a new computation is
called for in an algorithm and no node in a DG is ever re-used on
a single computation basis
3-tap FIR Filter

• DG contains computations for all iterations in an algorithm


12
ITERATION BOUND
• A fundamental limit on how fast the underlying DSP
program can be implemented in hardware
𝑖𝑛𝑡𝑟𝑎 𝑖𝑡𝑒𝑟𝑎𝑡𝑖𝑜𝑛, 𝐴𝑘 ⟶ 𝐵𝑘
𝑖𝑛𝑡𝑒𝑟 𝑖𝑡𝑒𝑟𝑎𝑡𝑖𝑜𝑛 , 𝐵𝑘 ⟹ 𝐴𝑘

• A loop or one iteration of this DFG takes at least 6u.t.


and cannot be faster than this
𝑡
𝐿𝑜𝑜𝑝 𝐵𝑜𝑢𝑛𝑑= t – computation time around one loop
𝑤
w – number of delays
L – set of loops in a DFG
𝑖𝑡𝑒𝑟𝑎𝑡𝑖𝑜𝑛 𝐵𝑜𝑢𝑛𝑑 ,𝑇 ∞ =max
𝑙∈ 𝐿 { }
𝑡𝑙
𝑤𝑙

13
Loop Bound

• Two possible iterations to take place concurrently


𝐴 0 ⟶ 𝐵 0 ⟹ 𝐴 2 ⟶ 𝐵2 ⟹ 𝐴 4 ⟶ 𝐵4 ⟹ 𝐴 6 ⋯
𝐴 1 ⟶ 𝐵1 ⟹ 𝐴 3 ⟶ 𝐵3 ⟹ 𝐴 5 ⟶ 𝐵5 ⟹ 𝐴 7 ⋯

6
𝐿𝑜𝑜𝑝 𝐵𝑜𝑢𝑛𝑑= =3 𝑢 .𝑡 .
2

14
Iteration Bound

• The DFG with three loops that have loop bounds of 4/2u.t., 5/3u.t., 5/4u.t.
𝑇 ∞ =𝑚𝑎𝑥 { 4 5 5
}
, , =2𝑢 . 𝑡 .
2 3 4

• Need an algorithm to resolve this in polynomial time


Longest Path Matrix Algorithm
Minimum Cycle Mean Algorithm
Negative Cycle Detection Algorithm
15
LONGEST PATH MATRIX
ALOGRITHM
• Form a series of matrices depending on the number of delay
elements in the DFG
• Find the iteration bound by examining the diagonal elements of the
matrices
• If there are d delay elements, there are corresponding number of
matrices L(m), m=1,2,….d
• Each entry, represents the longest computation time of a path from
delay element di to delay element dj that passes exactly m-1 delays
(not including di and dj)
• If no such path exists, then=-1

Note: longest path can be computed by path algorithms such as


Bellman-Ford Shortest Path algorithm
16
EXAMPLE

• Higher order matrices can be recursively computed from


lower order matrices

Where K is the integer k in the interval of [1,d] such that neither


=-1 nor =-1 holds.
17
EXAMPLE continued

18
Bellman-Ford Shortest Path
Algorithm
• Find the shortest path from one node to any other
nodes
• Number of iterations required is at most the number of
nodes minus 1
• Complexity N-node number E-edge number

S
8 10
E A
-4
1 1
2
D B

-1 C -2

19
20

You might also like