Electronic – Timing complexity for correlation implementation on FPGA

fpgasignal processingvirtex-series-fpga

Let's say we have a database of five thousand 512 point discrete signals. Each database entry is unique in itself. The important point to note about the signals in the database is that out of the 512 points, more than half of the points are zero for all the signals. Now, we capture a 512 point discrete signal from the outside (details need not matter).This signal corresponds to one of the signals in the five thousand entries of the database. I compare the acquired signal by taking the Spearman Correlation of the acquired signal with each of the five thousand signals and the entry which gives the highest correlation coefficient is the closest and depicts the acquired signal. This operation of correlation, especially the 512 point correlation, consumes a lot of time on MATLAB. Obviously, there is latency on the PC, which is the main reason for consumption of time. The time consumed is 2.3 seconds on an average for calculating the correlation of the acquired signal with each of the 5000
database entries.

Now, let's say that I want to implement the exact thing on an FPGA (Virtex-7 Xilinx Family). I think that the operation of correlation can be done in parallel because the acquired signal is only one and the database entries can be stored in the FPGA. So, not all the 5000 signals can be correlated parallelly, however, if at least 1000 can be correlated parallelly, then the time will reduce considerably on the FPGA. So, my question is how many signals could I correlate at one time on this FPGA and what will be the approximate time taken for this 512 point correlation in total if implemented on this FPGA.

Best Answer

If we assume 2 bytes per sample point (16 bits), then you have about 5 MB of database data, which pretty much dictates external memory to hold it on all but the very largest of FPGAs. The external memory interface will be the rate-limiting step in the correlation process.

If you have a number of DDR memory chips you could have an interface that's, say, 64 bits wide running at 200 MHz or so, which gives you a raw bandwidth of 3.2 GB/second. This allows you to scan through your database in less than 2 ms.

Then, you just need to make sure you have enough parallel logic to calculate your correlation as fast as the data comes in. I'm not familiar enough with the details of Spearman Correlation to offer any suggestions there.