<< Chapter < Page Chapter >> Page >
You will implement a multirate system that includes three fininte impulse response filters.


As this is your first experience with the C environment, most of the programming for the assignment is to be done directlyin assembly. A C skeleton will provide access to input samples and a way to output samples. From the C skeleton, anassembly module for implementing the complete multirate system (for a single sample) is called. In the assembly module, thedownsampling and upsampling blocks are implemented by using a loop or counter to determine which samples to keep and when toinsert zeros.

As there was a core file for working in the assembly environment (Labs 0-2), there is a core file for the Cenvironment ( V:\ece320\54x\dspclib\core.asm ) which handles the interrupts from the CODEC (A/D and D/A) andthe serial port. Here, we will describe the important aspects of the core code necessary to complete the assignment. Thecomplete documentation on the core code developed for the C environment will be made available soon.

C skeleton

Let's examine the following C main program lab3main.c which calls assembly FIR filter functions init_filter and filter .

1 #include "v:/ece320/54x/dspclib/core.h" /* Declarations for core file */ 2 void init_filter(void); /* Prototypes for assembly functions */ 3 int filter(int sample); 4 extern int dec_rate; /* Default decimation rate is 4 */ 5 6 main() 7 { 8 int *Rcvptr,*Xmitptr; /* pointers to Xmit & Rcv Bufs */ 9 int i, sample1, sample2; 10 11 init_filter(); /* Initialize the filter */ 12 13 while( 1 ) 14 { 15 /* Wait for a new block of samples */ 16 WaitAudio(&Rcvptr,&Xmitptr); 17 18 /* Process a block of samples */ 19 for( i = 0; i < BlockLen; i ++ ) 20 { 21 sample1 = Rcvptr[4*i]; /* Ch1 input sample */ 22 sample2 = Rcvptr[4*i+2]; /* Ch2 input sample */ 23 24 Xmitptr[6*i] = sample1; /* First output is input */ 25 Xmitptr[6*i+1] = filter(sample1); /* Secound output is result */ 26 } 27 28 i = SerialRX(); /* Check serial port */ 29 if( i > 0 ) 30 dec_rate = i; /* Save new decimation rate if we got it */ 31 } 32 }

In the main program, an infinite loop operates over the input samples accessed by the pointer Rcvptr and writes the output samples via the pointer Xmitptr . In C, pointers may be used as array names so that Xmitptr[0] is the first word pointed to by Xmitptr . The function WaitAudio is a assembly function in the core code which handles the CODEC interrupts. It returns a blockof BlockLen samples and writes BlockLen samples to each of the six channels. As in the assembly core, the input samples are not inconsecutive order. The right and left inputs are offset from Rcvptr respectively by 4 i and 4 i 2 , i 0 ,, BlockLen 1 . The six output channels are accessed consecutively as offsets from Xmitptr .

Questions & Answers

Is there any normative that regulates the use of silver nanoparticles?
Damian Reply
what king of growth are you checking .?
What fields keep nano created devices from performing or assimulating ? Magnetic fields ? Are do they assimilate ?
Stoney Reply
why we need to study biomolecules, molecular biology in nanotechnology?
Adin Reply
yes I'm doing my masters in nanotechnology, we are being studying all these domains as well..
what school?
biomolecules are e building blocks of every organics and inorganic materials.
anyone know any internet site where one can find nanotechnology papers?
Damian Reply
sciencedirect big data base
Introduction about quantum dots in nanotechnology
Praveena Reply
what does nano mean?
Anassong Reply
nano basically means 10^(-9). nanometer is a unit to measure length.
do you think it's worthwhile in the long term to study the effects and possibilities of nanotechnology on viral treatment?
Damian Reply
absolutely yes
how to know photocatalytic properties of tio2 nanoparticles...what to do now
Akash Reply
it is a goid question and i want to know the answer as well
characteristics of micro business
for teaching engĺish at school how nano technology help us
Do somebody tell me a best nano engineering book for beginners?
s. Reply
there is no specific books for beginners but there is book called principle of nanotechnology
what is fullerene does it is used to make bukky balls
Devang Reply
are you nano engineer ?
fullerene is a bucky ball aka Carbon 60 molecule. It was name by the architect Fuller. He design the geodesic dome. it resembles a soccer ball.
what is the actual application of fullerenes nowadays?
That is a great question Damian. best way to answer that question is to Google it. there are hundreds of applications for buck minister fullerenes, from medical to aerospace. you can also find plenty of research papers that will give you great detail on the potential applications of fullerenes.
what is the Synthesis, properties,and applications of carbon nano chemistry
Abhijith Reply
Mostly, they use nano carbon for electronics and for materials to be strengthened.
is Bucky paper clear?
carbon nanotubes has various application in fuel cells membrane, current research on cancer drug,and in electronics MEMS and NEMS etc
so some one know about replacing silicon atom with phosphorous in semiconductors device?
s. Reply
Yeah, it is a pain to say the least. You basically have to heat the substarte up to around 1000 degrees celcius then pass phosphene gas over top of it, which is explosive and toxic by the way, under very low pressure.
Do you know which machine is used to that process?
how to fabricate graphene ink ?
for screen printed electrodes ?
What is lattice structure?
s. Reply
of graphene you mean?
or in general
in general
Graphene has a hexagonal structure
On having this app for quite a bit time, Haven't realised there's a chat room in it.
what is biological synthesis of nanoparticles
Sanket Reply
how did you get the value of 2000N.What calculations are needed to arrive at it
Smarajit Reply
Privacy Information Security Software Version 1.1a
Berger describes sociologists as concerned with
Mueller Reply
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

Get the best Algebra and trigonometry course in your pocket!

Source:  OpenStax, Ece 320 - spring 2003. OpenStax CNX. Jan 22, 2004 Download for free at http://cnx.org/content/col10096/1.2
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Ece 320 - spring 2003' conversation and receive update notifications?