<< Chapter < Page Chapter >> Page >

Appendix e: additional routines for psd estimator





/* ECE420, Lab 4, Reference PN Generator Implementation (Non-Optimized) */ /* Matt Kleffner 08/04 */ /* Original by Michael Frutiger 02/24/04 */ /* Use governed by the Creative Commons Attribution License */ #include "lab4b.h" extern unsigned int *iseed; extern int autocorr_in[N]; /* Returns as an integer a random bit, based on the 15 lowest significant bits in iseed (which is modified for the next call). */ int randbit() { int newbit; /* XOR bits 15, 1 and 0 of iseed */ newbit = (*iseed >> 15) & 1 ^ (*iseed >> 1) & 1 ^ *iseed & 1; /* Leftshift the seed and put the result of the XOR's in bit 1. */ *iseed=(*iseed << 1) | newbit; return(newbit); } void rand_fillbuffer(void) { int i; for (i = 0; i < N; ++i) { if (randbit()) autocorr_in[i] = 32767; else autocorr_in[i] = -32767; } } /* Simple, unoptimized IIR filter (feedback only) */ /* for TMS320C54X series DSPs */ /* Copyright September 2005 by Matt Kleffner */ /* under the Creative Commons Attribution License */ /* Works for TMS320C55X series as well */ #include "lab4b.h" #include "intrinsics.h" /* 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]; /* Arrays declared in main routine */ extern int autocorr_in[N]; extern int autocorr_out[N]; /* Pointer to state buffer location */ extern int iirptr; void iirfilt() { int i, j; _set_fract_bit(); /* Filter PN input */ for (i = 0; i < N; ++i) { int sum = 0; /* Calculate and sum all feedback terms except the "oldest" one */ for (j = 0; j < (IIR_order-1); ++j) { sum += _i_mul_fract_fb1_ii(coef[j],state[iirptr]); /* Avoid usage of "modulo" routine */ iirptr++; if (iirptr == IIR_order) iirptr = 0; } /* Calculate and sum oldest feedback term without incrementing iirptr */ sum += _i_mul_fract_fb1_ii(coef[IIR_order-1],state[iirptr]); /* Calculate direct input contribution */ sum += _i_mul_fract_fb1_ii(scale,autocorr_in[i]); autocorr_in[i] = sum; state[iirptr] = autocorr_in[i]; } _reset_fract_bit(); } /***********************************************************/ /* autocorr.c */ /* Copyright August 2004 by Matt Kleffner */ /* under the Creative Commons Attribution License */ /* */ /* Simple, unoptimized autocorrelation function */ /* for ECE 420 (TMS320C54X series) */ /* */ /* #defines expected in lab4b.h */ /* L: length of data in autocorr_in buffer */ /* N: length of data in autocorr_out buffer */ /* logL: log base 2 of L (used for scaling output) */ /* M: Largest positive lag of autocorrelation desired */ /* (must be < L and < N/2) */ /* */ /* 16-bit-limited input/output (must be defined elsewhere) */ /* autocorr_in: buffer for input data (L pts) */ /* autocorr_out: buffer for output data (N pts) */ /* N must be >= 2*M+1 */ /* assumed to be full of zeros at start */ /* output in zero-phase form */ /***********************************************************/ /* Works for TMS320C55X series */ #include "lab4b.h" #include "intrinsics.h" extern int autocorr_in[L]; extern int autocorr_out[N]; void autocorr(void) { int i,j,temp; _set_fract_bit(); for(i=0;i<=M;++i) { long int sum=0; for(j=0;j<(L-i);++j) { temp = _i_mul_fract_fb1_ii(autocorr_in[j],autocorr_in[j+i]); sum += temp; } autocorr_out[i]=(int)(sum >> logL); } _reset_fract_bit(); /* Copy values for negative indeces at end of buffer */ for(i=1,j=N-1;i<=M;++i,--j) { autocorr_out[j]=autocorr_out[i]; } } ; c_fft_given_iirc.asm ; Designed for use in lab4b for ECE420 .ARMS_off ;enable assembler for ARMS=0 .CPL_on ;enable assembler for CPL=1 .mmregs ;enable mem mapped register names .global _bit_rev_data .global _fft_data .global _state .global _scale .global _coef .copy "macro.asm" .sect ".data" N .set 1024 .align 4*N _bit_rev_data .space 16*2*N .align 4*N _fft_data .space 16*2*N ; IIR filter .align 4 _coef .word 0 .word 0 .word 0 .word -13421 _state .space 16*4 _scale .word 19345 .sect ".text"

Questions & Answers

what is the stm
Brian Reply
is there industrial application of fullrenes. What is the method to prepare fullrene on large scale.?
industrial application...? mmm I think on the medical side as drug carrier, but you should go deeper on your research, I may be wrong
How we are making nano material?
what is a peer
What is meant by 'nano scale'?
What is STMs full form?
scanning tunneling microscope
how nano science is used for hydrophobicity
Do u think that Graphene and Fullrene fiber can be used to make Air Plane body structure the lightest and strongest. Rafiq
what is differents between GO and RGO?
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
what is Nano technology ?
Bob Reply
write examples of Nano molecule?
The nanotechnology is as new science, to scale nanometric
nanotechnology is the study, desing, synthesis, manipulation and application of materials and functional systems through control of matter at nanoscale
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
How can I make nanorobot?
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
how can I make nanorobot?
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.
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, 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?