source: ETALON/CLIO/Analysis/Data2May/KK/SRf.m @ 721

Last change on this file since 721 was 721, checked in by hodnevuc, 7 years ago
File size: 1.0 KB
Line 
1function [RSP,ISP,alp]=SRf(SP,SS)
2%RECOVERY PART
3w0=SP(1);
4%Make LF extrapolation
5DSP=diff(SS)./diff(SP);
6rs=sum(DSP(1:3));%must be negative
7r=SS(1);
8alp=rs/r/w0-log(r)/(w0*w0);
9bet=2*log(r)/w0-rs/r;
10x=0:(w0-1);
11% syms xx
12% w0
13% rs
14% vpasolve(-2*w0*xx*exp(-xx*w0^2)==rs, xx)
15%  LFpart=exp(alp.*x.*x+bet.*x);
16LFpart=exp(-abs(log(r)/(w0^2)).*x.^2);
17 LFpart( LFpart>1)= 1;
18%  LFpart=ones(size(x));
19% LFpart=exp(-1.8262e-05*x.^2);
20%  LFpart=1;
21%Make interpolation
22% SS=SS.*exp(-1.8262e-05*w0.^2)
23ISP = pchip(SP,SS,w0:max(SP));
24%Make HF extrapolation
25w=1:(2^12-length(ISP)-length(LFpart));
26wmax=max(SP);
27rosh=DSP(end);
28
29  alp=(rosh/ISP(end))*wmax;
30        c=0;
31        while (alp>0)
32            c=c+1;
33          rosh=  (SS(end)-SS(end-c))/(SP(end)-SP(end-c));
34          alp=(rosh/ISP(end))*wmax;
35        end
36        if (alp>-2) alp=-2;end
37HFpart=ISP(end)* (1+w/wmax).^(alp);
38HFpart(HFpart<eps)=eps;
39
40%Connect all together
41ISP=[LFpart,ISP,HFpart];
42%Mirror image of the spectrum
43RSP=[ISP,fliplr(ISP)];
Note: See TracBrowser for help on using the repository browser.