Hi Vinod Kumar Govindu
having faced similar problem, I found out the following points may be of interest to you
1. that the standard MATLAB function conv has a limitation: it resets the time reference, not really knowing when the convolution starts and stops, let me explain:
i1=randi([-10 10],1,10);
q1=randi([-10 10],1,10);
i2=randi([-10 10],1,10);
q2=randi([-10 10],1,10);
plot(abs(conv(x,y)));grid on
.
as you can see, the resulting convolution always starts n=1 regardless of when do x and y really start. The correlation should tell when both signals start having something in common.
To improve this, the literature reference
Digital Signal Processing Using MATLAB
3rd edition
by Vinay K Ingle, John G Proakis
in page 44 a convolution function is developed taking into account the start and stop indices of x and y:
function [y,ny] = conv_m(x,nx,h,nh)
nyb = nx(1)+nh(1); nye = nx(length(x)) + nh(length(h));
ny = [nyb:nye];
y = conv(x,h);
2.
The same literature reference suggests another alternative convolution, with the Toeplitz calculation of the equivalent matrix that one just has to multiply to x to obtain y, instead of running all the progressive sums shifting y one reference vector value at a time:
function [y,H]=conv_tp(h,x)
Nx = length(x); Nh = length(h);
hc=[h; zeros(Nx-1, 1)];
hr=[h(1),zeros(1,Nx-1)];
H=toeplitz(hc,hr);
y=H*x;
further reading regarding the toeplitz function
3.
Perhaps you would like to consider using function corrcoef that shifts x and places in each line of the output matrix RHO the result of each sum of your expression CCF, corrcoef also outputs how sell correlated are x and y for each value of k, in the shape of another matrix
the closer a value of pval is to 1, the more alike are x(n) and y(n-k). p(i,j)=1 means identical.
.
4.
Since you want to convolve 2 complex signals, perhaps you would like to decompose the operation the following way:
conv(i1+1j*q1,i2+1j*q2)=
conv(i1,i2)-conv(q1,q2)+(conv(i1,q2)+conv(i2,q1))j
or you would consider working with modulus and phase, and then just check how correlated are modules and phases:
modx=abs(x);ax=angle(x);mody=abs(y);ay=angle(y);
conv(modx,mody)
conv(ax,ay)
.
so, Vinod
if you find this answer useful would you please be so kind to mark my answer as Accepted Answer?
To any other reader, please if you find this answer of any help solving your question,
please click on the thumbs-up vote link,
thanks in advance
John BG
Best Answer