2D cross correlation between NIR and MIR data

4 ビュー (過去 30 日間)
Doyinsola
Doyinsola 2023 年 6 月 6 日
コメント済み: Doyinsola 2023 年 6 月 7 日
Hi everyone, can anyone help me on how to compute a 2D cross correlation analysis please. I have NIR and MIR absorbance dataset I need to peform a cross corrrelation to check for similar trends between the two responses. Can anyone assit me with the code to analyse this please? Thank you
The datasset is a 22 by 12001 NIR and 22 by 13001 MIR.

採用された回答

Gourab
Gourab 2023 年 6 月 7 日
Hi Doyinsola,
I understand that you want to find the 2D cross-correlation between NIR and MIR data matrices.
The `xcorr2()` function computes the cross-correlation between two 2D arrays, treating one as the reference and the other as the template.
Please refer to the below code snippet on using the `xcorr2()` function.
% Load your NIR and MIR data from file
load('nir_data.mat');
load('mir_data.mat');
% Transpose the NIR and MIR data matrices
nir_data = nir_data.';
mir_data = mir_data.';
% Compute the cross-correlation between the NIR and MIR data
cc = xcorr2(nir_data, mir_data);
% Display the cross-correlation as an image
figure;
imagesc(abs(cc));
colormap('jet');
colorbar;
Please refer to the below documentation link for more information on ‘xcorr2()’ function.
I hope this helps you to resolve the query.
  1 件のコメント
Doyinsola
Doyinsola 2023 年 6 月 7 日
Thank you, it does. I later find a way to it yesterday and it is exactly same as your answer. Thank you.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeParticle & Nuclear Physics についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by