MATLAB simulation based on fft algorithm

This method is easy to implement related algorithms on FPGA, which is simpler than directly using multiplication. However, the more the number of related points, the more the amount of calculation is relatively less than the direct solution.

The simulation program is as follows:

%step:

%(1) x, y complement M at the high position (data length) zeros

%(2) Find 2M point FFT, X(K), Y(K)

%(3) Product, Rxy(K)=X(K)*Y'(K) Note: Y(K) takes conjugate

%(4) Find 2M points IFFT, rxy= IFFT(Rxy(K))

Clc;close all;clear all;

X1=load('D:My DocumentsMATLABdens_flow_ejieRF1.txt'); %Import data

Y1=load('D:My DocumentsMATLABdens_flow_ejieRF2.txt'); %Import data

Xcorr_size=512; % defines the length of the cross-correlation

Xk=zeros(1,2*xcorr_size);

Yk=zeros(1,2*xcorr_size);

Label_x=zeros(1,2*xcorr_size);

Velo= zeros(1,2*xcorr_size);

Xk(1:xcorr_size)=x1(1:xcorr_size); The following are the comparison experiments. The comparison will be made by using the fft correlation algorithm and the XCORR implementation. It is found that the correlation can be achieved without using the reverse folding method.

Yk(1:xcorr_size)=y1(1:xcorr_size); % achieves very good results

XK_FFT=fft(xk);

YK_FFT = conj(fft(yk)); % find conjugate, just add a conjugate operation before complex multiplication

ZK= XK_FFT.*YK_FFT;

Rxy=fftshift(ifft(ZK)); % is the same as taking the real part

Figure;

Plot(rxy);

TItle ('fft algorithm achieves linear correlation');

Rxy2=xcorr(xk(1:xcorr_size),yk(1:xcorr_size));

Figure;

Plot(rxy2);

TItle ('matlab comes with the correlation function xcorr result');

MATLAB simulation based on fft algorithm

High Density Patch Panel

High Density Patch Panel,High Density Patch Panel,High Density Fiber Patch Panel,High Density Lc Patch Panel

Huizhou Fibercan Industrial Co.Ltd , https://www.fibercannetworks.com