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

11 vues (au cours des 30 derniers jours)
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?

Réponses (2)

dpb
dpb le 20 Mai 2022

Star Strider
Star Strider le 20 Mai 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.
.

Catégories

En savoir plus sur 2-D and 3-D Plots dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by