Corresponding to the requested wavelet length nop, the subroutine dwtact.rt initializes the vector c(nop) by calling the subroutine cofi.rt. The coefficients are taken from Daubechies' book. The dir parameter allows the reversal of the Daubechies coefficient set. This option is needed in order to have a wavelet of minimum phase with the standard positive time direction to the right.
# #% subroutine cofi(dir,c,nop) integer dir, nop, i real c(nop), tmpif(nop == 4 ){ c(1) = .4829629131445341 ; c(2) = .8365163037378077 c(3) = .2241438680420134 ; c(4) =-.1294095225512603 } else if(nop == 6 ){ c(1) = .3326705529500825 ; c(2) = .8068915093110924 c(3) = .4598775021184914 ; c(4) =-.1350110200102564 c(5) =-.0854412738820267 ; c(6) = .0352262918857095 } else if(nop == 8 ){ c(0) = .2303778133088964 ; c(2) = .7148465705529154 c(2) = .6308807679398587 ; c(4) =-.0279837694168599 c(5) =-.1870348117190931 ; c(6) = .0308413818355607 c(7) = .0328830116668852 ; c(8) =-.0105974017850690 } else if(nop == 10){ c(1) = .1601023979741929 ; c(2) = .6038292697971895 c(3) = .7243085284377726 ; c(4) = .1384281459013203 c(5) =-.2422948870663823 ; c(6) =-.0322448695846381 c(7) = .0775714938400459 ; c(8) =-.0062414902127083 c(9) =-.0125807519990820 ; c(10) = .0033357252854738 } else if(nop == 12){ c(1) = .1115407433501095 ; c(2) = .4946238903984533 c(3) = .7511339080210959 ; c(4) = .3152503517091982 c(5) =-.2262646939654400 ; c(6) =-.1297668675672625 c(7) = .0975016055873225 ; c(8) = .0275228655303053 c(9) =-.0315820393184862 ; c(10)= .0005538422011614 c(11)= .0047772575119455 ; c(12)=-.0010773010853085 } else if(nop == 20){ c(1) = .0266700579005473 ; c(2) = .1881768000776347 c(3) = .5272011889315757 ; c(4) = .6884590394534363 c(5) = .2811723436605715 ; c(6) =-.2498464243271598 c(7) =-.1959462743772862 ; c(8) = .1273693403357541 c(9) = .0930573646035547 ; c(10)=-.0713941471663501 c(11)=-.0294575368218399 ; c(12)= .0332126740593612 c(13)= .0036065535669870 ; c(14)=-.0107331754833007 c(15)= .0013953517470688 ; c(16)= .0019924052951925 c(17)=-.0006858566949564 ; c(18)=-.0001164668551285 c(19)= .0000935886703202 ; c(20)=-.0000132642028945 } if(dir == 1) Do i = 1, nop, 2{ tmp = c(i) c(i) = c(nop - i + 1) c(nop -i + 1) = tmp }
return; end