Presentation is loading. Please wait.

Presentation is loading. Please wait.

Convolution, GPS and the TigerSHARC XCORRS instr.

Similar presentations


Presentation on theme: "Convolution, GPS and the TigerSHARC XCORRS instr."— Presentation transcript:

1 Convolution, GPS and the TigerSHARC XCORRS instr.
M. Smith Electrical Engineering, University of Calgary ucalgary.ca 12/30/2018

2 Overview Correlation and the FIR Correlation and GPS
Correlation in the time domain Correlation in the frequency domain Some basic characteristics of the XCORRS instruction Lab 3 – do 2 taps of real FIR filter per cycle XCORRS – do 128 taps of complex FIR filter per cycle 12/30/2018

3 Already discussed in class for Lab. 1
You have a signal with amplitude samples A A 0 0 –A –A 0 0 A A 0 0 –A –A 0 0 A A You have 4 FIR filters with coefficients Which FIR produces the maximum amplitude – and when does that maximum amplitude occur? 12/30/2018

4 Study 1 – Review Remember to flip the coefficient order
A A 0 0 –A –A 0 0 A A 0 0 –A –A 0 0 A A Incoming signals Output 4A Output 2A Output 0 Output -2A Output -4A Output 2A Output 2A Output 0 Output 0 etc 12/30/2018

5 Already discussed in class for Lab
Already discussed in class for Lab. 1 (Where I forget to flip coeff in examples You have a signal with amplitude samples A A 0 0 –A –A 0 0 A A 0 0 –A –A 0 0 A A You have 4 FIR filters with coefficients MATCHED FILTER MATCHED FILTER Now imagine that the FIR filter length is 1024 – the differences between the maximums of the outputs will increase Now imagine that the data characteristics are so that the matches between one given filter is maximized and the matches between all the other filters is minimized ORTHO-NORMAL Now we are talking about the basics of GPS Not talking about “FIR” any more, we are talking about “cross-correlation” – “vector products” – “inner products”. Same mathematics, different application 12/30/2018

6 GPS Number of satellites circling in the earth – 24?
Each are transmitting a unique binary signal The binary signals are carefully chosen and carefully synchronized clocks You have a cheap local receiver, you know the unique binary signals from each satellite You have the FIR code from Lab. 1 – which you are going to use for cross-correlation Laboratory #5 – determine where you are on the earth’s surface – are you really in the 515 class, or is it just a dream and you are “tucked up safe in bed” after last night’s party? 12/30/2018

7 GPS Positioning Concepts
(1) For now make 2 assumptions: We know the distance to each satellite We know where each satellite is With this information from 2 satellites – you know you are on a “plane of intersection. Require 3 satellites for a 3-D position in this “ideal” scenario Requires 4 satellites to account for local receiver clock drift. 12/30/2018

8 GPS Signal Structure Each satellite transmits 2 carrier frequencies referred to as L1 (1575 MHz) and L2 (1227 MHz) Each carrier frequency is BPSK modulated with a unique PRN (pseudo random number) code The PRN code on L1 is called CA code (coarse acquisition), The PRN code on L2 is called P code (precise) CA code takes 1 ms for full PRN transmission at 1MHz chip (bit) rate. P code takes 1.5 s for full PRN transmission at ~10MHz chip rate Also modulated on each carrier is 50 Hz data that includes the current position of the satellite 12/30/2018

9 Determining Time Use the PRN code to determine time
Signal send by satellite Signal received by you You know the signal sent Perform correlations till you get a match (1) Use the PRN code to determine time Use time to determine distance to the satellite distance = speed of light * time 12/30/2018

10 Algorithms to Find PRN Phase
Time-domain Cross correlation: 1/N ∑ x1 (n) * x2(n) Coding equivalent to FIR filter, Lab. 1 For each of the possible 24 satellites do For each of the N possible shift positions of the data do For N points of data and N point of filter do complex FIR filter of N points 24 * N * N complex multiplications and additions complex add = (A + jB) + (C + jD) = (A+ B) + j(C + D) = 2 adds complex mult = (A + jB) * (C + jD) = (AC - BC) + j(AD + BC) = 2 adds and 4 multiplications 24 * 12 * N * N operations “each time N = 1024 then that’s around 300 M ops + all the other stuff you need to do 12/30/2018

11 Algorithms to Find PRN Phase
Time-domain Cross correlation: 1/N ∑ x1 (n) * x2(n) Coding equivalent to FIR filter, but need to filter N sets of data, each shifted by one data point Correlation of perfectly matching signals gives a maximum value Correlation of 2 random data sequences tends to 0 PRN code from different satellites are designed to correlate to 0. D 12/30/2018

12 Algorithms to Find PRN Phase
Time-domain Cross correlation: 1/N ∑ x1 (n) * x2(n) Correlation in time domain equates to multiplication in frequency domain Pre- calculate Discrete Fourier Transform of Filter coefficients X2(k) = DFT[x2(n)] Calculate Discrete Fourier Transform of data values – once for all 24 satellites X1(k) = DFT[x1(n)] requires N log(N) complex operations Perform multiplication in Fourier domain – requires N complex operations Perform Inverse discrete Fourier Transform 1/N F-1[X1(k)X2(k)] -- N log(N) complex operations Total N( log(N) ) complex operations – compared to 24 * N * N N *N = 1024 * N log N = 1024 * log(1024) = 1024 * 10 The “long approach” is “faster” D 12/30/2018

13 Remember from previous lecture Know the customization issues
The satellite data has a special format 1, -1, j, -j, 1 +j, 1 –j etc, and nothing else Essentially doing 1 bit complex arithmetic Do the “ASP” (application specific processor) thing on the TigerSHARC XCORRs instruction 12/30/2018

14 Where does the CLU fit in?
12/30/2018

15 THEORY Mathematical definition
XCORRS Uses registers TR D C And something called CUT THEORY Mathematical definition 12/30/2018

16 Standard XCORRS instruction 16 “special” correlations performed in 1 cycle 32 correlations if also using Y register Lower 46 bits ofTHR1:0 R7:3 Quad fetches will be needed TR0, TR1, TR2 ……. TR15 12/30/2018

17 TR15:0 = XCORRS(R7:4, THR3:0) TR0 += D7 * C22 + D6 * C21 +… 8 taps
……….. TR15 += D7 * C7 + D6 * C6 + … 8 taps 64 taps each cycles – on both x and y compute blocks – if set up properly 128 taps each cycle – these are “complex taps” compared to 2 real taps / cycle after lab. 3 12/30/2018

18 TR15:0 = XCORRS(R7:4, THR3:0) (CUT -7)
TR0 += D7 * C22 + D6 * C21 + … 8 taps TR1 += D7 * C21 + D6 * C20 + … 8 taps ……….. TR14 += D7 * C8 + D6 * C taps TR15 += D7 * C taps 12/30/2018

19 TR15:0 = XCORRS(R7:4, THR3:0) (CUT -15)
TR0 += D7 * C22 + D6 * C21 … 8 taps TR1 += D7 * C21 + D6 * C20 … 7 taps ……….. TR7 += D7 * C … 1 taps TR0 += … 0 taps TR15 += 0 … 0 taps 12/30/2018

20 TR15:0 = XCORRS(R7:4, THR3:0) (CUT +15)
TR0 += 0 … taps TR1 += D0 *C taps ……….. TR7 += D6 * C14 + D5 * C13 + … 7 taps TR0 += D7 * C14 + D6 * C13 + … 8 taps TR15 += D7 * C7 + D6 * C7 + … 8 taps 12/30/2018

21 CLU Interesting possibilities for independent study
“Q9” on final – you will always find a “make up your own question and answer it” Bring in your head Relevant to 4th year course Not something we have done in the class or the labs, or presented by your colleagues (or self) as those topics are covered else where 12/30/2018

22 12/30/2018

23 12/30/2018

24 12/30/2018

25 12/30/2018

26 12/30/2018

27 6 OPS in 1 cycle in X – ditto in Y
MULTIPLIES ADD REAL AND IMAG ACCUMULATE 6 OPS in 1 cycle in X – ditto in Y 12/30/2018

28 Special shifter operations
12/30/2018

29 12/30/2018

30 Bit reverse – essential for FFT operations You will find in any DSP processor
12/30/2018

31 12/30/2018

32 Program sequencer 12/30/2018

33 12/30/2018

34 12/30/2018

35 Get the fastest hardware loop Code goes on and on
Why is all this information necessary? 12/30/2018

36 What exactly does all this mean?
12/30/2018

37 12/30/2018

38 12/30/2018

39 12/30/2018

40 12/30/2018

41 Overview Correlation and the FIR Correlation and GPS
Correlation in the time domain Correlation in the frequency domain Some basic characteristics of the XCORRS instruction Lab 3 – do 2 taps of real FIR filter per cycle XCORRS – do 128 taps of complex FIR filter per cycle Next class – looking at using the XCORRS instruction – this was 2005 Lab. 4 exercise 12/30/2018


Download ppt "Convolution, GPS and the TigerSHARC XCORRS instr."

Similar presentations


Ads by Google