I have a spectrum (Stot) that's a linear combination of two known spectra (Sa and Sb). I would like to fit Stot , Stot = kSa + (1-k)Sb, and extract k and 1-k for Sa and Sb respectively from this fit. I have the Stot spectrum at a series of times, can I fit multiple spectra at one time?

답변 (1개)

Star Strider
Star Strider 2017년 9월 1일

0 개 추천

One possibility:
k = 4.2; % Define ‘k’
t = linspace(1, 4*pi);
Sa = sin(t); % Create ‘spectra’
Sb = cos(t); % Create ‘spectra’
Stot = k*Sa + (1 - k)*Sb;
f = @(k) norm(Stot - (k*Sa + (1-k)*Sb)); % Cost Function: Nonlinear Approach
K = fminsearch(f, 2) % Estimate ‘k’: Nonlinear Approach
K = [Sa(:) Sb(:)]\Stot(:) % Estimate ‘k’: Linear Approach
However without your data I cannot claim that either of these will work reliably with it. Experiment to get the result you want.

카테고리

도움말 센터File Exchange에서 Interpolation에 대해 자세히 알아보기

질문:

2017년 9월 1일

답변:

2017년 9월 1일

Community Treasure Hunt

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

Start Hunting!

Translated by