function WSHLIKE, sig,proto ;+ ; NAME: ; WSHLIKE ; ; PURPOSE: ; This function makes 1-d signal with given shape. ; ; CATEGORY: ; Wavelets ; ; CALLING SEQUENCE: ; vec = WSHLIKE(sig,proto) ; ; INPUTS: ; sig: a row, column vector, or matrix ; proto: a prototype shape (row, column vector, ; or matrix) ; ; OUTPUTS: ; vec: a vector with contents taken from sig ; and same shape as proto ; ; EXAMPLE: ; ; SEE ALSO: ; wshasrow ; ; MODIFICATION HISTORY: ; Written by: Amara Graps October, 1994 ;Translated from MatLab Wavelab routine: shapelike.m ;- ssp = SIZE(proto) CASE ssp(0) OF 1: BEGIN ;we have a 1-d row vector sp = INTARR(2) sp(0) = 1 ;#rows sp(1) = ssp(1) ;#cols END 2: BEGIN ;we have a 2-d column vector sp = INTARR(2) sp(0) = ssp(2) ;#rows sp(1) = ssp(1) ;#cols END ENDCASE sss = SIZE(sig) CASE ssp(0) OF 1: BEGIN ;we have a 1d row vector ss = INTARR(2) ss(0) = 1 ;#rows ss(1) = sss(1) ;#cols END 2: BEGIN ;we have a 2d column vector ss = INTARR(2) ss(0) = sss(2) ;#rows ss(1) = sss(1) ;#cols END ENDCASE CASE 1 OF ;1 = true ((sp(0) GT 1) and (sp(1) GT 1)): BEGIN PRINT, 'Weird proto argument to WSHLIKE' END ((ss(0) GT 1) and (ss(1) GT 1)): BEGIN PRINT, 'Weird sig argument to WSHLIKE' END ELSE: BEGIN CASE 1 OF sp(0) GT 1: BEGIN IF ss(0) GT 1 THEN vec = sig ELSE $ vec = WCOMBINE(sig) END ;sp(0) gt 1 ELSE: BEGIN IF ss(1) GT 1 THEN vec = sig ELSE BEGIN vec = TRANSPOSE(WCOMBINE(sig)) END ;ELSE END ;sp le 1 ENDCASE ;sp(0) gt or le 1 END ;else ENDCASE ; ; Algorithm Source: WaveLab Version 0.600 ; WaveLab WWW site: http://playfair.stanford.edu/ ; WaveLab Questions? e-mail wavelab@playfair.stanford.edu ; RETURN, vec End ;***************************************************