time Autocorrelation of horizontal velocity in PIV

4 次查看(过去 30 天)
I would like to calculate Time autocorrelation of order parameter/horizontal velocity in PIV. Would it be possible in the app itself?
I am a beginner in Matlab and my usage is restricted to PIV on experimental data from living cells.
A detailed tutorial would be extremely helpful.

回答(1 个)

William Rose
William Rose 2025-7-9
编辑:William Rose 2025-7-9
[Edit: Add example. Fix typos (none in the code).]
[Edit 2: Add details to the explanation of how to change the horizontal axis to be in seconds instead of lags.]
Yes, you can compute the autocorrelation of the order parameter and of the horizontal velocity in particle image velocimetry, assuming that you have measured each of those quantities at many time points. Use Matlab's autocorr().
You can also compute the cross correlation of the order parameter and the horizontal velocity, if you have measured both at the same set of times. Use Matlab's xcorr().
Here is an example, using data from a subject undergoing cardiac catheterization.
Read the data from a text file.
data=load('PaoPfe.txt'); % read data from file
t=data(:,1); % column 1=time (s)
Pao=data(:,2); % col.2=aortic pressure (mmHg)
Pfe=data(:,3); % col.3=femoral artery pressure (mmHg)
Plot the data to make sure it looks reasonable.
figure;
plot(t,Pao,'-r',t,Pfe,'-b');
title('Blood Pressure'); legend('Aortic','Femoral') % add title , legend
xlabel('Time (s)'); ylabel('Pressure (mmHg)'); grid on % axis labels and grid
Data plotted above looks reasonable. The aortic pressure appears to have more measurement noise.
Compute autocorrelations.
[Paoac,lags1]=autocorr(Pao);
[Pfeac,lags2]=autocorr(Pfe);
plot(lags1,Paoac,'-r.',lags2,Pfeac,'-b.')
title('Autocorrelation'); legend('Pao','Pfe')
xlabel('Lags'); ylabel('Autocorrelation'); grid on
The horizontal axis above is sample lags. If you want the horizontal axis to be time in seconds, multiply lags by the sampling interval (in seconds). If you want to see the autocorrelation for a longer duration, use the optional argument NumLags, and specify a value for NumLags that is greater than the default value of 20. An example of both changes is below.
dt=0.01; % sampling interval (s)
[Paoac,lags1]=autocorr(Pao,NumLags=200); % Pao autocorrelation
[Pfeac,lags2]=autocorr(Pfe,NumLags=200); % Pfe autocorrelation
figure
plot(lags1*dt,Paoac,'-r.',lags2*dt,Pfeac,'-b.')
title('Autocorrelation'); legend('Pao','Pfe')
xlabel('Lag (s)'); ylabel('Autocorrelation'); grid on
If you do not have a toolbox with the autocorr() function, then use [Paoac,lags1]=xcorr(Pao,Pao);. This is equivalent, because the cross correlation of a signal with itself is the autocorrelation. autocorr() and xcorr() differ in the range of lags they return, by default. Also, the optional arguments (including normalization options) differ for autocorr() and xcorr(). See the help for details and more examples.
Good luck with your analysis.
Please post some data if you want more assistance.

类别

Help CenterFile Exchange 中查找有关 Fluid Dynamics 的更多信息

标签

产品


版本

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by