# 3.6 Assembly implementation of fir filters on ti tms320c62x

 Page 1 / 1
This module is the exercise to implement FIR filtering in TI TMS320C62x assembly.

## Storing filter coefficients

Rather than defining the filter coefficients in your main assembly program file, it is usually more convenient tostore them in a separate file. By defining the coefficients in a separate assembly (for example, coeff.asm ) file, you can load the coefficients at a desired memory location at the run time,although it is not essential for the current simple FIR filtering lab.

The assembly file containing the filter coefficients can be written as follows:

.def _coef .sect "coeffs" _coef: .short 0ff9bh .short 0ff06h .short 0feffh .short 0ff93h .short 070h .short 0117h .short 0120h .short 07bh

Each coefficient must be converted to the Q-15 format and defined by each .short assembly directive. For your convenience, I wrote a short MATLABscript save_coef.m that converts the filter coefficients stored as a MATLAB vector to Q-15 format andthen writes to a file exactly in the above format. (You can download save_coef.m from the course web page.) The section coeffs should be defined in the link command file so that the coefficients are tobe loaded at the correct memory location.

You can simply include the coeff.asm using the .include directive at the beginning of your main assembly program.

Make coefficient files for each of the filters you designed in the previous exercise.

## Assembly implementation

Based on the codec input and output program you have written in the previous labs, you can now implement areal-time FIR filtering algorithm.

Write an assembly routine that implements the FIR filter by modifying the inner product program you havewritten in Lab 3. Combine the FIR filtering routine with the interrupt-based codec input-output code youwrote in the previous lab. Your code should perform FIR filtering on the input samples and output thefiltered result to the codec. Both the left and right channels should be filtered. To write the designedMATLAB vector of filter coefficients as a .asm file, use the provided save_coef.m matlab function. First implement the length-40 lowpass filter with 10kHzcutoff designed using the remez.m .

## Implementation using circular addressing modes

As you might already have noticed, a lot of cycles are wasted in FIR filtering while maintaining the buffer tosee if you reached the end of buffer and update the address pointers properly. To avoid this unnecessarybuffer maintenance, the TI DSP processors have a special addressing mode, called circular addressing . Using circular addressing, you can define a block ofmemory as a circular buffer. As you increase (or decrease) the pointer register pointing to the buffer index beyondthe buffer limit, it automatically points to the other end of the buffer, implementing a circle of data array.Instead of moving the data samples themselves, you can move the pointer which specifies the beginning of thebuffer, as each new sample is processed. You don't need to check if you reached the end of buffer because the addresspointer returns to the beginning of the buffer immediately after reaching the end.

Of the 32 registers on the C6x, 8 of them can perform circular addressing. These registers are A4 through A7and B4 through B7. Since circular addressing is not default, each of these registers must be specified ascircular using the AMR (Address Mode Register) register. The lower 16 bits of the AMR are used to select the mode for each of the 8 registers. The upper 10 bits (6 are reserved) areused to set the length of the circular buffer. Buffer size is determined by $2^{(N+1)}$ bytes, where $N$ is the value appearing in the block size fields of the AMR register. The top address of the buffer needs to be aligned with proper physical memory blockaddress using the .align assembler directive.

First read TMS320C62x/C67x CPU and Instruction Set Reference Guide to learn how to define circularbuffers. Modify your FIR filtering assembly code to use circular addressing modes. After optimizing yourcode as much as you can, count the number of required clock cycles for each FIR filter outputcomputation. Compare the number with the code written without circular addressing.

Application of nanotechnology in medicine
what is variations in raman spectra for nanomaterials
I only see partial conversation and what's the question here!
what about nanotechnology for water purification
please someone correct me if I'm wrong but I think one can use nanoparticles, specially silver nanoparticles for water treatment.
Damian
yes that's correct
Professor
I think
Professor
what is the stm
is there industrial application of fullrenes. What is the method to prepare fullrene on large scale.?
Rafiq
industrial application...? mmm I think on the medical side as drug carrier, but you should go deeper on your research, I may be wrong
Damian
How we are making nano material?
what is a peer
What is meant by 'nano scale'?
What is STMs full form?
LITNING
scanning tunneling microscope
Sahil
how nano science is used for hydrophobicity
Santosh
Do u think that Graphene and Fullrene fiber can be used to make Air Plane body structure the lightest and strongest. Rafiq
Rafiq
what is differents between GO and RGO?
Mahi
what is simplest way to understand the applications of nano robots used to detect the cancer affected cell of human body.? How this robot is carried to required site of body cell.? what will be the carrier material and how can be detected that correct delivery of drug is done Rafiq
Rafiq
if virus is killing to make ARTIFICIAL DNA OF GRAPHENE FOR KILLED THE VIRUS .THIS IS OUR ASSUMPTION
Anam
analytical skills graphene is prepared to kill any type viruses .
Anam
what is Nano technology ?
write examples of Nano molecule?
Bob
The nanotechnology is as new science, to scale nanometric
brayan
nanotechnology is the study, desing, synthesis, manipulation and application of materials and functional systems through control of matter at nanoscale
Damian
Is there any normative that regulates the use of silver nanoparticles?
what king of growth are you checking .?
Renato
What fields keep nano created devices from performing or assimulating ? Magnetic fields ? Are do they assimilate ?
why we need to study biomolecules, molecular biology in nanotechnology?
?
Kyle
yes I'm doing my masters in nanotechnology, we are being studying all these domains as well..
why?
what school?
Kyle
biomolecules are e building blocks of every organics and inorganic materials.
Joe
anyone know any internet site where one can find nanotechnology papers?
research.net
kanaga
sciencedirect big data base
Ernesto
Introduction about quantum dots in nanotechnology
hi
Loga
what does nano mean?
nano basically means 10^(-9). nanometer is a unit to measure length.
Bharti
where are the solutions?
where are the solutions?