Correlator IP Core April 2005 IP Data Sheet Features Introduction The function of this core is to correlate an incoming data Supports 1- to 8-Bit Input Data Width stream to a stored binary pattern called a code Supports 1 to 256 Channels sequence or coefcient sequence. The data stream Supports a Correlation Window from 8 to may be binary or multi-valued, either signed or 2048 Taps unsigned, and is provided to the core one sample at a Supports Oversampled Input Data from 2x time. The core can be congured to perform either a to 8x real correlation with a single data input stream and a single coefcient sequence, or a complex correlation Supports Real Correlations for Either with two input data streams representing the real and Signed or Unsigned Data imaginary input terms, and two coefcient sequences Supports Complex Correlations for Signed representing the real and imaginary coefcients. Data Allows the User to Tune the Performance of The core provides multiple channel capability and can the Design by Specifying the Values of support up to 256 channels. Correlations for each chan- Several Parameters nel operate independently from each other. Also, up to 256 different coefcient sequences may be stored in the Provides a Selectable Input FIFO for core, and each channel can select which coefcient Maximum Data Throughput sequence is correlated to that channel, so one coef- Allows the User to Specify the Number of cient sequence could be used for all 256 channels if Coefcient Sequences Desired, from 1 to desired. 256 Figure 1. Correlator IP Core External Interface Diagram Correlator clk rst irdy din n:0 crdy din im n:0 ordy chan in n:0 dout n:0 code sel in n:0 dout im n:0 block start in chan out n:0 decim r n:0 block start out numtaps r n:0 seq err coeffaddr n:0 coeffwdat im n:0 coeffwdat n:0 coeffwr 2005 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal. All other brand or product names are trademarks or registered trademarks of their respective holders. The specications and information herein are subject to change without notice. The product described herein is subject to continuing development, and applicable specications and information are subject to change without notice. Such specica- tions and information are provided in good faith actual performance is not guaranteed, as it is dependent on many factors, including the user s system design. www.latticesemi.com 1 ip1039 01.0 Lattice Semiconductor Correlator IP Core General Description A correlation function determines how closely a data sequence matches a reference, or coefcient sequence. A high correlation value means that the data sequence closely matches the coefcient sequence. A low correlation value means that the data sequence is dissimilar to the coefcient sequence. The basic correlator equation is given by: corr win 1 r = d c k = 0,1,,num lags-1 (1) k i+k i i=0 The terms of the equation are: d Input data sequence. The Correlator IP core allows the input sequence to be from 1 to 8 bits wide, and either i signed (twos complement) or unsigned data. c Coefcient (or code) sequence. In the Correlator IP core, this sequence must be loaded into internal memory i prior to a correlation operation. This sequence is always binary 1,0 however, the coefcient sequence may rep- resent either an unsigned sequence 1,0 or a signed sequence +1,-1 . In the case of a signed coefcient sequence, a 1 in the sequence represents a value of +1 and a 0 in the sequence represents a value of -1. The d i and c inputs must both be of the same type, either signed or unsigned. i r Correlation result output sequence (correlation between d and c inputs). k i i corr win Correlation window. This is the number of elements in the input data sequence over which the corre- lation function is calculated. This is also referred to as the number of taps. For the Correlator IP core this num- ber is determined by the user when conguring the core. Once selected, the number of data elements (and coefcient terms) is then xed at this number for all correlation operations. The number of terms in the coefcient sequence is always equal to the number of taps (corr win) specied. num lags Total number of lags for which the correlation is performed. This is also the length of the correlation result sequence, r k. From Equation 1, a correlation operation takes an input data sequence d of length corr win and multiplies each i term in the sequence against the terms of the reference coefcient sequence c, summing the results of all of the i multiplications to produce the result r . The input data sequence is then shifted by one element and the operation is k repeated to produce the next term in the r sequence. This is done num lags times. k In the Correlator IP core, each time a new data term is input to the core, one correlation operation is performed across corr win data and coefcient terms, producing one result, r. The k index in Equation 1 does not apply since the Correlator always produces one new result when it receives one new data value. Old data beyond the dened correlation window size is not held in memory. In addition to the basic correlation function described above, the Correlator IP core can be congured to perform complex correlations, dened by the equation: corr win 1 r = d c k = 0,1,,num lags-1 (2) k i+k i i=0 In this case, the data and coefcient input sequences are both complex and each contains a real input sequence and an imaginary input sequence. For the Correlator IP core, the input data sequence is a sequence of signed (twos complement) numbers from 1 to 8 bits wide, and the coefcient sequence is a binary sequence where a coefcient value of 1 represents +1 and a coefcient value of 0 represents a -1. Equation 2 represents the complex conjugate of c . The complex conjugate multiplication expressed in Equation 2 is given as: i dc = (d c + d c ) + j(d c - d c ) (3) re re im im im re re im 2