summaryrefslogtreecommitdiff
path: root/macros/rc2lar.sci
blob: 015b42c17fa306e437ebb714b6c8dcf5568aba66 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
function g=rc2lar(k)
    
//rc2lar convert  reflection coefficient to log area ratios.

// Calling Sequence
// g = rc2lar(k)
// Parameters
// k: define the reflection coefficients.
// g: returns log area ratios.
// Examples
//X = [0.5 0.3 0.8 0.9 0.4 0.05];
// g = rc2lar(X)
// See also
//
// Author
// Jitendra Singh
//  

      if or(type(k)==10) then
    error ('All reflection coefficients should have magnitude less than unity.  ')
end 

    
    
  if ~isreal(k) then
        error('Log area ratios not defined for complex reflection coefficients.')
    end
    
    if max(abs(k)) >= 1 then
    error ('All reflection coefficients should have magnitude less than unity.')
end
g=-2*atanh(-k);
endfunction