<< Chapter < Page Chapter >> Page >
// lab4b.c // Uses PN generation, IIR filtering, and autocorrelation // code by Matt Kleffner -9/2004 // Based on swi_process.c by Educational DSP #include "dsk5510_dual3006cfg.h" #include "dsk5510.h" #include "swi_process.h" #include "dsplib.h" #include "lab4b.h" /* Define N here in header file */ /* function defined in pn.c */ void rand_fillbuffer(void); /* IIR values and buffers (declared in c_fft_given_iirc.asm) */ #define IIR_order 4 extern int scale; extern int coef[IIR_order]; extern int state[IIR_order]; /* Pointer to state buffer location */ int iirptr; extern unsigned int *iseed; /* seed for rand_fillbuffer() and randbit() */ /* function defined in iirfilt.c */ void iirfilt(void); /* function defined in autocorr.c */ void autocorr(void); /* Function defined by c_fft_given_iirc.asm */ //void bit_rev_fft(void); /* FFT data buffers (declared in c_fft_given_iirc.asm) */ extern int bit_rev_data[N*2]; /* Data output for bit-reverse function */ extern int fft_data[N*2]; /* In-place FFT input & Output array */ /* Our input/output buffers */ int autocorr_in[N]; int autocorr_out[N]; // all data processing should be done in SWI_ProcessBuffer void SWI_ProcessBuffer() { static unsigned int mbox_value = 0; short *psrc, *pdest; unsigned int i; mbox_value |= SWI_getmbox(); // buffers are only processed when both transmit and receive are ready if((mbox_value & DMA_RECEIVE_DONE) && (mbox_value & DMA_TRANSMIT_DONE)) { mbox_value = 0; // get buffer pointers psrc = receive_buffer[receive_buffer_to_process_index]; pdest = transmit_buffer[transmit_buffer_to_fill_index]; /* First, transfer inputs and outputs */ for (i = 0; i < N; i++) { pdest[4*i] = autocorr_in[i]; pdest[4*i+1] = bit_rev_data[i*2] << 8; /* Some statements useful in debugging */ /* pdest[4*i] = psrc[4*i+2]; */ /* Be sure to comment out PN-sequence generation */ /* when using the next two lines */ //autocorr_in[i] = psrc[4i+2]; } /* Last, set the DC coefficient to -1 for a trigger pulse */ pdest[0] = -32768; /* Generate PN input */ rand_fillbuffer(); /* Filter input */ iirfilt(); /* Calculate autocorrelation */ autocorr(); /* Transfer autocorr output to FFT input buffer */ for (i = 0; i < N; i++) { fft_data[i*2] = autocorr_out[i]; fft_data[i*2+1] = 0; } // Bit-reverse and compute FFT cfft((DATA *)fft_data,N, SCALE); cbrev((DATA *)fft_data,(DATA *)bit_rev_data,N); /* Done, wait for next time around! */ receive_buffer_processed = 1; // flag receive buffer as processed transmit_buffer_filled = 1; // flag output buffer as full } } // lab4bmain.c // based on main.c by Educational DSP // Initializes autocorr_out, state, and iseed. // Can be modified for optimization. #include "dsk5510_dual3006cfg.h" #include "dsk5510.h" #include <csl.h> #include "lab4b.h" #define IIR_order 4 extern int iirptr; unsigned int *iseed; extern int autocorr_out[N]; extern int state[IIR_order]; void init_DMA(); void main() { int i; DSK5510_init(); // init BSL DSK5510_rset(DSK5510_MISC, 0x03); // route McBSP0/1 to J3 // Initialize autocorr_out to zero since some values will remain zero for (i = 0; i < N; ++i) { autocorr_out[i] = 0; } for ( i = 0; i < IIR_order; ++i) state[i] = 0; // Start McBSP0 I2S slave MCBSP_start(hMcbsp0, MCBSP_XMIT_START | MCBSP_RCV_START | MCBSP_SRGR_START | MCBSP_SRGR_FRAMESYNC, 220); // Start McBSP1 I2S master MCBSP_start(hMcbsp1, MCBSP_XMIT_START | MCBSP_RCV_START | MCBSP_SRGR_START | MCBSP_SRGR_FRAMESYNC, 220); init_DMA(); // configure DMA and interrupts *iseed = 1; iirptr = 0; return; // let DSP/BIOS scheduler take over }

Questions & Answers

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
Maciej
Do somebody tell me a best nano engineering book for beginners?
s. Reply
what is fullerene does it is used to make bukky balls
Devang Reply
are you nano engineer ?
s.
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.
Virgil
is Bucky paper clear?
CYNTHIA
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.
Harper
Do you know which machine is used to that process?
s.
how to fabricate graphene ink ?
SUYASH Reply
for screen printed electrodes ?
SUYASH
What is lattice structure?
s. Reply
of graphene you mean?
Ebrahim
or in general
Ebrahim
in general
s.
Graphene has a hexagonal structure
tahir
On having this app for quite a bit time, Haven't realised there's a chat room in it.
Cied
what is biological synthesis of nanoparticles
Sanket Reply
what's the easiest and fastest way to the synthesize AgNP?
Damian Reply
China
Cied
types of nano material
abeetha Reply
I start with an easy one. carbon nanotubes woven into a long filament like a string
Porter
many many of nanotubes
Porter
what is the k.e before it land
Yasmin
what is the function of carbon nanotubes?
Cesar
I'm interested in nanotube
Uday
what is nanomaterials​ and their applications of sensors.
Ramkumar Reply
what is nano technology
Sravani Reply
what is system testing?
AMJAD
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
AMJAD
what is system testing
AMJAD
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
Hello
Uday
I'm interested in Nanotube
Uday
this technology will not going on for the long time , so I'm thinking about femtotechnology 10^-15
Prasenjit
can nanotechnology change the direction of the face of the world
Prasenjit 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
Good
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, Digital signal processing laboratory (ece 420 55x). OpenStax CNX. Jan 18, 2010 Download for free at http://cnx.org/content/col10397/1.10
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 55x)' conversation and receive update notifications?

Ask