how can we write a code to find cross-correlation or auto cross-correlation in verilog? actually we are trying to find the delay between a pulse and its echo. we have the signal coming from an 8-bit ADC and we keep it in a RAM. then we need to find the max value of the correlation to determine the delay between the waves.
we thought that the best way would be auto cross correlation. bu it seems to be very hard to write a code in verilog for an fpga.
you should read out the values out of RAM and compare the values to older one, if bigger, store in register, if not throw away or something, you also need somehow the timestamp of the values to calculate the delay....simply as far as i understood from your case....or at least this can give you some ideas