<< Chapter < Page Chapter >> Page >

Appendix e: additional routines for psd estimator

pn.c

iirfilt.c

autocorr.c

c_fft_given_iirc.asm

/* 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

where we get a research paper on Nano chemistry....?
Maira Reply
what are the products of Nano chemistry?
Maira Reply
There are lots of products of nano chemistry... Like nano coatings.....carbon fiber.. And lots of others..
learn
Even nanotechnology is pretty much all about chemistry... Its the chemistry on quantum or atomic level
learn
Google
da
no nanotechnology is also a part of physics and maths it requires angle formulas and some pressure regarding concepts
Bhagvanji
hey
Giriraj
Preparation and Applications of Nanomaterial for Drug Delivery
Hafiz Reply
revolt
da
Application of nanotechnology in medicine
what is variations in raman spectra for nanomaterials
Jyoti Reply
I only see partial conversation and what's the question here!
Crow Reply
what about nanotechnology for water purification
RAW Reply
please someone correct me if I'm wrong but I think one can use nanoparticles, specially silver nanoparticles for water treatment.
Damian
yes that's correct
Professor
I think
Professor
Nasa has use it in the 60's, copper as water purification in the moon travel.
Alexandre
nanocopper obvius
Alexandre
what is the stm
Brian Reply
is there industrial application of fullrenes. What is the method to prepare fullrene on large scale.?
Rafiq
industrial application...? mmm I think on the medical side as drug carrier, but you should go deeper on your research, I may be wrong
Damian
How we are making nano material?
LITNING Reply
what is a peer
LITNING Reply
What is meant by 'nano scale'?
LITNING Reply
What is STMs full form?
LITNING
scanning tunneling microscope
Sahil
how nano science is used for hydrophobicity
Santosh
Do u think that Graphene and Fullrene fiber can be used to make Air Plane body structure the lightest and strongest. Rafiq
Rafiq
what is differents between GO and RGO?
Mahi
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
Rafiq
if virus is killing to make ARTIFICIAL DNA OF GRAPHENE FOR KILLED THE VIRUS .THIS IS OUR ASSUMPTION
Anam
analytical skills graphene is prepared to kill any type viruses .
Anam
Any one who tell me about Preparation and application of Nanomaterial for drug Delivery
Hafiz
what is Nano technology ?
Bob Reply
write examples of Nano molecule?
Bob
The nanotechnology is as new science, to scale nanometric
brayan
nanotechnology is the study, desing, synthesis, manipulation and application of materials and functional systems through control of matter at nanoscale
Damian
Is there any normative that regulates the use of silver nanoparticles?
Damian Reply
what king of growth are you checking .?
Renato
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
?
Kyle
yes I'm doing my masters in nanotechnology, we are being studying all these domains as well..
Adin
why?
Adin
what school?
Kyle
biomolecules are e building blocks of every organics and inorganic materials.
Joe
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!
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?

Ask