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