# 0.2 Lab 1: lab  (Page 2/3)

 Page 2 / 3

## 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]` .

Complementary angles
Commplementary angles
Complementary angles
Idrissa
hello
Sherica
im all ears I need to learn
Sherica
Complementary angles
Idrissa
yes
Sherica
what is a good calculator for all algebra; would a Casio fx 260 work with all algebra equations? please name the cheapest, thanks.
a perfect square v²+2v+_
kkk nice
algebra 2 Inequalities:If equation 2 = 0 it is an open set?
or infinite solutions?
Kim
y=10×
if |A| not equal to 0 and order of A is n prove that adj (adj A = |A|
rolling four fair dice and getting an even number an all four dice
Kristine 2*2*2=8
Differences Between Laspeyres and Paasche Indices
No. 7x -4y is simplified from 4x + (3y + 3x) -7y
is it 3×y ?
J, combine like terms 7x-4y
im not good at math so would this help me
Need to simplify the expresin. 3/7 (x+y)-1/7 (x-1)=
. After 3 months on a diet, Lisa had lost 12% of her original weight. She lost 21 pounds. What was Lisa's original weight?
what is nanomaterials​ and their applications of sensors.
what is nano technology
what is system testing?
preparation of nanomaterial
Yes, Nanotechnology has a very fast field of applications and their is always something new to do with it...
what is system testing
what is the application of nanotechnology?
Stotaw
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
Azam
anybody can imagine what will be happen after 100 years from now in nano tech world
Prasenjit
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
Azam
name doesn't matter , whatever it will be change... I'm taking about effect on circumstances of the microscopic world
Prasenjit
how hard could it be to apply nanotechnology against viral infections such HIV or Ebola?
Damian
silver nanoparticles could handle the job?
Damian
not now but maybe in future only AgNP maybe any other nanomaterials
Azam
can nanotechnology change the direction of the face of the world
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.
the Beer law works very well for dilute solutions but fails for very high concentrations. why?
how did you get the value of 2000N.What calculations are needed to arrive at it
Got questions? Join the online conversation and get instant answers!