I want to correlate two signals one of them is constant (locally generated) code and other signal is circular (repeating the first code periodically) which sampled in Fs and phase shifted version of first signal. In Matlab for example first signal (1.023 MHz) is 1023 bytes long in 1 ms (locally generated constant code) and second signal sampled at Fs (for example 16.368 MHz) is 16368 bytes long in 1 ms. There should be 16 sample for each code chip so for correlation constant code chips firstly replicated 16 times to reach 16368 byte. And below operations made by us to find phase.
ts = 1 / 16368000;
samplesPerCode = 16;
tc = 1 /1023000;
codeValueIndex = ceil(((1 / ts) * (1:samplesPerCode)) / tc);
codeValueIndex(end) = 1023;
code = codeNotRep(codeValueIndex); %code replicated to reach 1ms sampled data size
codeFreqDom = conj(fft(code)); %constant periodic code’s fft and conjugate
IQfreqDom1 = fft(IQCompData1); %incoming signal (periaodically repeats code but selected may be phase shifted)
convCodeIQ1 = IQfreqDom1 .* codeFreqDom; %correlation
acqRes1 = abs(ifft(convCodeIQ1)) .^ 2; %enery distributon to find phase
When I examined Matlab’s help It says if data is not power of two Matlab does DFT instead of FFT (our data is 16368 byte which is not power of two). But TEXAS C64X library has power of two FFT library and so if I make zero padding to constant code and incoming signal to align 16384 byte (power of 2) my codes circular property disappears and correlation energy decreases.
Do you have any idea how can I get rid of zero padding bad affect ? How can I convert Matlab’s FFT function to “C” language to use at our TEXAS C64X processor?
Thanks for help.
All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.
TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs andembedded processors, along with software, tools and the industry’s largest sales/support staff.