How to interpolate a column array based on another non-linearly spaced column array?

5 visualizaciones (últimos 30 días)
Hello,
I have two data sets - emission spectrum of a black body in the wavelength range 1 to 10 µm and absorption spectrum of a gas in the same wavelength range. The problem is that the emission spectrum contains only 901 data points, whereas, absorption spectrum contains 136442 data points, which are non-linearly spaced. There is a very high density of data upto 6µm compared to 6-10 µm. I have to finally overlapp the two data i.e. show emission spectrum before and after gas absorption. How can I interpolate the emission spectrum with the same non linear spacing of the wavelength?

Respuestas (2)

dpb
dpb el 20 de Mayo de 2022

Star Strider
Star Strider el 20 de Mayo de 2022
As a general rule, it is best to interpolate a longer vector to a shorter vector in order to avoid creating data that interpolating a shorter vector to a longer vector would do. I am guessing what the (x,y) relationship of these vectors are, since that has not been stated.
Try this —
LD = load('Emission_absorption_plots_CO2_variables_2.mat');
abs = LD.abs_1_10;
nu_abs = LD.nu_1_10_abs;
emis = LD.emis_1_10;
nu_emis = LD.nu_1_10_emis;
[Unu_abs,ix] = unique(nu_abs);
Uabs = abs(ix);
abs2 = interp1(Unu_abs,Uabs,nu_emis);
figure
yyaxis left
plot(nu_emis,emis)
ylabel('emis')
yyaxis right
plot(nu_emis,abs2)
ylabel('abs')
grid
This performs the interpolation and plots the results. I have no idea what you want to do with them.
.

Categorías

Más información sobre 2-D and 3-D Plots en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by