It's not clear to me what you want to implement on the FPGA. The USRP typically digitizes and streams continuously. It is not possible to implement a cross correlation of infinite length sequences. Even if finite, you would need to buffer all of the finite samples in order to perform the xcorr. So, perhaps you can discuss further what you are hoping to implement. Rob
On Mon, Mar 7, 2022 at 3:24 AM sp h <[email protected]> wrote: > Awesome, thanks! But how can implement xcorrelate in RFNOC blocks?? It is > very hard to implemented in Verilog > > > On Fri, Feb 25, 2022 at 5:43 PM Rob Kossler <[email protected]> wrote: > >> The MATLAB function xcorr() can be implemented in the time domain as a >> convolution (or similarly an FIR filter) or in the frequency domain as a >> multiplication. So, if the function is "z = xcorr(x,y)", then you can >> implement this as "z = ifft(X.*conj(Y))" where X and Y are the FFTs of x >> and y but with the FFT zero-padded to have length (Lx + Ly). You also need >> to apply a circular shift. Here is MATLAB code that shows the equivalence. >> For long sequences, it might consume less FPGA resources to implement in >> the frequency domain using FFT/IFFT pairs. >> >> >> L = 500; >> >> x = randn(L,1) + 1i*randn(L,1); >> >> y = randn(L,1) + 1i*randn(L,1); >> >> z = xcorr(x,y); >> >> Lfft = 2^nextpow2(2*L-1); >> >> z2 = circshift(ifft(fft(x,Lfft).*conj(fft(y,Lfft)),Lfft),L-1); >> >> plot(abs(z-z2(1:2*L-1))) >> >> On Fri, Feb 25, 2022 at 2:30 AM sp h <[email protected]> wrote: >> >>> Thanks, I know that I can use FFT but I want to implement Xcorrelate >>> like xcorr Matlab directly...as an independent RFNOC blocks >>> >>> >>> On Wed, Feb 23, 2022 at 10:56 AM sp h <[email protected]> wrote: >>> >>>> Thanks, I know that I can use FFT but I want to implement Xcorrelate >>>> like xcorr matlab directly...as a independent RFNOC blocks >>>> >>>> >>>> On Mon, Feb 21, 2022 at 7:40 PM Rob Kossler <[email protected]> wrote: >>>> >>>>> is there a specific function (such as MATLAB 'xcorr') you want to >>>>> implement? You can implement 'cconv' with a pair of FFT/IFFT and complex >>>>> multiplication. If you zero-pad and use 2x length FFTs, you can >>>>> alternatively obtain linear convolution using an overlap-and-add >>>>> configuration. I haven't looked at 'xcorr' specifically, but my guess is >>>>> that you could do what you want with an FFT/IFFT pair. >>>>> Rob >>>>> >>>>> On Mon, Feb 21, 2022 at 6:36 AM sp h <[email protected]> wrote: >>>>> >>>>>> How can create an RFNOC correlate block for USRP? >>>>>> This thread is created to share results on searching how we can >>>>>> correlate RFNOC blocks... >>>>>> Anyone that had an idea, I'm glad to hear it... >>>>>> thanks in advance >>>>>> >>>>>> _______________________________________________ >>>>>> USRP-users mailing list -- [email protected] >>>>>> To unsubscribe send an email to [email protected] >>>>>> >>>>>
_______________________________________________ USRP-users mailing list -- [email protected] To unsubscribe send an email to [email protected]
