Adapted Wavelet Analysis from Theory to Software

A BTN tree is more general than an array binary tree:
Convert an array binary tree into an BTN tree
abt2btnt( DATA, LENGTH, MAXLEVEL, LEVEL ): Let ROOT = makebtn( DATA, NULL, NULL, NULL ) If LEVEL>LEVEL)/2 Let ROOT.RIGHT = abt2btnt(CHILD, LENGTH, MAXLEVEL, LEVEL+1) Return ROOT
Avoiding recursion, we get:
bisectn( ARRAY, N, U ): While N > 0 N /= 2 If U is odd then ARRAY += N U /= 2 Return ARRAY
Notice that all we have to do is replace "c" with "s" in lpic() and ilpic():
In place local periodization to N points, sine polarity
Ipis( SIG, N, RISE ): fips( SIG, SIG, RISE ) fips( SIG+N, SIG+N, RISE ) uips( SIG+N, SIG, RISE )
Inverse local periodization from N points, sine polarity
ilpis( SIG, N, RISE ): fips( SIG+N, SIG, RISE ) uips( SIG, SIG, RISE ) uips( SIG+N, SIG+N, RISE )
We must invert the order of operations used by Ipica():
Inverse local periodizations of adjacent intervals, cosine polarity
ilpica( SIG, LENGTHS, NUM. RISE ): For I = 0 to NUM-1 ...