discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Discuss-gnuradio] cross correlation in the time domain and through Four


From: jmfriedt
Subject: [Discuss-gnuradio] cross correlation in the time domain and through Fourier tranform ?
Date: Thu, 22 Jun 2017 20:00:55 +0200

I am trying to understand how to use the output of FFT vectors for computation,
rather than just displaying spectra (FFT Sink). I have assembled a pseudo-random
generators (linear feedback shift registers) which output two identical 
pseudo-random
sequences (PRN) when clocked by the sound card output at different rates. This 
all works very 
well. My objective is to demonstrate fine time stamping by cross-correlating 
these two 
streams.

In http://jmfriedt.sequanux.org/xcorr_grc.png, recording the PRN sequence 
(Audio source)
as the two PRNs are generated at slightly different clock frequencies (here 
20.0 and 20.2 kHz)
and multiplying one sequence with the other (ie cross-correlating) generates 
the periodic
cross correlation peaks, all is fine (http://jmfriedt.sequanux.org/xcorr1.png or
http://jmfriedt.sequanux.org/xcorr2.png bottom chart). The frequency offset 
between the two
7-bit long PRN is 200 Hz, so the delay between cross correlation peaks is 127*5 
ms=635 ms
as observed, all is good.

However I'd like to demonstrate the same effect when going through the Fourier 
domain. I convert
the stream to vector (4096 sample long is much more than the about 256-sample 
long PRN), multiply
one vector with the complex conjugate of the other, iFFT the result, making 
sure I don't swap
quadrants (I checked that FFT -> iFFT without swapping creates the same 
original signal), back to stream
and display the result -> same pictures as above, top graphs.
1. is this the correct way of processing Fourier transforms of incoming signals
2. why are the cross-correlation peaks generated in the Fourier domain not 
located at the exact same time
than those generated in the time domain ? I could understand some lag due to 
the low pass filter or 
accumulating the data in the vector, but here I get a bit of jitter of cross 
correlation peaks generated
through the Fourier transform wrt those generated in the time domain.

Obvisouly this should all end up in a passive radar measurement: I can live 
with time-domain 
cross-correlation calculation, but this is the first time I am using the stream 
-> vector 
functionality so I'd like to understand the consequences.

Thanks, JM

-- 
JM Friedt, FEMTO-ST Time & Frequency/SENSeOR, 26 rue de l'Epitaphe, 25000 
Besancon, France



reply via email to

[Prev in Thread] Current Thread [Next in Thread]