Autocorrelation of Bessel Function using MATLAB

8 vues (au cours des 30 derniers jours)
Ahmad Qayyum
Ahmad Qayyum le 22 Mai 2022
Commenté : Image Analyst le 23 Mai 2022
I am given a drawing of a sample Autocorrelation Function. Now I know that this is a bessel function but I can not seem to get the proper function through which the autocorrelation was found and plotted. Following is the diagram:
Also I want to ask that this ACF function has the same shape as the Bessel Function from which the ACF was found?
  1 commentaire
Image Analyst
Image Analyst le 23 Mai 2022
@Ahmad Qayyum why have you added a flag of "Unclear"? You got an answer and accepted it.

Connectez-vous pour commenter.

Réponse acceptée

William Rose
William Rose le 22 Mai 2022
@Image Analyst assumes that the function whose autocorrelation you seek is a Bessel function. And that was my asusmption when I read your question. But now I wonder if you mean that the autocorrelation function itself looks like a Bessel function. You said you attached an image, but I do not see an image.
It sounds to me like you have an autocorrelation function and you want to know the original function. It turns out there are an infinite number of functions will produce a given autocorrelation function. To go backward from an autocorrelation function to an original function, apply the Weiner-Khinchin theorem. Some phase information is lost when doing the autocorrelation. Specfically, compute the amplitude spectrum of the autocrrelaiton. Add an odd-symmetric phase function (such as all zeros). Take its inverse Fourier transform. The result is a function that will produce the observed autocorrelation.
  2 commentaires
Ahmad Qayyum
Ahmad Qayyum le 22 Mai 2022
Modifié(e) : Ahmad Qayyum le 22 Mai 2022
@William Rose That is exaclty what I meant. I want to find the original signal but all I have is an image, nothing else. Can you guide me further? Following is the image:
Is the image visible to you now? I want to find the function whose autocorrelation is the above provided image. Can you guide me further?
William Rose
William Rose le 23 Mai 2022
@Ahmad Qayyum, You're welcome.
Here is a script that uses the Weiner Kihinchin theorem to recover a signal from its autocorrelation. Results are shown graphically below.
In this example, the original signal is the sum of three sinusoids with different phases. The bottom panel of the figure shows that the original signal and the recovered signal have almost identical power spectra. This is what we expect. The actual and recovered signals are different in the time domain, because phase information is lost when the autocorrelation is computed. We also see that the original signal has N points, and the recovered signal has 2N-1 points. This happens because the autocorrelation has 2N-1 points. You might try to "fix" this discrepancy by (A) computing the fft of the "one-sided" autocorrelation function, which has N points, or (B) by truncating the autocorrelation to N/2, or N/2-1, points on either side of zero lags, then taking the fft of the truncated autocorrelation, or (C) by truncating the recovered signal after N points. I tried all three fixes. Fix A and fix C produce a recovered signal of length N, as desired, but its power spectrum is significantly less than the power spectrum of the orignal signal, and is the spectrum is not such a good match. Fix B results in a signal with an odd number of points, even if the original signal has an even number of points, and again, the power spectrum is not such a good match to the original.
Solutions I have not tried: D. Use a circular autocorrelation of length N. E. Resample the fft of the autocorrelation so that the FFT has N points, instead of 2N-1 points, and do the resampling in a way that preserves total power in the spectrum. Then take the inverse FFT of the square root of the resampled FFT. F. Using some of the approaches above, but with non-default choices for how to normalize the autocorrelation.
If the original signal is composed of three sinusoids with phase=0, then the recovered signal is an almost perfect match at first, but even in this special case, the recovered signal gradually diverges from the original.
You cannot recover the phase information that is lost when taking the autocorrelation.
Good luck with your work.

Connectez-vous pour commenter.

Plus de réponses (1)

Image Analyst
Image Analyst le 22 Mai 2022
You can correlate with xcorr. You can make a plot like that with stem.
There are a variety of Bessel functions. Check the help for the one you want.
  5 commentaires
Ahmad Qayyum
Ahmad Qayyum le 22 Mai 2022
Modifié(e) : Ahmad Qayyum le 22 Mai 2022
@Image Analyst On MATLAB help I searched for the bessel function and got the following codes:
syms x y
fplot(besselj(0, x))
axis([0 50 -0.2 1])
grid on
ylabel('J_v(x)')
legend('J_0','J_1','J_2','J_3', 'Location','Best')
title('Bessel functions of the first kind')
another one:
X = 0:0.1:20;
J = zeros(5,201);
for i = 0:4
J(i+1,:) = besselj(i,X);
end
plot(X,J,'LineWidth',1.5)
axis([0 20 -.5 1])
grid on
legend('J_0','J_1','J_2','J_3','J_4','Location','Best')
title('Bessel Functions of the First Kind for v = 0,1,2,3,4')
xlabel('X')
ylabel('J_v(X)')
These above mentioned codes are giving 5 graphs but I want only one.
Now what I want is to come to a fucntion whose ACF gives the graph that is attached in the question so that I can sample that function at 1000 samples/second.
Image Analyst
Image Analyst le 22 Mai 2022
It seems like @William Rose figured it out because you accepted his solution : it's the output (the autocorrelation of the signal) that is a Bessel function, rather than the input signal being a Bessel function which I assumed. Anyway, glad you got it working with his solution.

Connectez-vous pour commenter.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by