root / synthbench / euroben-dm / mod2g / analhr.f @ 0:839f52ef7657
History | View | Annotate | Download (912 Bytes)
1 |
Subroutine analhr( a, w, n, m ) |
---|---|
2 |
! --------------------------------------------------------------------- |
3 |
! --- 'analhr' does a Haar wavelet analysis of values in 'a'. The |
4 |
! result is put in array 'w'. 'n' is the length of the arrays and |
5 |
! m = Log2(n). |
6 |
! --------------------------------------------------------------------- |
7 |
Use numerics |
8 |
Integer :: n, m |
9 |
Real(l_) :: a(n), w(n) |
10 |
|
11 |
Integer :: i, j, k, n1 |
12 |
Real(l_) :: av |
13 |
! --------------------------------------------------------------------- |
14 |
n1 = n |
15 |
Do i = 1, m |
16 |
n1 = n1/2 |
17 |
k = 1 |
18 |
Do j = 1, 2*n1, 2 |
19 |
av = 0.5_l_*( a(j) + a(j+1) ) |
20 |
w(k+n1) = a(j) - av |
21 |
a(k) = av |
22 |
k = k + 1 |
23 |
End Do |
24 |
End Do |
25 |
w(1) = a(1) |
26 |
! --------------------------------------------------------------------- |
27 |
End Subroutine analhr |