function WNNOISE, x,QMF, TT ;+ ;NAME: ; WNNOISE ; ;PURPOSE: ; This function normalizes the signal to noise level 1. ; ;CATEGORY: ; Wavelets. ; ;CALLING SEQUENCE: ; y = WNNOISE(x,QMF) ; ;INPUTS: ; x = 1-d/2-d signal ; QMF = quadrature mirror filter ; ;OUTPUTS: ; y = 1-d signal, scaled so wavelet coefficients ; at finest level have median absolute deviation 1 ; TT = 'I' if image and 'S' if signal ; ;EXAMPLE: ; IDL> ;Truncate sig array appropriately and get QMF ; IDL> WINTWAVE, sig, WaveType, ParVal, QMF, LD ; IDL> tt = 'S' if 1D dataset or tt = 'I' if 2D dataset ; IDL> sig = WNNOISE(sig,QMF, tt) ; IDL> If tt EQ 'S' then WPLOTIT, st, 1, sig ELSE WPLOTIT, st, 10, sig ; ;NOTES: ; This is required pre-processing to use any of the DeNoising ; tools on naturally-occurring data ; ;SEE ALSO: ; wpdnoise ; ;MODIFICATION HISTORY: ; Written by: Amara Graps September, 1995 ;Translated from MatLab Wavelab routine: normnoise.m ;- TT = WSIGTYPE(x, len, error) CASE error OF 1: BEGIN ;Valid array or matrix CASE TT OF 'I': BEGIN ;byte image.. normalize row by row y = BYTARR(len, len) ;initialize y FOR ix = 0, len-1 DO BEGIN row = x(*, ix) u = WDNDYDHI(row,QMF) s = MEDIAN(ABS(u))/ .6745 ;make byte? y(0,ix) = row /s END ;end END 'S': BEGIN ;signal u = WDNDYDHI(x,QMF) s = MEDIAN(ABS(u))/ .6745 y = x /s END ENDCASE ;TT END ;valid array or matrix ELSE: PRINT, 'Not valid data/signal array or matrix!' ENDCASE ;error ; ; Algorithm Source: WaveLab Version 0.600 ; WaveLab WWW site: http://playfair.stanford.edu/ ; WaveLab Questions? e-mail wavelab@playfair.stanford.edu ; RETURN, y END ;***************************************************