1 / 19

Correlation based GPS System

ECE 6276 Final Project. Correlation based GPS System. Milestone 2 Team 4: Alex Cunningham Phillip Marks Andrew D. Falendysz Meghashyam Adoni. Goals. Our goal is to use a correlator bank to determine which GPS satellite(s) are available at a given location.

paco
Download Presentation

Correlation based GPS System

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. ECE 6276 Final Project Correlation based GPS System Milestone 2 Team 4: Alex Cunningham Phillip Marks Andrew D. Falendysz Meghashyam Adoni

  2. Goals • Our goal is to use a correlator bank to determine which GPS satellite(s) are available at a given location. • To design a high-sensitivity, fast acquisition system to provide accurate identification of weak GPS signals. The extra processing power will be used to integrate weak signals to the point where they can be used to provide a position or timing solution.

  3. System Block Diagram Read New Code Demodulated Input Shift Register N Shift Register Code Correlator Y > Threshold PRN Code Chip Clk Detect Header

  4. C Code Reference Design int main(int argc, char ** argv){  // Load Data    // prep buffers    //   move CA code into an int buffer    float ca_code[CA_CODE_SIZE];    for (int i = 0; i < CA_CODE_SIZE; i++)    {        ca_code[i] = (float) cacode.get();    }    //   clear shift register - possibly optional step    float shift_reg[CA_CODE_SIZE];    // load encoded data into a buffer that can be circled    float* encoded_msg = new float[DATA_CYCLE_SIZE];    for (int i = 0; i < DATA_CYCLE_SIZE; i++)    {        encoded_msg[i] = (float) encoded.get();    }    // a pointer to use with the circular buffer    float * encoded_msg_ptr = encoded_msg +INPUT_OFFSET;     // while waiting on a lock    cout << "Looking for lock..." << endl;    bool haslock = false;    while (!haslock)    {        // load a new piece of data        //cout << "Load more data" << endl;        float new_data = (float) *encoded_msg_ptr;        // perform circular buffering on dataset        if (encoded_msg_ptr = encoded_msg+CA_CODE_SIZE-1)            encoded_msg_ptr = encoded_msg;        else            encoded_msg_ptr++;         //cout << "Using shift register" << endl;        // data will cycle the encoded message continuously        // shift existing data in shift_reg        for (int i = CA_CODE_SIZE-1; i> 0; i--)        {            shift_reg[i] = shift_reg[i-1];        }        // shift into the current register        shift_reg[0] = new_data;        // perform correlation        //cout << "Performing correlation" << endl;        float power;        cout << "correlating..." << endl;        correlator(shift_reg, ca_code, &power, CA_CODE_SIZE);        // if threshold is high enough - break out of loop to acquire lock        //cout << "checking for lock" << endl;        cout << "  correlation: " << power << endl;        if (power > 0.5)            haslock = true;    }    cout << "Lock found!" << endl;    delete[] encoded_msg;    cout << "Freeded Encode" << endl;    return 0;}

  5. Conversion to Catapult C • All code and libraries have been modified by using AC Datatypes. • Catapult C FFT library has been used in lieu of fftw library used in the C implementation. • Loops have been identified and labeled for optimization. • Problems arose with initial implementation • New algorithm is proposed

  6. Test Vectors • A test-bench file has been created with the appropriate test vectors. (CA code and test message at the moment)‏ • These test vectors remain the same as in the previous C implementation. • Binary data files: • C/A Code (128 Bytes)‏ • NAV Message (38 Bytes)‏ • NAV Message Modulated with C/A Code (434 kB)‏

  7. Initial Catapult C Implementation • Top Level • #pragma hls_design_top • void my_gps (ac_channel<real_sample> &data_input, // sample data • code_type cacode[CA_CODE_SIZE], // C/A code for the particular satellite • bool *lock_out, // output for test whether a lock was found • lag_type *lag_out) // time delay in signal for alignment with C/A code • { • static gps_correlator filter_1(); • filter_1.test_for_lock(data_input, cacode, lock_out, lag_out); • }

  8. Initial Catapult C Implementation                         // initialize variables                        max = 0;                        cur_lag = 0;                        static CComplex< real_sample > cSinCosRom[64] = {                        #include "SinCos_256.tab"                        };                        // create fft engines                        FFT_type fft(cSinCosRom);                        IFFT_type ifft(cSinCosRom);                        // shift in new data                        SHIFT:for(int z=(CA_CODE_SIZE-1);z>=0;z--)                         {                                data[z] = (z==0) ? CComplex<real_sample>(data_input.read()) : data[z-1] ;                        }                        FFT_type::MemoryType data_fft(data);                        // convert code to complex array                        LOAD:for(int z=0;z < CA_CODE_SIZE; z++)                         {                                code[z] = CComplex<real_sample>(cacode[z]);                        }                        FFT_type::MemoryType code_fft(code);                        // perform in-place FFT of input                        fft.Run(data_fft, 8);                         // perform FFT of code                        fft.Run(code_fft, 8);                         // conjugate and multiply                        CONJ:for(int ii=0; ii<CA_CODE_SIZE; ii++)                         {                                corr[ii] = CComplex<real_sample>(                                         data[ii].Re() * code[ii].Re() + data[ii].Im() * code[ii].Im(),                                         data[ii].Re() * code[ii].Im() - data[ii].Im() * code[ii].Re());                        }                        IFFT_type::MemoryType corr_time(corr);                        // inverse FFT                        //FFTSimple<SIZE_LOG, real_sample, real_sample, false>(corr);                        //IFFT_type ifft(cSinCosRom);                        ifft.Run(corr_time, 8); // check that this is a good number                        // find max power and location of max power                        MAX:for(int ii=0; ii<CA_CODE_SIZE; ii++)                         {                                if (corr[ii].Re() > max)                                 {                                        max = corr[ii].Re();                                        cur_lag = ii;                                }                        }                        // load answers into results                        if (max > MIN_POWER_THRESH)                        {                                *lag_out = cur_lag;                                *lock_out = true;                        }                        else                         {                                *lag_out = 0;                                *lock_out = false;                        }

  9. Optimization Focus and Plans • Focus: Area • Receivers need to be implemented in parallel, so individual GPS trackers need to be individually small • Reduce the number of bits for the FFT algorithm • Pre-calculate FFT of C/A code to remove optimizations from the main function • Ensure that only one FFT module is created • Unrolling load and maximum-finding loops

  10. Coding Issues • Synthesis engine optimizes out internals of design • Very long synthesis times (~20 minutes)‏ • Doing bit level operations on bytes. • Not able to make FFT/IFFT a block and take advantage of hierarchical coding • This feature isn't available in our version of Catapult C • Problems using FFT examples in CatapultC

  11. Coding Issues • In the end couldn't get actual results • Need a better algorithm that avoids complications of using the FFT • A new algorithm is proposed in the next slides

  12. XNOR Based Correlator • An XNOR operation on the data and C/A code along with an accumulator • Assume data and C/A code are binary signals with values of 1 and -1 • The XNOR truth table is similar to 'standard' binary case • Avoid use of FFT • Much faster than FFT based method and smaller in area • Actually implemented on the data bits

  13. XNOR Based Correlator (Algorithm) • START • Load C/A code into a bit vector • LOOP: • Shift in a data bit • For each bit in the C/A code and the data vector calculator XNOR • Then add result to an accumulator • Back to LOOP

  14. XNOR Based Correlator

  15. XNOR Based Correlator (Code) // returns true if code has been found, falseotherwise #pragma hls_design top bool my_gps(bool data_sample, bool cacode[CODE_SIZE]) { static correlator corr; if(corr.init) { corr.load_code(cacode); return false; } else { return corr.correlate(data_sample); } }

  16. XNOR Based Correlator (Code) // constructor correlator() { // only initializes buffers as necessary CLEAR_DATA:for(int i = 0; i<CODE_SIZE; i++) { data[i] = false; } init = true; } // initialization function - just copies in the code void load_code(bool cacode[CODE_SIZE]) { LOAD_CODE:for(int i = 0; i < CODE_SIZE; i++) { code[i] = cacode[i]; } init = false; } //Main Function bool correlate(bool data_sample) { // reset counter counter = 0; // load data into shift register SHIFT:for(int z=(CODE_SIZE-1);z>=0;z--) { data[z] = (z==0) ? data_sample : data[z-1]; } // loop over registers and score ACC:for(int z=0;z<CODE_SIZE;z++) { counter += (!(code[z] ^ data[z])) ? 1 : -1; } // threshold the counter to set output return counter > DETECT_THRESH; }

  17. Catapult C Resuts

  18. New Optimization Focus and Plans • Focus will remain on area • Use adder tree or distributed arithmetic to cut down on area even more • More unrolling/pipelining of ACC and SHIFT loops • Reduce latency • User doesn’t want to wait for a lock • Parallel operation • Use multiple correlators in parallel

  19. References Global Positioning System Standard Positioning Service Signal Specification, 1995http://www.navcen.uscg.gov/pubs/gps/sigspec/gpssps1.pdf Peter H. Dana, 1992 http://www.colorado.edu/geography/gcraft/notes/gps/gps.html Fast Acquisition, high sensitivity GPS receiver, Inventor: Norman F. Krasner, Assignee: Snaptrack, No. 6289041, Issued: Sep 11, 2001 Parallel correlator for global positioning system receiver, Inventors: Glen W. Brooksby, Gerald J. Michon, Jerome J. Tiemann, Assignee: General Electric Company, No. 5579014, Issued: Nov 26, 1996 Method and apparatus for computing signal correlation, Inventor: Charles Abraham et al, Assignee: Global Locate, Inc, No. 6606346, Issued: Aug 12, 2003 Multiplexed digital correlator, Inventor: Lawrence M. Leibowitz, Assignee: The United States of America as represented by the Secretary of the Navy, No. 4660164, Issued: Apr 21, 1987 Fast algorithms for digital signal processing / Richard E. Blahut. Reading, Mass. : Addison-Wesley Pub. Co., c1985. Global Positioning System Overview http://www.colorado.edu/geography/gcraft/notes/gps/gif/bitsanim.gif Efficient Correlation over a sliding window, Inventor Paul W. Dent, Eric Wang, Assignee: Ericsson Inc, No. 5931893, Issued: Aug. 3rd 1999

More Related