I understand that you are trying to correct the attenuation and dispersion in your measurement signal. However, you mentioned that you are not getting the desired result. It would be helpful if you could provide more information about the expected and actual results, as well as any specific issues or error messages you encountered.
In the provided code, you are calculating the attenuation and dispersion factors using the Fourier transformation of the pressure signals. Then, you are applying these factors to correct the signal. One potential issue could be calculation of the dispersion factor, as the phase difference between the Fourier transforms might not be accurate. You can try using the “unwrap” function to improve the accuracy of the phase calculation.
Here is an example of how you can use the unwrap function to calculate the dispersion factor:
beta = -(1/d)*unwrap(phase(F_Ideal_HS) - phase(F_Ideal_GRD));
Additionally, there’s a warning about ignoring the imaginary parts of the complex arguments when plotting the corrected signal. This warning suggests that the corrected signal might have complex values. To visualize the real part of the corrected signal, you can modify the plotting code as follows:
plot(time, real(Signal_corrected), 'LineWidth', 2);
You can refer to the below documentation on “unwrap” function if required,
Hope this Helps!
Thanks.