Hi Alec For wide bandwidth signals, samples are presented on the FPGA in parallel. For example, imagine you have a timestream sampled at 400 MSPS, and your FPGA clock is only set to 200 MHz (this is probably the case here). To cope, the time stream is broken into 'even' and 'odd' samples:
ts = [0 1 2 3 4 5 6 7 8 9 ...] becomes t_even = [0 2 4 6 8 ...] t_odd = [1 3 5 7 9 ...] The interleaving is just recreating the original timestream. The complex() call takes two real numbers and reinterprets them as a single complex number. So on each clock cycle, four values are written: the real and imag for even, and the real and imag for odd. The script is stitching it into a complex stream. Cheers Danny PS: I haven't opened the tutorial in forever, so please someone correct me if I've made the wrong assumptions. On Wed, Apr 26, 2017 at 6:55 AM, Alec Josaitis <[email protected]> wrote: > Dear Casperites, > > I am trying to readout the cross correlation and auto correlation powers > of signals input into the Roach, when it is programmed as a correlator, > such as in the fourth tutorial > <https://casper.berkeley.edu/wiki/Tutorial_Wideband_Pocket_Correlator>. > In my setup, I am only using inputs from one of the ADCs, and so inputs "C" > and "D" are unused; I use "A" and "B" only, and these can respectively be > interpreted as a signal and reference beam of a holography setup. > > My goal is to measure correlation as some value proportional to the square > of electric fields, and I want to make sure I'm doing this correctly with > the Roach. For example, for cross correlation, my goal is to measure <Ea* > Eb>, where Ei is the electric field of the "i'th" input signal. > > Using the cross power calculation script > <https://github.com/casper-astro/tutorials_devel/blob/master/tut4/poco_plot_cross.py> > , > 4 complex values (8 data points total, 4 real and 4 imaginary) are read > from the roach, such as: 'dir_x0_%s_real' and 'dir_x0_%s_imag'. > > Two of these complex values go into an array called 'interleave_a', and > the other two go into an array called 'interleave_b'. The value 'cross > power' is then reported as 'numpy.abs(interleave_a)', but I do not > understand this, because, first, I thought the output of that 'abs' > function is going to have two elements in this case, or, second, that the > cross power would only be the multiplication of two values, not 4. > > Would someone please be willing to explain the output of the roach, the > 'interleave' arrays, and how precisely I can calculate <Ea*Eb>? Thank you > all in advance for any help you are willing to provide! > > Sincerely, > Alec > > > -- > You received this message because you are subscribed to the Google Groups " > [email protected]" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > -- Danny Price | [email protected] | +1 617-386-3700 -- You received this message because you are subscribed to the Google Groups "[email protected]" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].

