<< Chapter < Page Chapter >> Page >

Part 1: single-channel fir filter

In this section, you will implement the 20-tap FIR filter. Edit filtercode.asm to use the coefficients for this filter by making several changes.

First, the length of the FIR filter for this exercise is 20, not 8. Therefore, you need to change FIR_len1 to 20. FIR_len1 is set using the .set directive, which assigns a number to a symbolic name. You will need to change this to FIR_len1 .set 20 .

Second, you will need to ensure that the .copy directive brings in the correct coefficients. Change the filename to point to the file that contains the coefficientsfor your first filter.

Third, you will need to modify the .align and .space directives appropriately. The TI TMS320C55x DSP requires that circular buffers, which are usedfor the FIR filter coefficient and state buffers, be aligned so that they begin at an address that is a multiple of a powerof two greater than the length of the buffer. Since you are using a 20-tap filter (which uses 20-element state andcoefficient buffers), the next greater power of two is 32. Therefore, you will need to align both the state andcoefficient buffers to an address that is a multiple of 32. (16-element buffers would also require alignment to a multipleof 32.) This is done with the .align command. In addition, memory must be reserved for the state buffer. Thisis done using the .space directive, which takes as its input the number of bits of space to allocate. Therefore, to allocate 20 words of storage, usethe directive .space 16*20 as shown below:

1 .align 32 % Align to a multiple of 32 2 coef1 .copy "coef1.asm" % Copy FIR filter coefficients3 4 .align 32 % Align to a multiple of 325 inputBuffer .space 16*20 % Allocate 20 words of data space

Assemble your code, load the output file, and run. Ensure that it is has the correct frequency response. After you have verifiedthat this code works properly, proceed to the next step.

Part 2: assembly function calls from c

So far you have been working exclusively in your filtercode.asm file, where the FIR filtering is taking place. In this part, you will be exposed to some of the C code that is required to setup the hardware peripherals. Your goal will be to write C code to change how the filtered output and raw input are sent to the output channels.

You may have noticed that your assembly code seems to automatically run every time a new input sample is ready to be processed. How does the system know to run the assembly routine when new samples are waiting? The answer lies in an interrupt , a signal sent by the hardware alerting the processor that new samples are ready to be processed.

Open main.c , and find the function named HWI_RINT0 . This is the function that is called each time the DSP receives a hardware interrupt,signaling the presence of new input samples. You can see that input[0] and input[1] receive the samples from the four input channels, and then filter() is called, beginning your assembly routine in filtercode.asm . After the assembly function returns back into the C code, output[0] and output[1] hold your four output samples.

The output[0] variable is a 32-bit integer. Channel 1 and 2 outputs are expected in the top 16 bits and bottom 16 bits, respectively. Likewise, channels 3 and 4 are expected in the top and bottom 16 bits of output[1] .

Questions & Answers

Complementary angles
Idrissa Reply
Commplementary angles
Idrissa Reply
Complementary angles
im all ears I need to learn
Complementary angles
what is a good calculator for all algebra; would a Casio fx 260 work with all algebra equations? please name the cheapest, thanks.
Kevin Reply
a perfect square v²+2v+_
Dearan Reply
kkk nice
Abdirahman Reply
algebra 2 Inequalities:If equation 2 = 0 it is an open set?
Kim Reply
or infinite solutions?
Embra Reply
if |A| not equal to 0 and order of A is n prove that adj (adj A = |A|
Nancy Reply
rolling four fair dice and getting an even number an all four dice
ramon Reply
Kristine 2*2*2=8
Bridget Reply
Differences Between Laspeyres and Paasche Indices
Emedobi Reply
No. 7x -4y is simplified from 4x + (3y + 3x) -7y
Mary Reply
is it 3×y ?
Joan Reply
J, combine like terms 7x-4y
Bridget Reply
im not good at math so would this help me
Rachael Reply
Need to simplify the expresin. 3/7 (x+y)-1/7 (x-1)=
Crystal Reply
. After 3 months on a diet, Lisa had lost 12% of her original weight. She lost 21 pounds. What was Lisa's original weight?
Chris Reply
what is nanomaterials​ and their applications of sensors.
Ramkumar Reply
what is nano technology
Sravani Reply
what is system testing?
preparation of nanomaterial
Victor Reply
Yes, Nanotechnology has a very fast field of applications and their is always something new to do with it...
Himanshu Reply
good afternoon madam
what is system testing
what is the application of nanotechnology?
In this morden time nanotechnology used in many field . 1-Electronics-manufacturad IC ,RAM,MRAM,solar panel etc 2-Helth and Medical-Nanomedicine,Drug Dilivery for cancer treatment etc 3- Atomobile -MEMS, Coating on car etc. and may other field for details you can check at Google
anybody can imagine what will be happen after 100 years from now in nano tech world
after 100 year this will be not nanotechnology maybe this technology name will be change . maybe aftet 100 year . we work on electron lable practically about its properties and behaviour by the different instruments
name doesn't matter , whatever it will be change... I'm taking about effect on circumstances of the microscopic world
how hard could it be to apply nanotechnology against viral infections such HIV or Ebola?
silver nanoparticles could handle the job?
not now but maybe in future only AgNP maybe any other nanomaterials
can nanotechnology change the direction of the face of the world
Prasenjit Reply
At high concentrations (>0.01 M), the relation between absorptivity coefficient and absorbance is no longer linear. This is due to the electrostatic interactions between the quantum dots in close proximity. If the concentration of the solution is high, another effect that is seen is the scattering of light from the large number of quantum dots. This assumption only works at low concentrations of the analyte. Presence of stray light.
Ali Reply
the Beer law works very well for dilute solutions but fails for very high concentrations. why?
bamidele Reply
how did you get the value of 2000N.What calculations are needed to arrive at it
Smarajit Reply
Got questions? Join the online conversation and get instant answers!
QuizOver.com Reply

Get the best Algebra and trigonometry course in your pocket!

Source:  OpenStax, Ece 420 fall 2013. OpenStax CNX. Sep 26, 2013 Download for free at http://cnx.org/content/col11560/1.3
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Ece 420 fall 2013' conversation and receive update notifications?