<< Chapter < Page Chapter >> Page >
An overview of DSP optimization techniques, from the design stage, through high-level implementations, to assembly implementations.

Introduction to code optimization

Most practical DSP applications have a clock-cycle and/or memory budget. Initial implementations typically don't meet these budgets;therefore, the code must be optimized. Code development usually follows six steps:

  • Develop algorithm on paper
  • Simulate in MATLAB
  • Develop and simulate more efficient implementations
  • Implement algorithm in C
  • Use library routines when available
  • Use optimizing compiler
  • Manually write assembly routines for key routines

Develop algorithm on paper

The algorithm to be implemented should first be designed on paper. In addition to equations describing the algorithm, its design shouldinclude inputs and outputs of each routine and a flow chart of the operation of the complete program. Never design an algorithm or a program at a computer. While it may be possible to implement some basic algorithms and programs this way, compilers cannot overcome any designflaws that are likely to be introduced.

Simulate in matlab

Before any C code is written, the algorithm should be developed and simulated in MATLAB since problems with the algorithm design can befound more easily. This is done by applying the algorithm to test vectors and inspecting and/or plotting the results. Once thealgorithm is completely defined, C implementation can begin. Recall that in each of the previous labs a MATLAB simulation step was givenbefore assembly implementation.

Develop and simulate more efficient implementations

An efficient algorithm used as few multiplications and additions as possible. Applying DSP theory to "simplify" the algorithm is a commonway of doing this. The autocorrelation function is a simple example: a simple-minded way of implementing this is tocompute sums for each lag, but careful inspection of the autocorrelation function reveals that it is actually a function of the absolute value of the lag. Therefore each value at a negative lag is identical to the value at the correspondingpositive lag. Approximately half the apparent multiplications and additions aretherefore required. If the entire autocorrelation sequence is needed, the autocorrelation can be optimized even furtherif it is treated as a convolution of two sequences. An FFT and an inverse FFT can then be used to compute the autocorrelation.

C implementation

After the algorithm has been designed and optimized, an initial implentation in C is done. Tips on writing code with efficiency inmind can be found here . It is important, however, to get a working implementation ofthe algorithm in a reasonable amount of time as some optimizations cannot be anticipated by the programmer.Some of these coding techniques in the URL reference can be applied later on when it is clear which routines need the most optimization.This implementation can serve as a reference implementation to compare the correctness and speed of optimized versions.

Questions & Answers

what is mutation
Janga Reply
what is a cell
Sifune Reply
how is urine form
Sifune
what is antagonism?
mahase Reply
classification of plants, gymnosperm features.
Linsy Reply
what is the features of gymnosperm
Linsy
how many types of solid did we have
Samuel Reply
what is an ionic bond
Samuel
What is Atoms
Daprince Reply
what is fallopian tube
Merolyn
what is bladder
Merolyn
what's bulbourethral gland
Eduek Reply
urine is formed in the nephron of the renal medulla in the kidney. It starts from filtration, then selective reabsorption and finally secretion
onuoha Reply
State the evolution relation and relevance between endoplasmic reticulum and cytoskeleton as it relates to cell.
Jeremiah
what is heart
Konadu Reply
how is urine formed in human
Konadu
how is urine formed in human
Rahma
what is the diference between a cavity and a canal
Pelagie Reply
what is the causative agent of malaria
Diamond
malaria is caused by an insect called mosquito.
Naomi
Malaria is cause by female anopheles mosquito
Isaac
Malaria is caused by plasmodium Female anopheles mosquitoe is d carrier
Olalekan
a canal is more needed in a root but a cavity is a bad effect
Commander
what are pathogens
Don Reply
In biology, a pathogen (Greek: πάθος pathos "suffering", "passion" and -γενής -genēs "producer of") in the oldest and broadest sense, is anything that can produce disease. A pathogen may also be referred to as an infectious agent, or simply a germ. The term pathogen came into use in the 1880s.[1][2
Zainab
A virus
Commander
Definition of respiration
Muhsin Reply
respiration is the process in which we breath in oxygen and breath out carbon dioxide
Achor
how are lungs work
Commander
where does digestion begins
Achiri Reply
in the mouth
EZEKIEL
what are the functions of follicle stimulating harmones?
Rashima Reply
stimulates the follicle to release the mature ovum into the oviduct
Davonte
what are the functions of Endocrine and pituitary gland
Chinaza
endocrine secrete hormone and regulate body process
Achor
while pituitary gland is an example of endocrine system and it's found in the Brain
Achor
what's biology?
Egbodo Reply
Biology is the study of living organisms, divided into many specialized field that cover their morphology, physiology,anatomy, behaviour,origin and distribution.
Lisah
biology is the study of life.
Alfreda
Biology is the study of how living organisms live and survive in a specific environment
Sifune
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Digital signal processing laboratory (ece 420). OpenStax CNX. Sep 27, 2006 Download for free at http://cnx.org/content/col10236/1.14
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Digital signal processing laboratory (ece 420)' conversation and receive update notifications?

Ask