Diagonal Interpolat​ion/Extrap​olation of a 1024 x 30 Matrix

5 次查看(过去 30 天)
Hello everyone,
I have a 2D matrix of spectra, (30 spectra, each being 1024 data points long). The 30 spectra are for various peaks along a 1024-pixel detector. I'm trying to interpolate (for the intermediate pixels) and extropolate (for the exterior pixels beyond the edge measurements) diagonally to get a 1024 x 1024 matrix. Could someone please help me by suggesting the most accurate way of doing this? I'm open to any methods, but I may need a little help with the implimentation. Any help would be greatly appreciated.
  3 个评论
John D'Errico
John D'Errico 2021-2-23
Yes, you asked me to answer this question by direct mail. NO I don't do e-mail consulting.
But if all you have are the values of some function at a set of points along the diagonal of an array, then you CANNOT intelligently extapolate that information off the diagonal.
It is not at all clear what you are trying to do, so I cannot know if that is really what you are asking.
Christopher Gordon
Christopher Gordon 2021-2-24
Thank you both. I've attached two images, one shows all the individual spectra on a 2D axis, and the other is a surface plot that shows the peaks along the diagonal. I'd like to interpolate this matrix to give me the intermittent spectral plots for pixels that weren't measured directly.

请先登录,再进行评论。

回答(1 个)

Bjorn Gustavsson
Bjorn Gustavsson 2021-2-24
What you can try for this is to align the main peaks, using something like this:
[~,idxPeaks] = max(I_spectras,[],2); % Here I assume that I_spectras are 30 x 1024
I_S_shifted = zeros(30,2048);
for i1 = 30:-1:1;
I_S_shifted(i1,1024-idxPeaks(i1)+[1:1024]) = I_spectras(i1,:);
end
imagesc(I_S_shifted)
Then you might get somewhere by interpolating I_S_shifted after which you might reverse-shift the spectras (how easy that is to do depends on how simple the shifts of the peaks are in the first place.) This works under the assumption that the shape of the peaks varies very slowly between neighboring spectra. This might be useful or not, If this is not good enough one might take a further step in scaling the spectra as well to line up additional features, but that's for later.
HTH

类别

Help CenterFile Exchange 中查找有关 Matrices and Arrays 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by