source: ETALON/reconstruction/f18/SRf.m

Last change on this file was 297, checked in by hodnevuc, 9 years ago
File size: 634 bytes
Line 
1function [RSP,ISP,alp]=SRf(SP,SS)
2%RECOVERY PART
3w0=SP(1);
4%Make LF extrapolation
5DSP=diff(SS)./diff(SP);
6rs=DSP(1);%must be negative
7r=SS(1);
8alp=rs/r/w0-log(r)/(w0*w0);
9bet=2*log(r)/w0-rs/r;
10x=1:(w0-1);
11LFpart=exp(alp.*x.*x+bet.*x-alp-bet);
12%Make interpolation
13ISP = pchip(SP,SS,w0:max(SP));
14%Make HF extrapolation
15
16w=1:(2^15-length(ISP)-length(LFpart));
17wmax=max(SP);
18rosh=mean(DSP((end-4):end));
19alp=(rosh/SS(end))*wmax;
20if (alp>-2) alp=-2;end
21HFpart=ISP(end)* (1+w/wmax).^(alp);
22HFpart(HFpart<eps)=eps;
23
24%Connect all together
25ISP=[LFpart,ISP,HFpart];
26%Mirror image of the spectrum
27RSP=[ISP,fliplr(ISP)];
Note: See TracBrowser for help on using the repository browser.