function WDYADLNG, x,J ;+ ; NAME: ; WDYADLNG ; ; PURPOSE: ; This function finds length and dyadic length of an array. ; ; CATEGORY: ; Wavelets ; ; CALLING SEQUENCE: ; n = WDYADLNG(x,J) ; ; INPUTS: ; x: array of length n = 2^J (hopefully) ; ; OUTPUTS: ; n: length(x) ; J: least power of two greater than n ; ; SIDE EFFECTS: ; A warning is issued if n is not a power of 2. ; ; EXAMPLE: ; ; SEE ALSO: ; wquadlen, wdyad, wdyad2ix ; ; MODIFICATION HISTORY: ; Written by: Amara Graps October, 1994 ;Translated from MatLab Wavelab routine: dyadlength.m ;- n = N_ELEMENTS(x) k = 1 J = 0 WHILE ( k LT n ) DO BEGIN k=2*k J = 1+J END IF ( k NE n ) THEN BEGIN print, 'Warning in WDYADLNG: n is not equal to 2^J' END ; ; Algorithm Source: WaveLab Version 0.600 ; WaveLab WWW site: http://playfair.stanford.edu/ ; WaveLab Questions? e-mail wavelab@playfair.stanford.edu ; RETURN, n End ;of function WDYADLNG ;***************************************************