├── Datasets ├── barb.txt ├── lady.txt ├── barb.raw ├── barton.raw ├── coifman.raw ├── lenna.raw ├── mriscan.raw ├── msignal.asc ├── msignal.txt ├── phone.raw ├── Internet.lnk ├── canaletto.raw ├── daubechies.raw ├── fingerprint.raw ├── peppers256.raw ├── SonRemy.txt ├── esca.txt ├── sunspots.txt ├── HochNMR.txt ├── phone.txt ├── seismic.txt ├── transients.txt ├── mriscan.txt ├── greasy.txt ├── lenna.txt ├── RaphNMR.txt ├── tweet.txt ├── laser.txt ├── caruso.txt ├── lincoln.txt ├── barton.txt ├── fingerprint.txt ├── makediag.m ├── raw2mat.m ├── daubechies.txt ├── canaletto.txt ├── coifman.txt └── mat2raw.m ├── Papers ├── .DS_Store ├── Adapt │ ├── .ds_store │ ├── SplineInit.m │ ├── rms.m │ ├── steintrunc.m │ ├── opttrunc.m │ ├── AutoTrunc.m │ ├── JamesStein.m │ ├── adfig02.m │ ├── AdaptCleanup.m │ └── AdaptIntro.m ├── MIPT │ ├── GaussT.mat │ ├── CauchyT.mat │ ├── MIPTCleanup.m │ ├── MIPTInit.m │ ├── MultiLMIRefine.m │ ├── MultiMedRefine.m │ ├── mitable51.m │ └── MIPTIntro.m ├── Tour │ ├── .DS_Store │ ├── fasthist.m │ ├── rootogram.m │ ├── toufig02.m │ ├── toufig11.m │ ├── LogoGram.m │ └── TourIntro.m ├── Asymp │ ├── ESCAsim.mat │ ├── goodfit.mat │ ├── scatter.mat │ ├── reverse.m │ └── AsympIntro.m ├── Blocky │ ├── .DS_Store │ ├── BlockyInit.m │ ├── BlockyCleanup.m │ ├── MakeAllFilters.m │ ├── BlockyIntro.m │ └── BlockyDemo2.m ├── Correl │ ├── .DS_Store │ ├── datasave.mat │ ├── MAD.m │ ├── NoiseFrac.m │ ├── detect.m │ ├── Noisegen.m │ ├── errtot.m │ ├── fbm.m │ └── PlotWaveCoeffLocal.m ├── MinEntSeg │ ├── .DS_Store │ ├── bloxplot.m │ ├── MESInit.m │ ├── MakeBumps.m │ ├── off_filter.m │ └── mefig205.m ├── SpinCycle │ ├── .DS_Store │ ├── SpinCycleInit.m │ ├── cyclespin.m │ ├── ModulateWavelab.m │ ├── cspinf16.m │ ├── FourierDeNoise.m │ ├── cspinf02.m │ └── CSpinCleanup.m ├── ShortCourse │ ├── Figure19.mat │ ├── MedTriadUp.m │ ├── triadlength.m │ ├── IWT_SegAI.m │ ├── MedTriadDown.m │ ├── HCoarsen.m │ ├── FHT_Med.m │ ├── FigNameString.m │ ├── SAIDyadDown.m │ ├── IHT_Med.m │ ├── SAIDyadUp.m │ ├── FWT_SegAI.m │ ├── SegRefine.m │ ├── scfig21.m │ └── scfig05.m ├── RiskAnalysis │ ├── close_updates.m │ ├── reset_updates2.m │ ├── reset_updates1.m │ ├── clear_updates.m │ ├── use_threshold.m │ ├── NewZoom.m │ ├── use_wavelet.m │ ├── redo_plot.m │ ├── sonify.m │ ├── mtitle.m │ └── plot_newdata.m ├── VillardDeLans │ ├── VdLCleanup.m │ ├── VdLInit.m │ └── vdlfig01.m └── Ideal │ ├── claxis.m │ ├── idealwts.m │ ├── IMJPlotWaveCoeff.m │ ├── idfig03.m │ └── IdealIntro.m ├── Browsers ├── .DS_Store ├── One-D │ ├── .DS_Store │ ├── def_bell.m │ ├── def_nonlin.m │ ├── def_shrinker.m │ ├── NewZoom.m │ ├── def_siglen.m │ ├── def_nlevel.m │ ├── wl_spectrum.m │ ├── plot_new_data.m │ ├── sonify.m │ ├── update_plot.m │ ├── setfigure.m │ ├── reset_slider.m │ └── def_filter.m ├── Contents.m └── WaveTour │ └── Contents.m ├── Books ├── WaveTour │ ├── .DS_Store │ ├── WTCh04 │ │ ├── realpow.m │ │ ├── quadinterpol.m │ │ ├── Analytic.m │ │ └── ourphase.m │ ├── WTCh07 │ │ ├── modulo.m │ │ ├── beta01.m │ │ ├── NormedIFFT.m │ │ ├── Sigma8.m │ │ ├── Meyerhath.m │ │ ├── wt07fig23.m │ │ └── DisplayProjV.m │ ├── WTCh06 │ │ ├── wt06fig09.m │ │ ├── wt06fig10.m │ │ ├── wt06fig11.m │ │ ├── CalcFtheo.m │ │ ├── cantor.m │ │ ├── ConjGrad.m │ │ ├── DownShift.m │ │ ├── RightShift.m │ │ └── mMakeBrownian.m │ ├── WTCh10 │ │ ├── wt10fig06.m │ │ ├── wt10fig14.m │ │ └── wt10fig13.m │ ├── WTCh09 │ │ └── wt09fig10.m │ ├── Contents.m │ ├── WTCh02 │ │ └── WTCh02Demo.m │ ├── WTCh08 │ │ ├── PlotSquareWPPlane.m │ │ ├── PlotMBandPlane.m │ │ ├── PlotSquareCPPlane.m │ │ └── wt08fig21.m │ └── WTCh05 │ │ └── WTCh05Demo.m └── Contents.m ├── corfig10.m ├── MEXSource ├── mirrorfilt.c ├── mirrorsymmfilt.c ├── matmpy.c ├── downhipbs.c ├── downlopbs.c ├── downlo.c ├── uphipbs.c └── uplopbs.c ├── Documentation ├── VERSION.m ├── FEEDBACK.m ├── REGISTRATION.m └── SUPPORT.m ├── Utilities ├── expand.m ├── ShapeAsRow.m ├── pic256.m ├── rnshift.m ├── UnlockAxes.m ├── WaitUntil.m ├── GrayImage.m ├── getlength.m ├── LockAxes.m └── WhiteNoise.m ├── Continuous ├── IAWT.m ├── CalcCWTNorms.m ├── CalcCWTPars.m └── CalcCWTScale.m ├── Packets ├── One-D │ ├── KLinCP.m │ ├── WrapAround.m │ ├── node.m │ └── packet.m └── Two-D │ └── qnode.m ├── Workouts ├── Toons │ ├── toon1102.m │ ├── toon1101.m │ ├── toon1103.m │ ├── toon1105.m │ ├── toon1106.m │ ├── toon1104.m │ ├── toon1107.m │ ├── toon0521.m │ ├── KeepFirst.m │ ├── toon1002.m │ ├── toon1001.m │ ├── toon1005.m │ ├── toon1003.m │ ├── toon1004.m │ ├── toon1007.m │ ├── toon0541.m │ ├── toon1006.m │ ├── toon0544.m │ ├── toon0511.m │ ├── PlotOrderedCoef.m │ ├── KeepBiggest.m │ ├── toon0841.m │ ├── toon0542.m │ ├── toon0522.m │ ├── toon0741.m │ ├── toon0548.m │ ├── toon0545.m │ ├── toon0233.m │ ├── PlotLevelNorms.m │ ├── toon0512.m │ ├── toon0547.m │ ├── toon0231.m │ ├── toon0513.m │ ├── toon0232.m │ ├── toon0552.m │ ├── toon0543.m │ ├── toon0562.m │ ├── toon0333.m │ ├── toon0563.m │ ├── toon0565.m │ ├── toon0514.m │ └── toon0811.m ├── BestOrthoBasis │ └── BBWork43.m ├── Contents.m └── MatchingPursuit │ ├── PlotSemiCompressNum.m │ ├── PlotEquivRate.m │ └── MPWork43.m ├── Invariant ├── FWT2_Atrou.m ├── MM2_DWT.m ├── IMM2_DWT.m ├── MM_DWT.m └── IWT_Stat.m ├── Pursuit ├── CPBPursuitTour.m ├── WPBPursuitTour.m ├── GaborPursuitTour.m ├── ix2pkt.m └── pkt2ix.m ├── Median └── HigherDegree │ ├── PlotPoly.m │ ├── localmaxima.m │ ├── realpolyroots.m │ └── Contents.m ├── DeNoising ├── cyclespin2.m ├── HardThresh.m ├── GWN.m ├── GWN2.m ├── SoftThresh.m ├── SNR.m ├── GWNoisy2.m ├── GWNoisy.m ├── Wiener.m ├── SUREThresh.m ├── MultiSURE.m ├── MultiHybrid.m ├── Wiener2.m ├── MultiVisu.m └── MinMaxThresh.m ├── Orthogonal ├── dyad.m ├── lshift.m ├── reverse.m ├── rshift.m ├── dyad2ix.m ├── DownDyadLo.m ├── DownDyadHi.m ├── MirrorFilt.m ├── dyadlength.m ├── UpDyadLo.m ├── UpDyadHi.m └── UpSampleN.m ├── Fractals └── Contents.m ├── Biorthogonal ├── extend.m ├── dyadpartition.m ├── DownDyadLo_PBS.m ├── DownDyadHi_PBS.m ├── MirrorSymmFilt.m ├── UpDyadLo_PBS.m └── UpDyadHi_PBS.m ├── FastAlgorithms └── ndyad.m ├── TimeFrequency └── Interpol2.m └── reverse.m /Datasets/barb.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Datasets/lady.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Datasets/barb.raw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gregfreeman/wavelab850/HEAD/Datasets/barb.raw -------------------------------------------------------------------------------- /Papers/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gregfreeman/wavelab850/HEAD/Papers/.DS_Store -------------------------------------------------------------------------------- /Browsers/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gregfreeman/wavelab850/HEAD/Browsers/.DS_Store -------------------------------------------------------------------------------- /Datasets/barton.raw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gregfreeman/wavelab850/HEAD/Datasets/barton.raw -------------------------------------------------------------------------------- /Datasets/coifman.raw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gregfreeman/wavelab850/HEAD/Datasets/coifman.raw -------------------------------------------------------------------------------- /Datasets/lenna.raw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gregfreeman/wavelab850/HEAD/Datasets/lenna.raw -------------------------------------------------------------------------------- /Datasets/mriscan.raw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gregfreeman/wavelab850/HEAD/Datasets/mriscan.raw -------------------------------------------------------------------------------- /Datasets/msignal.asc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gregfreeman/wavelab850/HEAD/Datasets/msignal.asc -------------------------------------------------------------------------------- /Datasets/msignal.txt: -------------------------------------------------------------------------------- 1 | Artificial signal in the article of Mallat & Zhong 2 | Length = 256 3 | -------------------------------------------------------------------------------- /Datasets/phone.raw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gregfreeman/wavelab850/HEAD/Datasets/phone.raw -------------------------------------------------------------------------------- /Datasets/Internet.lnk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gregfreeman/wavelab850/HEAD/Datasets/Internet.lnk -------------------------------------------------------------------------------- /Datasets/canaletto.raw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gregfreeman/wavelab850/HEAD/Datasets/canaletto.raw -------------------------------------------------------------------------------- /Papers/Adapt/.ds_store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gregfreeman/wavelab850/HEAD/Papers/Adapt/.ds_store -------------------------------------------------------------------------------- /Papers/MIPT/GaussT.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gregfreeman/wavelab850/HEAD/Papers/MIPT/GaussT.mat -------------------------------------------------------------------------------- /Papers/Tour/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gregfreeman/wavelab850/HEAD/Papers/Tour/.DS_Store -------------------------------------------------------------------------------- /Books/WaveTour/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gregfreeman/wavelab850/HEAD/Books/WaveTour/.DS_Store -------------------------------------------------------------------------------- /Browsers/One-D/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gregfreeman/wavelab850/HEAD/Browsers/One-D/.DS_Store -------------------------------------------------------------------------------- /Datasets/daubechies.raw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gregfreeman/wavelab850/HEAD/Datasets/daubechies.raw -------------------------------------------------------------------------------- /Datasets/fingerprint.raw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gregfreeman/wavelab850/HEAD/Datasets/fingerprint.raw -------------------------------------------------------------------------------- /Datasets/peppers256.raw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gregfreeman/wavelab850/HEAD/Datasets/peppers256.raw -------------------------------------------------------------------------------- /Papers/Asymp/ESCAsim.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gregfreeman/wavelab850/HEAD/Papers/Asymp/ESCAsim.mat -------------------------------------------------------------------------------- /Papers/Asymp/goodfit.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gregfreeman/wavelab850/HEAD/Papers/Asymp/goodfit.mat -------------------------------------------------------------------------------- /Papers/Asymp/scatter.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gregfreeman/wavelab850/HEAD/Papers/Asymp/scatter.mat -------------------------------------------------------------------------------- /Papers/Blocky/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gregfreeman/wavelab850/HEAD/Papers/Blocky/.DS_Store -------------------------------------------------------------------------------- /Papers/Correl/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gregfreeman/wavelab850/HEAD/Papers/Correl/.DS_Store -------------------------------------------------------------------------------- /Papers/MIPT/CauchyT.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gregfreeman/wavelab850/HEAD/Papers/MIPT/CauchyT.mat -------------------------------------------------------------------------------- /Papers/Correl/datasave.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gregfreeman/wavelab850/HEAD/Papers/Correl/datasave.mat -------------------------------------------------------------------------------- /Papers/MinEntSeg/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gregfreeman/wavelab850/HEAD/Papers/MinEntSeg/.DS_Store -------------------------------------------------------------------------------- /Papers/SpinCycle/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gregfreeman/wavelab850/HEAD/Papers/SpinCycle/.DS_Store -------------------------------------------------------------------------------- /Papers/ShortCourse/Figure19.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gregfreeman/wavelab850/HEAD/Papers/ShortCourse/Figure19.mat -------------------------------------------------------------------------------- /Datasets/SonRemy.txt: -------------------------------------------------------------------------------- 1 | SonRemy.asc -- Vocalises 2 | 3 | Access 4 | sig = ReadSignal('SonRemy'); 5 | 6 | Size 7 | Houla! 8 | 9 | Source 10 | Remy... 11 | -------------------------------------------------------------------------------- /corfig10.m: -------------------------------------------------------------------------------- 1 | 2 | 3 | % 4 | % Part of Wavelab Version 850 5 | % Built Tue Jan 3 13:20:38 EST 2006 6 | % This is Copyrighted Material 7 | % For Copying permissions see COPYING.m 8 | % Comments? e-mail wavelab@stat.stanford.edu 9 | -------------------------------------------------------------------------------- /Browsers/Contents.m: -------------------------------------------------------------------------------- 1 | % Browsers:Contents v850 -- WaveLab Browsers 2 | % 3 | % This directory contains browsers for use with WaveLab 4 | % 5 | % One-D - One-D signal browser 6 | % WaveTour - Browser for Mallat's Book 7 | % 8 | -------------------------------------------------------------------------------- /MEXSource/mirrorfilt.c: -------------------------------------------------------------------------------- 1 | void mirrorfilt(lpf,hpf,length) 2 | double *lpf, *hpf; 3 | int length; 4 | { 5 | int i,isign; 6 | isign = 1; 7 | for(i=0; i < length; i++){ 8 | *hpf++ = isign * *lpf++; 9 | isign *= -1; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Documentation/VERSION.m: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | % 6 | % Part of Wavelab Version 850 7 | % Built Tue Jan 3 13:20:40 EST 2006 8 | % This is Copyrighted Material 9 | % For Copying permissions see COPYING.m 10 | % Comments? e-mail wavelab@stat.stanford.edu 11 | -------------------------------------------------------------------------------- /Datasets/esca.txt: -------------------------------------------------------------------------------- 1 | esca.asc -- ESCA signal 2 | 3 | Access 4 | Esca = ReadSignal('ESCA'); 5 | 6 | Size 7 | 1024 by 1 8 | 9 | Source 10 | This ESCA spectrum was provided by J.P. Bib\'erian, of the 11 | Universit\'e de Marseille -- Luminy. 12 | 13 | -------------------------------------------------------------------------------- /Datasets/sunspots.txt: -------------------------------------------------------------------------------- 1 | sunspots.asc -- Monthly sunspot numbers 2 | 3 | Access 4 | spots = ReadSignal('Sunspots'); 5 | 6 | Size 7 | 2700 by 1 8 | 9 | Description 10 | Monthly sunspot numbers for 225 years. 11 | 12 | Source 13 | Jeff Scargle 14 | -------------------------------------------------------------------------------- /Datasets/HochNMR.txt: -------------------------------------------------------------------------------- 1 | HochNMR.asc -- NMR signal 2 | 3 | Access 4 | nmrsig = ReadSignal('HochNMR'); 5 | 6 | Size 7 | 1024 by 1 8 | 9 | Source 10 | This NMR signal was provided by J.C. Hoch, of the 11 | Rowland Institute for Science, Cambridge, Mass. 12 | 13 | 14 | -------------------------------------------------------------------------------- /Utilities/expand.m: -------------------------------------------------------------------------------- 1 | function y = expand(x,n) 2 | y=resample(x,n,length(x)); 3 | 4 | % 5 | % Part of Wavelab Version 850 6 | % Built Tue Jan 3 13:20:43 EST 2006 7 | % This is Copyrighted Material 8 | % For Copying permissions see COPYING.m 9 | % Comments? e-mail wavelab@stat.stanford.edu 10 | -------------------------------------------------------------------------------- /Continuous/IAWT.m: -------------------------------------------------------------------------------- 1 | % This function is not yet implemented in WaveLab. 2 | 3 | 4 | 5 | 6 | % 7 | % Part of Wavelab Version 850 8 | % Built Tue Jan 3 13:20:39 EST 2006 9 | % This is Copyrighted Material 10 | % For Copying permissions see COPYING.m 11 | % Comments? e-mail wavelab@stat.stanford.edu 12 | -------------------------------------------------------------------------------- /Papers/MIPT/MIPTCleanup.m: -------------------------------------------------------------------------------- 1 | % MedianCleanup -- remove all global variables 2 | 3 | 4 | 5 | 6 | % 7 | % Part of Wavelab Version 850 8 | % Built Tue Jan 3 13:20:41 EST 2006 9 | % This is Copyrighted Material 10 | % For Copying permissions see COPYING.m 11 | % Comments? e-mail wavelab@stat.stanford.edu 12 | -------------------------------------------------------------------------------- /Datasets/phone.txt: -------------------------------------------------------------------------------- 1 | phone.raw -- Gray-scale image of telephone 2 | 3 | Access 4 | ETPhoneHome = ReadImage('Phone'); 5 | 6 | Size 7 | 128 by 128 8 | 9 | Gray Levels 10 | 256 11 | 12 | Description 13 | Images liks this are used often in the edge 14 | detection literature of computer vision. 15 | -------------------------------------------------------------------------------- /Papers/MIPT/MIPTInit.m: -------------------------------------------------------------------------------- 1 | % MedianInit -- setup all global variables 2 | 3 | 4 | 5 | 6 | 7 | % 8 | % Part of Wavelab Version 850 9 | % Built Tue Jan 3 13:20:42 EST 2006 10 | % This is Copyrighted Material 11 | % For Copying permissions see COPYING.m 12 | % Comments? e-mail wavelab@stat.stanford.edu 13 | -------------------------------------------------------------------------------- /Packets/One-D/KLinCP.m: -------------------------------------------------------------------------------- 1 | % This function is not yet implemented in WaveLab. 2 | 3 | 4 | 5 | 6 | 7 | % 8 | % Part of Wavelab Version 850 9 | % Built Tue Jan 3 13:20:40 EST 2006 10 | % This is Copyrighted Material 11 | % For Copying permissions see COPYING.m 12 | % Comments? e-mail wavelab@stat.stanford.edu 13 | -------------------------------------------------------------------------------- /Books/WaveTour/WTCh04/realpow.m: -------------------------------------------------------------------------------- 1 | function r = realpow(x,d) 2 | 3 | r=(real(x)).^d; 4 | 5 | 6 | 7 | 8 | 9 | % 10 | % Part of Wavelab Version 850 11 | % Built Tue Jan 3 13:20:38 EST 2006 12 | % This is Copyrighted Material 13 | % For Copying permissions see COPYING.m 14 | % Comments? e-mail wavelab@stat.stanford.edu 15 | -------------------------------------------------------------------------------- /Papers/Correl/MAD.m: -------------------------------------------------------------------------------- 1 | function m = MAD(x) 2 | m = median( abs ( x - median(x) ) ) ./ .6745; 3 | 4 | 5 | 6 | 7 | % 8 | % Part of Wavelab Version 850 9 | % Built Tue Jan 3 13:20:41 EST 2006 10 | % This is Copyrighted Material 11 | % For Copying permissions see COPYING.m 12 | % Comments? e-mail wavelab@stat.stanford.edu 13 | -------------------------------------------------------------------------------- /Papers/RiskAnalysis/close_updates.m: -------------------------------------------------------------------------------- 1 | global fig_update 2 | 3 | close; 4 | fig_update = []; 5 | 6 | 7 | 8 | 9 | % 10 | % Part of Wavelab Version 850 11 | % Built Tue Jan 3 13:20:42 EST 2006 12 | % This is Copyrighted Material 13 | % For Copying permissions see COPYING.m 14 | % Comments? e-mail wavelab@stat.stanford.edu 15 | -------------------------------------------------------------------------------- /Datasets/seismic.txt: -------------------------------------------------------------------------------- 1 | seismic.asc -- Seismic signal 2 | 3 | Access 4 | Shakin = ReadSignal('Seismic'); 5 | 6 | Size 7 | 1024 by 1 8 | 9 | Source 10 | This seismic signal is distributed throughout the 11 | seismic industry as a test dataset that comes free 12 | as part of the PROMAX seismic processing system. 13 | 14 | -------------------------------------------------------------------------------- /Datasets/transients.txt: -------------------------------------------------------------------------------- 1 | transients.asc -- Mallat/Zhang's artificial signal 2 | 3 | Access 4 | spots = ReadSignal('Transients'); 5 | 6 | Size 7 | 512 by 1 8 | 9 | Description 10 | Built from time-frequency transients of different types. 11 | 12 | Source 13 | See Mallat and Zhang's 1993 article on Matching Pursuit. 14 | 15 | -------------------------------------------------------------------------------- /Papers/SpinCycle/SpinCycleInit.m: -------------------------------------------------------------------------------- 1 | % SpinCycleInit -- setup global datastructures for SpinCycle 2 | % 3 | CSInit 4 | 5 | 6 | 7 | 8 | % 9 | % Part of Wavelab Version 850 10 | % Built Tue Jan 3 13:20:42 EST 2006 11 | % This is Copyrighted Material 12 | % For Copying permissions see COPYING.m 13 | % Comments? e-mail wavelab@stat.stanford.edu 14 | -------------------------------------------------------------------------------- /Browsers/One-D/def_bell.m: -------------------------------------------------------------------------------- 1 | function def_bell(m) 2 | % def_bell -- Called by WLBrowser 3 | % Usage 4 | % def_bell(m) 5 | % 6 | 7 | 8 | 9 | % 10 | % Part of Wavelab Version 850 11 | % Built Tue Jan 3 13:20:39 EST 2006 12 | % This is Copyrighted Material 13 | % For Copying permissions see COPYING.m 14 | % Comments? e-mail wavelab@stat.stanford.edu 15 | -------------------------------------------------------------------------------- /Papers/VillardDeLans/VdLCleanup.m: -------------------------------------------------------------------------------- 1 | % VdLCleanup -- Remove global datastructures for VdL 2 | 3 | clear global ent_min 4 | 5 | 6 | 7 | 8 | % 9 | % Part of Wavelab Version 850 10 | % Built Tue Jan 3 13:20:42 EST 2006 11 | % This is Copyrighted Material 12 | % For Copying permissions see COPYING.m 13 | % Comments? e-mail wavelab@stat.stanford.edu 14 | -------------------------------------------------------------------------------- /Books/Contents.m: -------------------------------------------------------------------------------- 1 | % Books:Contents v$VERSION$ -- Books using Wavelab 2 | % 3 | % This directory contains code to reproduce books using WaveLab 4 | % 5 | % WaveTour - Figures of the book "A Wavelet Tour of Signal Processing" 6 | % Stephane Mallat, Academic Press, 1998 7 | % 8 | % This book explains the applications of wavelets to signal processing. 9 | -------------------------------------------------------------------------------- /Datasets/mriscan.txt: -------------------------------------------------------------------------------- 1 | mriscan.raw -- Gray-scale MRI brain scan 2 | 3 | Access 4 | Brain = ReadImage('MRIScan'); 5 | 6 | Size 7 | 256 by 256 8 | 9 | Gray Levels 10 | 256 11 | 12 | Source 13 | Obtained from the NIH IMAGE program, a public domain 14 | software package distributed freely by the National 15 | Institutes of Health. 16 | -------------------------------------------------------------------------------- /MEXSource/mirrorsymmfilt.c: -------------------------------------------------------------------------------- 1 | void mirrorsymmfilt(lpf,hpf,length) 2 | double *lpf, *hpf; 3 | int length; 4 | { 5 | int i,k,isign; 6 | 7 | k = (length - 1) / 2; 8 | 9 | isign = 1; 10 | for(i=0; i 0, 4 | s = [x((n+1-k):n) x(1:(n-k))]; 5 | else 6 | s = [x((-k+1):n) x(1:(-k)) ]; 7 | end 8 | 9 | 10 | 11 | 12 | % 13 | % Part of Wavelab Version 850 14 | % Built Tue Jan 3 13:20:42 EST 2006 15 | % This is Copyrighted Material 16 | % For Copying permissions see COPYING.m 17 | % Comments? e-mail wavelab@stat.stanford.edu 18 | -------------------------------------------------------------------------------- /Papers/Adapt/steintrunc.m: -------------------------------------------------------------------------------- 1 | function x = steintrunc(y,sig) % steintrunc -- Perform Truncation % Usage % x = steintrunc(y,sig) % u = opttrunc(y ./sig); t = min(u); indmin = find(u==t); x = y .* ((1:length(y)) <= indmin); 2 | 3 | % 4 | % Part of Wavelab Version 850 5 | % Built Tue Jan 3 13:20:41 EST 2006 6 | % This is Copyrighted Material 7 | % For Copying permissions see COPYING.m 8 | % Comments? e-mail wavelab@stat.stanford.edu 9 | -------------------------------------------------------------------------------- /Workouts/Toons/toon1102.m: -------------------------------------------------------------------------------- 1 | % toon1102 -- Cosine Packet Analysis on Ramp 2 | % 3 | n = 1024; 4 | D = 5; 5 | % 6 | signal = MakeSignal('Ramp', n); 7 | CPTour('P', signal, D, 'Ramp'); 8 | 9 | 10 | 11 | 12 | % 13 | % Part of Wavelab Version 850 14 | % Built Tue Jan 3 13:20:43 EST 2006 15 | % This is Copyrighted Material 16 | % For Copying permissions see COPYING.m 17 | % Comments? e-mail wavelab@stat.stanford.edu 18 | -------------------------------------------------------------------------------- /Papers/Adapt/opttrunc.m: -------------------------------------------------------------------------------- 1 | function urisk = opttrunc(y) % opttrunc -- Perform Truncation % Usage % urisk = opttrunc(y) % tails = reverse(cumsum(reverse(abs(y).^2))); n = length(y); penalty = (-n):2:(n-2); urisk = tails + penalty; 2 | 3 | % 4 | % Part of Wavelab Version 850 5 | % Built Tue Jan 3 13:20:41 EST 2006 6 | % This is Copyrighted Material 7 | % For Copying permissions see COPYING.m 8 | % Comments? e-mail wavelab@stat.stanford.edu 9 | -------------------------------------------------------------------------------- /Papers/VillardDeLans/VdLInit.m: -------------------------------------------------------------------------------- 1 | % VdLInit -- setup global data structures for VdLDemo 2 | 3 | global ent_min tau_min y x 4 | 5 | % Revision History 6 | % 09/29/99 MRD declared variables global 7 | 8 | 9 | 10 | 11 | % 12 | % Part of Wavelab Version 850 13 | % Built Tue Jan 3 13:20:42 EST 2006 14 | % This is Copyrighted Material 15 | % For Copying permissions see COPYING.m 16 | % Comments? e-mail wavelab@stat.stanford.edu 17 | -------------------------------------------------------------------------------- /Workouts/Toons/toon1101.m: -------------------------------------------------------------------------------- 1 | % toon1101 -- Cosine Packet Analysis on LoSine 2 | % 3 | n = 1024; 4 | D = 5; 5 | % 6 | signal = MakeSignal('LoSine', n); 7 | CPTour('P', signal, D, 'LoSine'); 8 | 9 | 10 | 11 | 12 | % 13 | % Part of Wavelab Version 850 14 | % Built Tue Jan 3 13:20:43 EST 2006 15 | % This is Copyrighted Material 16 | % For Copying permissions see COPYING.m 17 | % Comments? e-mail wavelab@stat.stanford.edu 18 | -------------------------------------------------------------------------------- /Workouts/Toons/toon1103.m: -------------------------------------------------------------------------------- 1 | % toon1103 -- Cosine Packet Analysis on Doppler 2 | % 3 | n = 1024; 4 | D = 5; 5 | % 6 | signal = MakeSignal('Doppler', n); 7 | CPTour('P', signal, D, 'Doppler'); 8 | 9 | 10 | 11 | 12 | % 13 | % Part of Wavelab Version 850 14 | % Built Tue Jan 3 13:20:43 EST 2006 15 | % This is Copyrighted Material 16 | % For Copying permissions see COPYING.m 17 | % Comments? e-mail wavelab@stat.stanford.edu 18 | -------------------------------------------------------------------------------- /Workouts/Toons/toon1105.m: -------------------------------------------------------------------------------- 1 | % toon1105 -- Cosine Packet Analysis on HiSine 2 | % 3 | n = 1024; 4 | D = 5; 5 | % 6 | signal = MakeSignal('HiSine', n); 7 | CPTour('P', signal, D, 'HiSine'); 8 | 9 | 10 | 11 | 12 | % 13 | % Part of Wavelab Version 850 14 | % Built Tue Jan 3 13:20:43 EST 2006 15 | % This is Copyrighted Material 16 | % For Copying permissions see COPYING.m 17 | % Comments? e-mail wavelab@stat.stanford.edu 18 | -------------------------------------------------------------------------------- /Workouts/Toons/toon1106.m: -------------------------------------------------------------------------------- 1 | % toon1106 -- Cosine Packet Analysis on LinChirp 2 | % 3 | n = 1024; 4 | D = 5; 5 | % 6 | signal = MakeSignal('LinChirp', n); 7 | CPTour('P', signal, D, 'LinChirp'); 8 | 9 | 10 | 11 | 12 | % 13 | % Part of Wavelab Version 850 14 | % Built Tue Jan 3 13:20:43 EST 2006 15 | % This is Copyrighted Material 16 | % For Copying permissions see COPYING.m 17 | % Comments? e-mail wavelab@stat.stanford.edu 18 | -------------------------------------------------------------------------------- /MEXSource/matmpy.c: -------------------------------------------------------------------------------- 1 | #define A(i,k) a[k + i*n] 2 | #define B(k,j) b[j + k*m] 3 | #define C(i,j) c[j + i*n] 4 | 5 | void matmpy(a,n,m,b,l,c) 6 | DOUBLE a[],b[],c[]; 7 | int n,m,l; 8 | { 9 | int i,j,k; 10 | DOUBLE s; 11 | 12 | for( i=0 ; i < n; i++){ 13 | for( j=0; j < l; j++){ 14 | s = 0.; 15 | for( k=0; k< m; k++){ 16 | s += A(i,k)*B(k,j); 17 | } 18 | C(i,j) = s; 19 | } 20 | } 21 | } 22 | 23 | -------------------------------------------------------------------------------- /Workouts/Toons/toon1104.m: -------------------------------------------------------------------------------- 1 | % toon1104 -- Cosine Packet Analysis on Dirac 2 | % 3 | n = 1024; 4 | D = 5; 5 | % 6 | signal = zeros(1,n); 7 | signal(n/2) = 1; 8 | CPTour('P', signal, D, 'Dirac'); 9 | 10 | 11 | 12 | 13 | % 14 | % Part of Wavelab Version 850 15 | % Built Tue Jan 3 13:20:43 EST 2006 16 | % This is Copyrighted Material 17 | % For Copying permissions see COPYING.m 18 | % Comments? e-mail wavelab@stat.stanford.edu 19 | -------------------------------------------------------------------------------- /Workouts/Toons/toon1107.m: -------------------------------------------------------------------------------- 1 | % toon1107 -- Cosine Packet Analysis on QuadChirp 2 | % 3 | n = 1024; 4 | D = 5; 5 | % 6 | signal = MakeSignal('QuadChirp', n); 7 | CPTour('P', signal, D, 'QuadChirp'); 8 | 9 | 10 | 11 | 12 | % 13 | % Part of Wavelab Version 850 14 | % Built Tue Jan 3 13:20:43 EST 2006 15 | % This is Copyrighted Material 16 | % For Copying permissions see COPYING.m 17 | % Comments? e-mail wavelab@stat.stanford.edu 18 | -------------------------------------------------------------------------------- /Papers/Correl/NoiseFrac.m: -------------------------------------------------------------------------------- 1 | function [x,y,zz] = NoiseFrac(f,rho,alpha) 2 | 3 | sig = std(f); 4 | x = (rho/sig).*f; 5 | 6 | zz = fbm(alpha,length(f)); 7 | zz = zz ./ std(zz); 8 | 9 | y = x + zz; 10 | 11 | 12 | 13 | 14 | 15 | 16 | % 17 | % Part of Wavelab Version 850 18 | % Built Tue Jan 3 13:20:41 EST 2006 19 | % This is Copyrighted Material 20 | % For Copying permissions see COPYING.m 21 | % Comments? e-mail wavelab@stat.stanford.edu 22 | -------------------------------------------------------------------------------- /Workouts/Toons/toon0521.m: -------------------------------------------------------------------------------- 1 | % toon0521 -- Progressive Transmission 2 | % 3 | % Show the MRI image of the brain 4 | % 5 | 6 | brain = ReadImage('MRIScan'); 7 | AutoImage(brain); 8 | title('MRI Image of the Brain'); 9 | 10 | 11 | 12 | 13 | % 14 | % Part of Wavelab Version 850 15 | % Built Tue Jan 3 13:20:43 EST 2006 16 | % This is Copyrighted Material 17 | % For Copying permissions see COPYING.m 18 | % Comments? e-mail wavelab@stat.stanford.edu 19 | -------------------------------------------------------------------------------- /Books/WaveTour/WTCh07/modulo.m: -------------------------------------------------------------------------------- 1 | function [m] = modulo(n,N); 2 | 3 | m = rem(rem(n-1,N)+N,N)+1; 4 | 5 | % Written by Maureen Clerc and Jerome Kalifa, 1997 6 | % clerc@cmapx.polytechnique.fr, kalifa@cmapx.polytechnique.fr 7 | 8 | 9 | 10 | 11 | % 12 | % Part of Wavelab Version 850 13 | % Built Tue Jan 3 13:20:39 EST 2006 14 | % This is Copyrighted Material 15 | % For Copying permissions see COPYING.m 16 | % Comments? e-mail wavelab@stat.stanford.edu 17 | -------------------------------------------------------------------------------- /Papers/SpinCycle/ModulateWavelab.m: -------------------------------------------------------------------------------- 1 | function y = ModulateWavelab(x,freq) 2 | y = x .* exp(sqrt(-1).*freq.*(0:(length(x)-1))); 3 | 4 | % Revision History 5 | % 10/1/05 AM the name of this function is changed 6 | 7 | 8 | 9 | 10 | 11 | % 12 | % Part of Wavelab Version 850 13 | % Built Tue Jan 3 13:20:42 EST 2006 14 | % This is Copyrighted Material 15 | % For Copying permissions see COPYING.m 16 | % Comments? e-mail wavelab@stat.stanford.edu 17 | -------------------------------------------------------------------------------- /Workouts/Toons/KeepFirst.m: -------------------------------------------------------------------------------- 1 | function sparse = KeepFirst(dense,N) 2 | % KeepFirst -- Kill (set to zero) all but N first elements 3 | % Usage 4 | % sparse = KeepFirst(dense,N) 5 | % 6 | sparse = dense .* (1:length(dense) <= N); 7 | 8 | 9 | 10 | 11 | % 12 | % Part of Wavelab Version 850 13 | % Built Tue Jan 3 13:20:43 EST 2006 14 | % This is Copyrighted Material 15 | % For Copying permissions see COPYING.m 16 | % Comments? e-mail wavelab@stat.stanford.edu 17 | -------------------------------------------------------------------------------- /Workouts/Toons/toon1002.m: -------------------------------------------------------------------------------- 1 | % toon1002 -- Wavelet Packet Analysis on Ramp 2 | % 3 | n = 1024; 4 | D = 5; 5 | qmf = MakeONFilter('Coiflet', 3); 6 | % 7 | signal = MakeSignal('Ramp', n); 8 | WPTour('P', signal, D, qmf, 'Ramp'); 9 | 10 | 11 | 12 | 13 | % 14 | % Part of Wavelab Version 850 15 | % Built Tue Jan 3 13:20:43 EST 2006 16 | % This is Copyrighted Material 17 | % For Copying permissions see COPYING.m 18 | % Comments? e-mail wavelab@stat.stanford.edu 19 | -------------------------------------------------------------------------------- /MEXSource/downhipbs.c: -------------------------------------------------------------------------------- 1 | void downhipbs(x,n,hpf,m,y) 2 | double x[],hpf[],y[]; 3 | int n,m; 4 | { 5 | int n2, i, h, j, k; 6 | double s; 7 | 8 | /* highpass version */ 9 | n2 = n/2; 10 | k = (m+1)/2; 11 | for(i=0;i= n) j -= n; 16 | while(j < 0) j += n; 17 | s += hpf[h]*x[j]; 18 | j--; 19 | } 20 | k += 2; 21 | y[i] = s; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Workouts/Toons/toon1001.m: -------------------------------------------------------------------------------- 1 | % toon1001 -- Wavelet Packet Analysis on LoSine 2 | % 3 | n = 1024; 4 | D = 5; 5 | qmf = MakeONFilter('Coiflet', 3); 6 | % 7 | signal = MakeSignal('LoSine', n); 8 | WPTour('P', signal, D, qmf, 'LoSine'); 9 | 10 | 11 | 12 | 13 | % 14 | % Part of Wavelab Version 850 15 | % Built Tue Jan 3 13:20:43 EST 2006 16 | % This is Copyrighted Material 17 | % For Copying permissions see COPYING.m 18 | % Comments? e-mail wavelab@stat.stanford.edu 19 | -------------------------------------------------------------------------------- /Workouts/Toons/toon1005.m: -------------------------------------------------------------------------------- 1 | % toon1005 -- Wavelet Packet Analysis on HiSine 2 | % 3 | n = 1024; 4 | D = 5; 5 | qmf = MakeONFilter('Coiflet', 3); 6 | % 7 | signal = MakeSignal('HiSine', n); 8 | WPTour('P', signal, D, qmf, 'HiSine'); 9 | 10 | 11 | 12 | 13 | % 14 | % Part of Wavelab Version 850 15 | % Built Tue Jan 3 13:20:43 EST 2006 16 | % This is Copyrighted Material 17 | % For Copying permissions see COPYING.m 18 | % Comments? e-mail wavelab@stat.stanford.edu 19 | -------------------------------------------------------------------------------- /Books/WaveTour/WTCh07/beta01.m: -------------------------------------------------------------------------------- 1 | function b = beta01(x); 2 | 3 | b = x.^4 .* (35 - 84.*x + 70 .* x.^2 - 20 .* x.^3); 4 | 5 | % Written by Maureen Clerc and Jerome Kalifa, 1997 6 | % clerc@cmapx.polytechnique.fr, kalifa@cmapx.polytechnique.fr 7 | 8 | 9 | 10 | 11 | % 12 | % Part of Wavelab Version 850 13 | % Built Tue Jan 3 13:20:39 EST 2006 14 | % This is Copyrighted Material 15 | % For Copying permissions see COPYING.m 16 | % Comments? e-mail wavelab@stat.stanford.edu 17 | -------------------------------------------------------------------------------- /MEXSource/downlopbs.c: -------------------------------------------------------------------------------- 1 | void downlopbs(x,n,lpf,m,y) 2 | double x[],lpf[],y[]; 3 | int n,m; 4 | { 5 | int n2, i, h, j, k; 6 | double s; 7 | 8 | /* lowpass version */ 9 | n2 = n/2; 10 | k = (m+1)/2 + n - m; 11 | for(i=0;i= n) j -= n; 16 | while(j < 0) j += n; 17 | s += lpf[h]*x[j]; 18 | j++; 19 | } 20 | k += 2; 21 | y[i] = s; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Workouts/Toons/toon1003.m: -------------------------------------------------------------------------------- 1 | % toon1003 -- Wavelet Packet Analysis on Doppler 2 | % 3 | n = 1024; 4 | D = 5; 5 | qmf = MakeONFilter('Coiflet', 3); 6 | % 7 | signal = MakeSignal('Doppler', n); 8 | WPTour('P', signal, D, qmf, 'Doppler'); 9 | 10 | 11 | 12 | 13 | % 14 | % Part of Wavelab Version 850 15 | % Built Tue Jan 3 13:20:43 EST 2006 16 | % This is Copyrighted Material 17 | % For Copying permissions see COPYING.m 18 | % Comments? e-mail wavelab@stat.stanford.edu 19 | -------------------------------------------------------------------------------- /Papers/Adapt/AutoTrunc.m: -------------------------------------------------------------------------------- 1 | function s = AutoTrunc(y,sig) % AutoTrunc -- Perform Truncation % Usage % s = AutoTrunc(y,sig) % v = fft(y) ./ sqrt(length(y)); n = length(y); hv = v(1:(n/2)); sv = steintrunc(hv,sig); vv = [sv 0 conj(sv((n/2):-1:2))]; s = sqrt(length(y)) .* real(ifft(vv)); 2 | 3 | % 4 | % Part of Wavelab Version 850 5 | % Built Tue Jan 3 13:20:41 EST 2006 6 | % This is Copyrighted Material 7 | % For Copying permissions see COPYING.m 8 | % Comments? e-mail wavelab@stat.stanford.edu 9 | -------------------------------------------------------------------------------- /Papers/Correl/detect.m: -------------------------------------------------------------------------------- 1 | function d = detect(xfit, level) 2 | % detect.m 3 | % thresholds XFIT to 0 or 1 using threshold LEVEL 4 | % d = 0 if xfit < level; = 1 if xfit > level, = .5 if xfit = level 5 | 6 | d = ( sign( xfit - level ) + 1)./ 2; 7 | 8 | 9 | 10 | 11 | 12 | % 13 | % Part of Wavelab Version 850 14 | % Built Tue Jan 3 13:20:41 EST 2006 15 | % This is Copyrighted Material 16 | % For Copying permissions see COPYING.m 17 | % Comments? e-mail wavelab@stat.stanford.edu 18 | -------------------------------------------------------------------------------- /Papers/RiskAnalysis/reset_updates2.m: -------------------------------------------------------------------------------- 1 | global upd_never upd_ever 2 | 3 | set(upd_never,'Value',1 - get(upd_ever,'Value')); 4 | 5 | if get(upd_never,'Value') == 1, 6 | Update = 'Never'; 7 | else 8 | Update = 'ever'; 9 | end; 10 | 11 | 12 | 13 | 14 | 15 | % 16 | % Part of Wavelab Version 850 17 | % Built Tue Jan 3 13:20:42 EST 2006 18 | % This is Copyrighted Material 19 | % For Copying permissions see COPYING.m 20 | % Comments? e-mail wavelab@stat.stanford.edu 21 | -------------------------------------------------------------------------------- /Workouts/Toons/toon1004.m: -------------------------------------------------------------------------------- 1 | % toon1004 -- Wavelet Packet Analysis on Dirac 2 | % 3 | n = 1024; 4 | D = 5; 5 | qmf = MakeONFilter('Coiflet', 3); 6 | % 7 | signal = zeros(1,n); 8 | signal(n/2) = 1; 9 | WPTour('P', signal, D, qmf, 'Dirac'); 10 | 11 | 12 | 13 | 14 | % 15 | % Part of Wavelab Version 850 16 | % Built Tue Jan 3 13:20:43 EST 2006 17 | % This is Copyrighted Material 18 | % For Copying permissions see COPYING.m 19 | % Comments? e-mail wavelab@stat.stanford.edu 20 | -------------------------------------------------------------------------------- /Workouts/Toons/toon1007.m: -------------------------------------------------------------------------------- 1 | % toon1007 -- Wavelet Packet Analysis on QuadChirp 2 | % 3 | n = 1024; 4 | D = 5; 5 | qmf = MakeONFilter('Coiflet', 3); 6 | % 7 | signal = MakeSignal('QuadChirp', n); 8 | WPTour('P', signal, D, qmf, 'QuadChirp'); 9 | 10 | 11 | 12 | 13 | % 14 | % Part of Wavelab Version 850 15 | % Built Tue Jan 3 13:20:43 EST 2006 16 | % This is Copyrighted Material 17 | % For Copying permissions see COPYING.m 18 | % Comments? e-mail wavelab@stat.stanford.edu 19 | -------------------------------------------------------------------------------- /Invariant/FWT2_Atrou.m: -------------------------------------------------------------------------------- 1 | % The forward dyadic wavelet trasnsform with the Algorithme a 2 | % trous is not yet implemented in Wavelab. It is implemented in the 3 | % LastWave software, which is available on the Internet at 4 | % http://www.cmap.polytechnique.fr/users/www.bacry 5 | 6 | 7 | 8 | % 9 | % Part of Wavelab Version 850 10 | % Built Tue Jan 3 13:20:40 EST 2006 11 | % This is Copyrighted Material 12 | % For Copying permissions see COPYING.m 13 | % Comments? e-mail wavelab@stat.stanford.edu 14 | -------------------------------------------------------------------------------- /Workouts/Toons/toon0541.m: -------------------------------------------------------------------------------- 1 | % toon0541 -- Data Compression of Ingrid Daubechies 2 | % 3 | % First a picture of Ingrid. 4 | % 5 | ingrid = ReadImage('Daubechies'); 6 | % 7 | subplot(111) 8 | GrayImage(ingrid) 9 | title('Ingrid Daubechies'); 10 | 11 | 12 | 13 | 14 | 15 | % 16 | % Part of Wavelab Version 850 17 | % Built Tue Jan 3 13:20:43 EST 2006 18 | % This is Copyrighted Material 19 | % For Copying permissions see COPYING.m 20 | % Comments? e-mail wavelab@stat.stanford.edu 21 | -------------------------------------------------------------------------------- /Workouts/Toons/toon1006.m: -------------------------------------------------------------------------------- 1 | % toon1006 -- Wavelet Packet Analysis on LinChirp 2 | % 3 | n = 1024; 4 | D = 5; 5 | qmf = MakeONFilter('Coiflet', 3); 6 | % 7 | signal = MakeSignal('LinChirp', n); 8 | WPTour('P', signal, D, qmf, 'LinChirp'); 9 | 10 | 11 | 12 | 13 | 14 | % 15 | % Part of Wavelab Version 850 16 | % Built Tue Jan 3 13:20:43 EST 2006 17 | % This is Copyrighted Material 18 | % For Copying permissions see COPYING.m 19 | % Comments? e-mail wavelab@stat.stanford.edu 20 | -------------------------------------------------------------------------------- /Datasets/RaphNMR.txt: -------------------------------------------------------------------------------- 1 | RaphNMR.asc -- NMR signal 2 | 3 | Access 4 | nmrsig = ReadSignal('RaphNMR'); 5 | 6 | Size 7 | 1024 by 1 8 | 9 | Source 10 | MRS Unit, VA Medical Center, San Francisco. 11 | Adrain Maudsley, Ph.D., Professor of Radiology. 12 | 13 | This NMR signal was obtained from Chris Raphael, then a 14 | postdoctoral fellow in the Department of Statistics at 15 | Stanford University who was working on Hidden Markov Models 16 | for restoring NMR Spectra. 17 | 18 | -------------------------------------------------------------------------------- /Papers/Correl/Noisegen.m: -------------------------------------------------------------------------------- 1 | function [x,y,zar] = Noisegen(f,rho,aa) 2 | 3 | sig = std(f); 4 | x = (rho/sig).*f; 5 | 6 | z = randn( size(f) ); 7 | 8 | %aa = [ 1 .8 .8]; 9 | zar = filter(1, aa, z); 10 | 11 | zar = zar/std(zar); 12 | 13 | y = x + zar; 14 | 15 | 16 | 17 | 18 | % 19 | % Part of Wavelab Version 850 20 | % Built Tue Jan 3 13:20:41 EST 2006 21 | % This is Copyrighted Material 22 | % For Copying permissions see COPYING.m 23 | % Comments? e-mail wavelab@stat.stanford.edu 24 | -------------------------------------------------------------------------------- /Papers/Correl/errtot.m: -------------------------------------------------------------------------------- 1 | function e = errtot(xhat,tru) 2 | % errtot.m 3 | % count errors that XHAT (thresholded at .5) makes in estimating TRU 4 | 5 | ss = size(tru); 6 | xhat = reshape(xhat, ss(1), ss(2)); 7 | e = sum( ( detect(xhat, .5) - tru ) .^ 2 ); 8 | 9 | 10 | 11 | 12 | 13 | % 14 | % Part of Wavelab Version 850 15 | % Built Tue Jan 3 13:20:41 EST 2006 16 | % This is Copyrighted Material 17 | % For Copying permissions see COPYING.m 18 | % Comments? e-mail wavelab@stat.stanford.edu 19 | -------------------------------------------------------------------------------- /Datasets/tweet.txt: -------------------------------------------------------------------------------- 1 | tweet.asc -- Digital signal of a bird singing 2 | 3 | Access 4 | Tweet = ReadSignal('Tweet'); 5 | 6 | Size 7 | 8,192 by 1 8 | 9 | Sampling Rate 10 | 22 kHz 11 | 12 | Source 13 | Doug Jones, University of Illinois 14 | digitized from D.J. Borror, Common Bird Songs (Cassette), 15 | Dover Publications, Inc., New York, 1984. 16 | 17 | Description 18 | In MATLAB, the command sound(Tweet,22000) will play 19 | this sound back at the right pitch. 20 | -------------------------------------------------------------------------------- /Pursuit/CPBPursuitTour.m: -------------------------------------------------------------------------------- 1 | % The basis pursuit algorithm in a cosine packet dictionnary is 2 | % not yet implemented in Wavelab. It is implemented in the LastWave 3 | % software, which is available on the Internet at 4 | % http://www.cmap.polytechnique.fr/users/www.bacry 5 | 6 | 7 | 8 | 9 | % 10 | % Part of Wavelab Version 850 11 | % Built Tue Jan 3 13:20:42 EST 2006 12 | % This is Copyrighted Material 13 | % For Copying permissions see COPYING.m 14 | % Comments? e-mail wavelab@stat.stanford.edu 15 | -------------------------------------------------------------------------------- /Pursuit/WPBPursuitTour.m: -------------------------------------------------------------------------------- 1 | % The basis pursuit algorithm in a wavelet packet dictionnary is 2 | % not yet implemented in Wavelab. It is implemented in the LastWave 3 | % software, which is available on the Internet at 4 | % http://www.cmap.polytechnique.fr/users/www.bacry 5 | 6 | 7 | 8 | 9 | % 10 | % Part of Wavelab Version 850 11 | % Built Tue Jan 3 13:20:43 EST 2006 12 | % This is Copyrighted Material 13 | % For Copying permissions see COPYING.m 14 | % Comments? e-mail wavelab@stat.stanford.edu 15 | -------------------------------------------------------------------------------- /Datasets/laser.txt: -------------------------------------------------------------------------------- 1 | laser.asc -- Signal from Time Series Competition 2 | 3 | Access 4 | Laser = ReadSignal('Laser'); 5 | 6 | Size 7 | 25,000 by 1 8 | 9 | Description 10 | This dataset was part of the time series competition 11 | conducted by the Santa Fe Institute. See the book 12 | "The Future of Time Series" by Andreas Weigend and 13 | Neal Gershenfeld for more information. 14 | 15 | Source 16 | Obtained by anonymous FTP from the Santa Fe Institute's 17 | FTP server. 18 | -------------------------------------------------------------------------------- /Papers/RiskAnalysis/reset_updates1.m: -------------------------------------------------------------------------------- 1 | global upd_never upd_ever Update 2 | 3 | set(upd_ever,'Value',1 - get(upd_never,'Value')); 4 | 5 | if get(upd_never,'Value') == 1, 6 | Update = 'Never'; 7 | else 8 | Update = 'ever'; 9 | end; 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | % 18 | % Part of Wavelab Version 850 19 | % Built Tue Jan 3 13:20:42 EST 2006 20 | % This is Copyrighted Material 21 | % For Copying permissions see COPYING.m 22 | % Comments? e-mail wavelab@stat.stanford.edu 23 | -------------------------------------------------------------------------------- /Books/WaveTour/WTCh06/wt06fig09.m: -------------------------------------------------------------------------------- 1 | fprintf('\n'); 2 | disp('Figure 6.9') 3 | disp('This edge detection figure can be reproduced') 4 | disp('with the LastWave software, which is available on the Internet at') 5 | disp('http://www.cmap.polytechnique.fr/users/www.bacry') 6 | 7 | 8 | 9 | 10 | 11 | % 12 | % Part of Wavelab Version 850 13 | % Built Tue Jan 3 13:20:39 EST 2006 14 | % This is Copyrighted Material 15 | % For Copying permissions see COPYING.m 16 | % Comments? e-mail wavelab@stat.stanford.edu 17 | -------------------------------------------------------------------------------- /Books/WaveTour/WTCh06/wt06fig10.m: -------------------------------------------------------------------------------- 1 | fprintf('\n'); 2 | disp('Figure 6.10') 3 | disp('This edge detection figure can be reproduced') 4 | disp('with the LastWave software, which is available on the Internet at') 5 | disp('http://www.cmap.polytechnique.fr/users/www.bacry') 6 | 7 | 8 | 9 | 10 | 11 | % 12 | % Part of Wavelab Version 850 13 | % Built Tue Jan 3 13:20:39 EST 2006 14 | % This is Copyrighted Material 15 | % For Copying permissions see COPYING.m 16 | % Comments? e-mail wavelab@stat.stanford.edu 17 | -------------------------------------------------------------------------------- /Invariant/MM2_DWT.m: -------------------------------------------------------------------------------- 1 | % The forward dyadic wavelet trasnsform with the Algorithme a 2 | % trous is not yet implemented in Wavelab. It is implemented in the 3 | % LastWave software, which is available on the Internet at 4 | % http://www.cmap.polytechnique.fr/users/www.bacry 5 | 6 | 7 | 8 | 9 | 10 | % 11 | % Part of Wavelab Version 850 12 | % Built Tue Jan 3 13:20:40 EST 2006 13 | % This is Copyrighted Material 14 | % For Copying permissions see COPYING.m 15 | % Comments? e-mail wavelab@stat.stanford.edu 16 | -------------------------------------------------------------------------------- /Papers/Correl/fbm.m: -------------------------------------------------------------------------------- 1 | %function x1 = fbm( alpha = 0.9, m = 4096) 2 | function x1 = fbm( alpha, m) 3 | x = randn(1,m); 4 | l = m/2 ; 5 | freq = [ 1 1:l (l-1):-1:1 ]; 6 | xft = fft(x); 7 | xft(1) = 0; 8 | x1ft = xft .* (freq .^ (- alpha/2 ) ); 9 | x1 = real( ifft(x1ft) ); 10 | 11 | 12 | 13 | 14 | 15 | % 16 | % Part of Wavelab Version 850 17 | % Built Tue Jan 3 13:20:41 EST 2006 18 | % This is Copyrighted Material 19 | % For Copying permissions see COPYING.m 20 | % Comments? e-mail wavelab@stat.stanford.edu 21 | -------------------------------------------------------------------------------- /Pursuit/GaborPursuitTour.m: -------------------------------------------------------------------------------- 1 | % The matching pursuit algorithm in a Gabor dictionary is not yet 2 | % implemented in Wavelab. It is implemented in the LastWave 3 | % software, which is available on the Internet at 4 | % http://www.cmap.polytechnique.fr/users/www.bacry 5 | 6 | 7 | 8 | 9 | 10 | 11 | % 12 | % Part of Wavelab Version 850 13 | % Built Tue Jan 3 13:20:43 EST 2006 14 | % This is Copyrighted Material 15 | % For Copying permissions see COPYING.m 16 | % Comments? e-mail wavelab@stat.stanford.edu 17 | -------------------------------------------------------------------------------- /Workouts/Toons/toon0544.m: -------------------------------------------------------------------------------- 1 | % toon0544 -- Data Compression of Ingrid Daubechies 2 | % 3 | % Reconstruct Daubechies from 5% of her coefficients. 4 | % 5 | icw_ingrid = IWT2_PO(cw_ingrid,3,qmf); 6 | AutoImage(icw_ingrid); 7 | title('95% Wavelet Co/Dec of Daubechies'); 8 | 9 | 10 | 11 | 12 | 13 | % 14 | % Part of Wavelab Version 850 15 | % Built Tue Jan 3 13:20:43 EST 2006 16 | % This is Copyrighted Material 17 | % For Copying permissions see COPYING.m 18 | % Comments? e-mail wavelab@stat.stanford.edu 19 | -------------------------------------------------------------------------------- /Books/WaveTour/WTCh06/wt06fig11.m: -------------------------------------------------------------------------------- 1 | fprintf('\n'); 2 | disp('Figure 6.11') 3 | disp('The reconstruction of images from multiscale edges can be performed') 4 | disp('with the LastWave software, which is available on the Internet at') 5 | disp('http://www.cmap.polytechnique.fr/users/www.bacry') 6 | 7 | 8 | 9 | 10 | % 11 | % Part of Wavelab Version 850 12 | % Built Tue Jan 3 13:20:39 EST 2006 13 | % This is Copyrighted Material 14 | % For Copying permissions see COPYING.m 15 | % Comments? e-mail wavelab@stat.stanford.edu 16 | -------------------------------------------------------------------------------- /Papers/ShortCourse/MedTriadUp.m: -------------------------------------------------------------------------------- 1 | function x = MedTriadUp(smooth,rough) 2 | % MedTriadUp -- Med Triad Up 3 | % Usage 4 | % MedTriadUp(smooth,rough) 5 | % 6 | 7 | n = length(rough); 8 | cx = reshape(rough,3,n/3); 9 | x = cx + [ smooth ; smooth; smooth ]; 10 | x = reshape(x,1,n); 11 | 12 | 13 | 14 | 15 | % 16 | % Part of Wavelab Version 850 17 | % Built Tue Jan 3 13:20:42 EST 2006 18 | % This is Copyrighted Material 19 | % For Copying permissions see COPYING.m 20 | % Comments? e-mail wavelab@stat.stanford.edu 21 | -------------------------------------------------------------------------------- /Papers/ShortCourse/triadlength.m: -------------------------------------------------------------------------------- 1 | function [n,J] = triadLength(x) 2 | % triadLength -- Return length of triad 3 | % Usage 4 | % [n,J] = triadLength(x) 5 | % 6 | n = length(x); 7 | m=1; J=0; while (m < n), m=3*m; J=J+1; end; 8 | if m ~= n, 9 | fprintf('Warning n ~= 3^J\n') 10 | end 11 | 12 | 13 | 14 | 15 | % 16 | % Part of Wavelab Version 850 17 | % Built Tue Jan 3 13:20:42 EST 2006 18 | % This is Copyrighted Material 19 | % For Copying permissions see COPYING.m 20 | % Comments? e-mail wavelab@stat.stanford.edu 21 | -------------------------------------------------------------------------------- /Papers/MinEntSeg/bloxplot.m: -------------------------------------------------------------------------------- 1 | function bloxplot(x,y,titlestr) 2 | % BloxPlot -- Make blox plot 3 | % Usage 4 | % bloxplot(x,y,titlestr) 5 | % 6 | n = length(x); 7 | xx = [ [0 x(1:(n-1))] ; x]; xx = xx(:); 8 | yy = [y ; y]; yy = yy(:); 9 | plot(xx,yy) 10 | title(titlestr); 11 | 12 | 13 | 14 | 15 | 16 | % 17 | % Part of Wavelab Version 850 18 | % Built Tue Jan 3 13:20:41 EST 2006 19 | % This is Copyrighted Material 20 | % For Copying permissions see COPYING.m 21 | % Comments? e-mail wavelab@stat.stanford.edu 22 | -------------------------------------------------------------------------------- /Browsers/One-D/def_nonlin.m: -------------------------------------------------------------------------------- 1 | function def_nonlin(m) 2 | % def_nonlin -- Called by WLBrowser 3 | % Usage 4 | % def_nonlin 5 | % 6 | do_global; global h_nonmenu 7 | 8 | for i=1:2 9 | set(h_nonmenu(i),'Checked','off'); 10 | end 11 | set(h_nonmenu(m),'Checked','on'); 12 | nonlin_type = m; 13 | 14 | 15 | 16 | 17 | % 18 | % Part of Wavelab Version 850 19 | % Built Tue Jan 3 13:20:39 EST 2006 20 | % This is Copyrighted Material 21 | % For Copying permissions see COPYING.m 22 | % Comments? e-mail wavelab@stat.stanford.edu 23 | -------------------------------------------------------------------------------- /Invariant/IMM2_DWT.m: -------------------------------------------------------------------------------- 1 | % The invese reconstruction of an image from the modulus maxima of 2 | % its dyadic wavelet transform is not yet implemented in Wavelab. 3 | % It is implemented in the LastWave software, which is available on 4 | % the Internet at http://www.cmap.polytechnique.fr/users/www.bacry. 5 | 6 | 7 | 8 | 9 | 10 | % 11 | % Part of Wavelab Version 850 12 | % Built Tue Jan 3 13:20:40 EST 2006 13 | % This is Copyrighted Material 14 | % For Copying permissions see COPYING.m 15 | % Comments? e-mail wavelab@stat.stanford.edu 16 | -------------------------------------------------------------------------------- /Books/WaveTour/WTCh10/wt10fig06.m: -------------------------------------------------------------------------------- 1 | disp('Figure 10.6') 2 | disp('This noise removal figure with edge thresholding can be reproduced') 3 | disp('with the Wave2 software, which is available on the Internet at') 4 | disp('http://www.cmap.polytechnique.fr/users/www.mallat and') 5 | disp('http://cs.nyu.edu/cs/faculty/mallat.') 6 | 7 | 8 | 9 | % 10 | % Part of Wavelab Version 850 11 | % Built Tue Jan 3 13:20:39 EST 2006 12 | % This is Copyrighted Material 13 | % For Copying permissions see COPYING.m 14 | % Comments? e-mail wavelab@stat.stanford.edu 15 | -------------------------------------------------------------------------------- /Workouts/Toons/toon0511.m: -------------------------------------------------------------------------------- 1 | % toon0511 -- Lincoln Refinement Scheme 2 | % 3 | % Show a 32x32 image of Abraham Lincoln. 4 | % 5 | HonestAbe = ReadImage('Lincoln'); 6 | CrudeAbe = HCoarsen2d(HonestAbe,1); 7 | % 8 | image(CrudeAbe); 9 | axis('image') 10 | colormap(gray(32)); 11 | title('32 * 32 Image'); 12 | 13 | 14 | 15 | 16 | % 17 | % Part of Wavelab Version 850 18 | % Built Tue Jan 3 13:20:43 EST 2006 19 | % This is Copyrighted Material 20 | % For Copying permissions see COPYING.m 21 | % Comments? e-mail wavelab@stat.stanford.edu 22 | -------------------------------------------------------------------------------- /Browsers/One-D/def_shrinker.m: -------------------------------------------------------------------------------- 1 | function def_shrinker(m) 2 | % def_shrinker -- Called by WLBrowser 3 | % Usage 4 | % def_shrinker(m) 5 | % 6 | global shrinkage_type h_thrmenu 7 | for i=1:5 8 | set(h_thrmenu(i),'Checked','off'); 9 | end 10 | set(h_thrmenu(m),'Checked','on'); 11 | 12 | shrinker_type = m; 13 | 14 | 15 | 16 | 17 | % 18 | % Part of Wavelab Version 850 19 | % Built Tue Jan 3 13:20:39 EST 2006 20 | % This is Copyrighted Material 21 | % For Copying permissions see COPYING.m 22 | % Comments? e-mail wavelab@stat.stanford.edu 23 | -------------------------------------------------------------------------------- /Papers/ShortCourse/IWT_SegAI.m: -------------------------------------------------------------------------------- 1 | function beta = IWT_SegAI(w,L,D,F,EF,t) 2 | % IWT_SegAI -- Inverse Segmented Transform 3 | % Usage 4 | % beta = IWT_SegAI(w,L,D,F,EF,t) 5 | % 6 | 7 | [n,J] = dyadlength(w); 8 | beta = w(1:(2^L)); 9 | for j=L:(J-1) , 10 | beta = SAIDyadDown(beta,w(dyad(j)),D,F,EF,t,j); 11 | end 12 | 13 | 14 | 15 | 16 | % 17 | % Part of Wavelab Version 850 18 | % Built Tue Jan 3 13:20:42 EST 2006 19 | % This is Copyrighted Material 20 | % For Copying permissions see COPYING.m 21 | % Comments? e-mail wavelab@stat.stanford.edu 22 | -------------------------------------------------------------------------------- /Workouts/Toons/PlotOrderedCoef.m: -------------------------------------------------------------------------------- 1 | function PlotOrderedCoef(wc) 2 | % PlotOrderCoef -- Plot Ordered Coefficients 3 | % Usage 4 | % PlotOrderedCoef(wc) 5 | % Inputs 6 | % wc wavelet coeffs 7 | % 8 | 9 | [n,J] = dyadlength(wc); 10 | ordcoef = reverse(sort(abs(wc))); 11 | % 12 | semilogy(1:n,ordcoef) 13 | 14 | 15 | 16 | 17 | % 18 | % Part of Wavelab Version 850 19 | % Built Tue Jan 3 13:20:43 EST 2006 20 | % This is Copyrighted Material 21 | % For Copying permissions see COPYING.m 22 | % Comments? e-mail wavelab@stat.stanford.edu 23 | -------------------------------------------------------------------------------- /Books/WaveTour/WTCh06/CalcFtheo.m: -------------------------------------------------------------------------------- 1 | function ftheo = CalcFtheo(alpha,p1,p2); 2 | 3 | x = (log(p2)-log(p1))./(log(p2) + alpha .* log(3)); 4 | ftheo = ((x-1).*log(x-1) - x .* log(x)) ./(x .* log(1/3)); 5 | 6 | % Written by Maureen Clerc and Jerome Kalifa, 1997 7 | % clerc@cmapx.polytechnique.fr, kalifa@cmapx.polytechnique.fr 8 | 9 | 10 | 11 | 12 | % 13 | % Part of Wavelab Version 850 14 | % Built Tue Jan 3 13:20:39 EST 2006 15 | % This is Copyrighted Material 16 | % For Copying permissions see COPYING.m 17 | % Comments? e-mail wavelab@stat.stanford.edu 18 | -------------------------------------------------------------------------------- /Median/HigherDegree/PlotPoly.m: -------------------------------------------------------------------------------- 1 | function PlotPoly(P, range, color) 2 | 3 | if nargin == 2, color = 'b'; end 4 | a = range(1); 5 | b = range(2); 6 | 7 | x = a:0.01:b; 8 | 9 | L = length(P); 10 | y = zeros(size(x)); 11 | for i=((1:L)-1), 12 | y = y + P(i+1) * x.^(L-i-1); 13 | end 14 | 15 | plot(x, y, color) 16 | 17 | 18 | 19 | 20 | % 21 | % Part of Wavelab Version 850 22 | % Built Tue Jan 3 13:20:40 EST 2006 23 | % This is Copyrighted Material 24 | % For Copying permissions see COPYING.m 25 | % Comments? e-mail wavelab@stat.stanford.edu 26 | -------------------------------------------------------------------------------- /Workouts/Toons/KeepBiggest.m: -------------------------------------------------------------------------------- 1 | function sparse = KeepBiggest(dense,N) 2 | % KeepBiggest -- Kill (set to zero) all but N biggest elements 3 | % Usage 4 | % sparse = KeepBiggest(dense,N) 5 | % 6 | ordered = reverse(sort(abs(dense(:)))); 7 | threshold = ordered(N); 8 | sparse = dense .* (abs(dense) >= threshold); 9 | 10 | 11 | 12 | 13 | % 14 | % Part of Wavelab Version 850 15 | % Built Tue Jan 3 13:20:43 EST 2006 16 | % This is Copyrighted Material 17 | % For Copying permissions see COPYING.m 18 | % Comments? e-mail wavelab@stat.stanford.edu 19 | -------------------------------------------------------------------------------- /Workouts/Toons/toon0841.m: -------------------------------------------------------------------------------- 1 | % toon0841 -- Illustrate CP Methodology on SlowChirp 2 | % 3 | n = 1024; 4 | t = (0:(n-1))./n; 5 | D = 6; 6 | % 7 | xi = pi/5 .* t; 8 | SlowChirp = cos(xi .* (1:n)); 9 | % 10 | CPTour('P',SlowChirp,D,'SlowChirp'); 11 | subplot(2,2,3); 12 | axis([0 500 -10 10]); 13 | drawnow 14 | 15 | 16 | 17 | 18 | % 19 | % Part of Wavelab Version 850 20 | % Built Tue Jan 3 13:20:43 EST 2006 21 | % This is Copyrighted Material 22 | % For Copying permissions see COPYING.m 23 | % Comments? e-mail wavelab@stat.stanford.edu 24 | -------------------------------------------------------------------------------- /Utilities/ShapeAsRow.m: -------------------------------------------------------------------------------- 1 | function row = ShapeAsRow(sig) 2 | % ShapeAsRow -- Make signal a row vector 3 | % Usage 4 | % row = ShapeAsRow(sig) 5 | % Inputs 6 | % sig a row or column vector 7 | % Outputs 8 | % row a row vector 9 | % 10 | % See Also 11 | % ShapeLike 12 | % 13 | row = sig(:)'; 14 | 15 | 16 | 17 | 18 | 19 | % 20 | % Part of Wavelab Version 850 21 | % Built Tue Jan 3 13:20:43 EST 2006 22 | % This is Copyrighted Material 23 | % For Copying permissions see COPYING.m 24 | % Comments? e-mail wavelab@stat.stanford.edu 25 | -------------------------------------------------------------------------------- /DeNoising/cyclespin2.m: -------------------------------------------------------------------------------- 1 | function s = cyclespin2(x,i,j) 2 | 3 | [l1,l2] = size(x); 4 | z = x((l1+1-i):l1,:); 5 | z(i+1:l1,:) = x(1:(l1-i),:); 6 | s = z(:,(l2+1-j):l2); 7 | s(:,j+1:l2) = z(:,1:(l2-j)); 8 | 9 | % Written by Maureen Clerc and Jerome Kalifa, 1997 10 | % clerc@cmapx.polytechnique.fr, kalifa@cmapx.polytechnique.fr 11 | 12 | 13 | 14 | 15 | 16 | % 17 | % Part of Wavelab Version 850 18 | % Built Tue Jan 3 13:20:39 EST 2006 19 | % This is Copyrighted Material 20 | % For Copying permissions see COPYING.m 21 | % Comments? e-mail wavelab@stat.stanford.edu 22 | -------------------------------------------------------------------------------- /Papers/Ideal/idealwts.m: -------------------------------------------------------------------------------- 1 | function wt = idealwts(x,sa) 2 | % IdealWts -- Ideal weights for Diagonal Linear Estimates 3 | % Usage: 4 | % wt = idealwts(x,sa) 5 | % Inputs: 6 | % x True Object 7 | % sa Noise Std. Dev. 8 | % Outputs: 9 | % wt x.^2 ./(x.^2 + sa.^2) 10 | wt = (x.^2)./(x.^2 + sa.^2); 11 | 12 | 13 | 14 | 15 | 16 | % 17 | % Part of Wavelab Version 850 18 | % Built Tue Jan 3 13:20:41 EST 2006 19 | % This is Copyrighted Material 20 | % For Copying permissions see COPYING.m 21 | % Comments? e-mail wavelab@stat.stanford.edu 22 | -------------------------------------------------------------------------------- /Papers/RiskAnalysis/clear_updates.m: -------------------------------------------------------------------------------- 1 | global allfig fig1 fig2 fig3 fig4 upd_never upd_ever 2 | global fig_list fig_update 3 | set(fig1,'value',0); 4 | set(fig2,'value',0); 5 | set(fig3,'value',0); 6 | set(fig4,'value',0); 7 | set(allfig,'value',0); 8 | set(upd_never,'value',0); 9 | set(upd_ever,'value',0); 10 | fig_list = [0 0 0 0]; 11 | 12 | 13 | 14 | 15 | % 16 | % Part of Wavelab Version 850 17 | % Built Tue Jan 3 13:20:42 EST 2006 18 | % This is Copyrighted Material 19 | % For Copying permissions see COPYING.m 20 | % Comments? e-mail wavelab@stat.stanford.edu 21 | -------------------------------------------------------------------------------- /Papers/ShortCourse/MedTriadDown.m: -------------------------------------------------------------------------------- 1 | function [smooth,rough] = MedTriadDown(x) 2 | % MedTriadDown -- Med Triad Down 3 | % Usage 4 | % [smooth,rough] = MedTriadDown(x) 5 | % 6 | 7 | n = length(x); 8 | cx = reshape(x,3,n/3); 9 | smooth = median(cx); 10 | rough = cx - [ smooth ; smooth; smooth ]; 11 | rough = reshape(rough,1,n); 12 | 13 | 14 | 15 | 16 | % 17 | % Part of Wavelab Version 850 18 | % Built Tue Jan 3 13:20:42 EST 2006 19 | % This is Copyrighted Material 20 | % For Copying permissions see COPYING.m 21 | % Comments? e-mail wavelab@stat.stanford.edu 22 | -------------------------------------------------------------------------------- /Utilities/pic256.m: -------------------------------------------------------------------------------- 1 | function PIC256(x,header); 2 | 3 | % PIC256 PIC256(x,header) shows image 'x' of 256 graylevels. 4 | % 'header' is an optional title. 5 | 6 | 7 | figure 8 | image(x+1) 9 | colormap(gray(256)) 10 | axis('square') 11 | axis('off') 12 | 13 | if nargin == 2 14 | title(header) 15 | end 16 | 17 | 18 | 19 | 20 | 21 | % 22 | % Part of Wavelab Version 850 23 | % Built Tue Jan 3 13:20:43 EST 2006 24 | % This is Copyrighted Material 25 | % For Copying permissions see COPYING.m 26 | % Comments? e-mail wavelab@stat.stanford.edu 27 | -------------------------------------------------------------------------------- /Papers/Adapt/JamesStein.m: -------------------------------------------------------------------------------- 1 | function xhat = JamesStein(y) % JamesStein -- James-Stein Shrinker % Usage: % xhat = JamesStein(y) % Inputs: % y Noisy Data, Standard Deviation of Noise = 1. % Outputs: % xhat James-Stein Estimate of x % Notes: % dimension(x) > 2 is required. % ss = sum(y.^2); n = length(y); shrnk = max((ss - (n-2))/ss,0); xhat = shrnk .* y; 2 | 3 | % 4 | % Part of Wavelab Version 850 5 | % Built Tue Jan 3 13:20:41 EST 2006 6 | % This is Copyrighted Material 7 | % For Copying permissions see COPYING.m 8 | % Comments? e-mail wavelab@stat.stanford.edu 9 | -------------------------------------------------------------------------------- /Workouts/Toons/toon0542.m: -------------------------------------------------------------------------------- 1 | % toon0542 -- Data Compression of Ingrid Daubechies 2 | % 3 | % Take Ingrid into the Wavelet Domain. 4 | % 5 | qmf = MakeONFilter('Coiflet',2); 6 | wingrid = FWT2_PO(ingrid,3,qmf); 7 | % 8 | zmat = abs(wingrid); 9 | AutoImage(zmat); 10 | title('Wavelet Transform of Ingrid Daubechies'); 11 | 12 | 13 | 14 | 15 | 16 | 17 | % 18 | % Part of Wavelab Version 850 19 | % Built Tue Jan 3 13:20:43 EST 2006 20 | % This is Copyrighted Material 21 | % For Copying permissions see COPYING.m 22 | % Comments? e-mail wavelab@stat.stanford.edu 23 | -------------------------------------------------------------------------------- /Books/WaveTour/WTCh10/wt10fig14.m: -------------------------------------------------------------------------------- 1 | fprintf('\n'); 2 | disp('Figure 10.14') 3 | disp('The matching pursuit algorithm in a Gabor dictionary is not yet') 4 | disp('implemented in Wavelab. This figure can be reproduced with the') 5 | disp('LastWave software, which is available on the Internet at') 6 | disp('http://www.cmap.polytechnique.fr/users/www.bacry') 7 | 8 | 9 | 10 | % 11 | % Part of Wavelab Version 850 12 | % Built Tue Jan 3 13:20:39 EST 2006 13 | % This is Copyrighted Material 14 | % For Copying permissions see COPYING.m 15 | % Comments? e-mail wavelab@stat.stanford.edu 16 | -------------------------------------------------------------------------------- /Papers/ShortCourse/HCoarsen.m: -------------------------------------------------------------------------------- 1 | function c = HCoarsen(r,L) 2 | % HCoarsen -- Coarsen object 3 | % Usage 4 | % c = HCoarsen(r,L) 5 | % 6 | 7 | n = length(r); 8 | b = r; 9 | ni = n; 10 | for h=1:L, 11 | ni = ni/2; 12 | b(1:ni) = (b(1:2:(2*ni-1)) + b(2:2:(2*ni)))/2; 13 | end 14 | c = zeros(1,ni); 15 | c = b(1:ni); 16 | 17 | 18 | 19 | 20 | 21 | % 22 | % Part of Wavelab Version 850 23 | % Built Tue Jan 3 13:20:42 EST 2006 24 | % This is Copyrighted Material 25 | % For Copying permissions see COPYING.m 26 | % Comments? e-mail wavelab@stat.stanford.edu 27 | -------------------------------------------------------------------------------- /Books/WaveTour/WTCh09/wt09fig10.m: -------------------------------------------------------------------------------- 1 | fprintf('\n'); 2 | disp('Figure 9.10') 3 | disp('The matching pursuit algorithm in a Gabor dictionary is not yet') 4 | disp('implemented in Wavelab. This figure can be reproduced with the') 5 | disp('LastWave software, which is available on the Internet at') 6 | disp('http://www.cmap.polytechnique.fr/users/www.bacry') 7 | 8 | 9 | 10 | 11 | % 12 | % Part of Wavelab Version 850 13 | % Built Tue Jan 3 13:20:39 EST 2006 14 | % This is Copyrighted Material 15 | % For Copying permissions see COPYING.m 16 | % Comments? e-mail wavelab@stat.stanford.edu 17 | -------------------------------------------------------------------------------- /Books/WaveTour/WTCh10/wt10fig13.m: -------------------------------------------------------------------------------- 1 | fprintf('\n'); 2 | disp('Figure 10.13') 3 | disp('The matching pursuit algorithm in a Gabor dictionary is not yet') 4 | disp('implemented in Wavelab. This figure can be reproduced with the') 5 | disp('LastWave software, which is available on the Internet at') 6 | disp('http://www.cmap.polytechnique.fr/users/www.bacry') 7 | 8 | 9 | 10 | 11 | % 12 | % Part of Wavelab Version 850 13 | % Built Tue Jan 3 13:20:39 EST 2006 14 | % This is Copyrighted Material 15 | % For Copying permissions see COPYING.m 16 | % Comments? e-mail wavelab@stat.stanford.edu 17 | -------------------------------------------------------------------------------- /Papers/ShortCourse/FHT_Med.m: -------------------------------------------------------------------------------- 1 | function wc = FHT_Med(x) 2 | % FHT_Med -- Forward Med Transform 3 | % Usage 4 | % wc = FHT_Med(x) 5 | % 6 | 7 | [n,J] = triadlength(x); 8 | wc = zeros(1,2*n); 9 | smooth = x; 10 | for j=J:-1:1, 11 | [smooth,rough] = MedTriadDown(smooth); 12 | wc(triad(j)) = rough; 13 | end 14 | wc(1) = smooth(1); 15 | 16 | 17 | 18 | 19 | % 20 | % Part of Wavelab Version 850 21 | % Built Tue Jan 3 13:20:42 EST 2006 22 | % This is Copyrighted Material 23 | % For Copying permissions see COPYING.m 24 | % Comments? e-mail wavelab@stat.stanford.edu 25 | -------------------------------------------------------------------------------- /Workouts/Toons/toon0522.m: -------------------------------------------------------------------------------- 1 | % toon0522 -- Progressive Transmission 2 | % 3 | % Take the Brain into the Wavelet Domain. 4 | % 5 | global wbrain 6 | % 09/29/99 MRD 7 | qmf = MakeONFilter('Coiflet',2); 8 | wbrain = FWT2_PO(brain,3,qmf); 9 | % 10 | zmat = abs(wbrain); 11 | AutoImage(zmat); 12 | title('Wavelet Transform of MRI Brain Scan'); 13 | 14 | 15 | 16 | 17 | % 18 | % Part of Wavelab Version 850 19 | % Built Tue Jan 3 13:20:43 EST 2006 20 | % This is Copyrighted Material 21 | % For Copying permissions see COPYING.m 22 | % Comments? e-mail wavelab@stat.stanford.edu 23 | -------------------------------------------------------------------------------- /Datasets/caruso.txt: -------------------------------------------------------------------------------- 1 | caruso.asc -- Digital signal of Caruso singing 2 | 3 | Access 4 | Enrico = ReadSignal('Caruso'); 5 | 6 | Size 7 | 50,000 by 1 8 | 9 | Sampling Rate 10 | 8192 Hz 11 | 12 | Description 13 | In MATLAB, the command sound(Enrico,8192) will play this sound 14 | back at the right pitch. 15 | 16 | Source 17 | Obtained by anonymous FTP from the xwplw package 18 | developed by R.R. Coifman and Fazal Majid at Yale University. 19 | You can get this X-windows adapted waveform analysis 20 | package by anonymous FTP to math.yale.edu. 21 | -------------------------------------------------------------------------------- /Median/HigherDegree/localmaxima.m: -------------------------------------------------------------------------------- 1 | function ro = localmaxima(P,interval) 2 | % Find all the real roots of poly. P within the real interval [a,b] 3 | 4 | a = interval(1); b= interval(2); 5 | EPS = 10^(-10); 6 | ro = roots(P); 7 | realpos = find(abs(imag(ro)) < EPS); 8 | ro = real(ro(realpos)); 9 | pos = find(ro>a & ro t 10 | % r(i) = x(n+i-t) else 11 | % 12 | 13 | n = length(x); 14 | y = [ x( (n-t+1) :n ) x( 1: (n-t) )]; 15 | 16 | 17 | 18 | 19 | % 20 | % Part of Wavelab Version 850 21 | % Built Tue Jan 3 13:20:43 EST 2006 22 | % This is Copyrighted Material 23 | % For Copying permissions see COPYING.m 24 | % Comments? e-mail wavelab@stat.stanford.edu 25 | -------------------------------------------------------------------------------- /Datasets/lincoln.txt: -------------------------------------------------------------------------------- 1 | lincoln.raw -- Gray-scale image of Honest Abe 2 | 3 | Access 4 | Abe = ReadImage('Lincoln'); 5 | 6 | Size 7 | 64 by 64 8 | 9 | Gray Levels 10 | 32 11 | 12 | Description 13 | Made famous in a psycho-optical experiment by Harmon 14 | and Julesz, who showed that the blocky structure of 15 | a 16-by-16 version of this image makes it hard to tell 16 | who the subject is. 17 | 18 | Source 19 | Typed in by hand from tables in the book 20 | "Digital Image Processing" by Rafael C. Gonzalez 21 | and Richard E. Woods, published by Addison Wesley. 22 | -------------------------------------------------------------------------------- /Median/HigherDegree/realpolyroots.m: -------------------------------------------------------------------------------- 1 | function ro = realpolyroots(P,interval) 2 | % Find all the real roots of poly. P within the real interval [a,b] 3 | 4 | a = interval(1); b= interval(2); 5 | EPS = 10^(-10); 6 | ro = roots(P); 7 | realpos = find(abs(imag(ro)) < EPS); 8 | ro = real(ro(realpos)); 9 | pos = find(ro>a & ro n) .* (ind - n); 11 | % 12 | indnew = (ind <= n) .* ind + (ind > n) .* (ind - n); 13 | 14 | 15 | 16 | 17 | % 18 | % Part of Wavelab Version 850 19 | % Built Tue Jan 3 13:20:41 EST 2006 20 | % This is Copyrighted Material 21 | % For Copying permissions see COPYING.m 22 | % Comments? e-mail wavelab@stat.stanford.edu 23 | -------------------------------------------------------------------------------- /Browsers/One-D/def_siglen.m: -------------------------------------------------------------------------------- 1 | function def_siglen(m) 2 | % def_siglen -- Called by WLBrowser 3 | % Usage 4 | % def_siglen(m) 5 | % 6 | do_global; global h_sigmenu nsig 7 | % 8 | nm = 256; 9 | for i=1:5, 10 | nm = 2*nm; 11 | if m==nm, 12 | set(h_sigmenu(i),'Checked','on'); 13 | else 14 | set(h_sigmenu(i),'Checked','off'); 15 | end 16 | end 17 | % 18 | nsig = m; 19 | 20 | 21 | 22 | 23 | % 24 | % Part of Wavelab Version 850 25 | % Built Tue Jan 3 13:20:39 EST 2006 26 | % This is Copyrighted Material 27 | % For Copying permissions see COPYING.m 28 | % Comments? e-mail wavelab@stat.stanford.edu 29 | -------------------------------------------------------------------------------- /Orthogonal/reverse.m: -------------------------------------------------------------------------------- 1 | function r = reverse(x) 2 | % reverse -- Reverse order of elements in 1-d signal 3 | % Usage 4 | % r = reverse(x) 5 | % Inputs 6 | % x 1-d signal 7 | % Outputs 8 | % r 1-d time-reversed signal 9 | % 10 | % See Also 11 | % flipud, fliplr 12 | % 13 | r = x(length(x):-1:1); 14 | 15 | % 16 | % Copyright (c) 1993. David L. Donoho 17 | % 18 | 19 | 20 | 21 | 22 | % 23 | % Part of Wavelab Version 850 24 | % Built Tue Jan 3 13:20:40 EST 2006 25 | % This is Copyrighted Material 26 | % For Copying permissions see COPYING.m 27 | % Comments? e-mail wavelab@stat.stanford.edu 28 | -------------------------------------------------------------------------------- /Orthogonal/rshift.m: -------------------------------------------------------------------------------- 1 | function y = rshift(x) 2 | % rshift -- Circular right shift of 1-d signal 3 | % Usage 4 | % r = rshift(x) 5 | % Inputs 6 | % x 1-d signal 7 | % Outputs 8 | % r 1-d signal 9 | % r(i) = x(i-1) except r(1) = x(n) 10 | % 11 | 12 | n = length(x); 13 | y = [ x(n) x( 1: (n-1) )]; 14 | 15 | % 16 | % Copyright (c) 1993. Iain M. Johnstone 17 | % 18 | 19 | 20 | 21 | 22 | % 23 | % Part of Wavelab Version 850 24 | % Built Tue Jan 3 13:20:40 EST 2006 25 | % This is Copyrighted Material 26 | % For Copying permissions see COPYING.m 27 | % Comments? e-mail wavelab@stat.stanford.edu 28 | -------------------------------------------------------------------------------- /Papers/Asymp/reverse.m: -------------------------------------------------------------------------------- 1 | function r = reverse(x) 2 | % reverse -- Reverse order of elements in 1-d signal 3 | % Usage 4 | % r = reverse(x) 5 | % Inputs 6 | % x 1-d signal 7 | % Outputs 8 | % r 1-d time-reversed signal 9 | % 10 | % See Also 11 | % flipud, fliplr 12 | % 13 | r = x(length(x):-1:1); 14 | 15 | % 16 | % Copyright (c) 1993. David L. Donoho 17 | % 18 | 19 | 20 | 21 | 22 | % 23 | % Part of Wavelab Version 850 24 | % Built Tue Jan 3 13:20:41 EST 2006 25 | % This is Copyrighted Material 26 | % For Copying permissions see COPYING.m 27 | % Comments? e-mail wavelab@stat.stanford.edu 28 | -------------------------------------------------------------------------------- /Papers/RiskAnalysis/NewZoom.m: -------------------------------------------------------------------------------- 1 | function NewZoom 2 | % NewZoom -- Called by WLBrowser 3 | % Usage 4 | % NewZoom 5 | % 6 | global PlotFig signal_name 7 | tmp = get(PlotFig,'UserData'); 8 | s = length(tmp); 9 | u = tmp(4:s); 10 | [x,y] = ginput(2); 11 | r = floor(x(1)):ceil(x(2)); 12 | figure 13 | plot(r, u(r)); 14 | grid 15 | title(['Zoom in on : ' signal_name]); 16 | 17 | 18 | 19 | 20 | 21 | 22 | % 23 | % Part of Wavelab Version 850 24 | % Built Tue Jan 3 13:20:42 EST 2006 25 | % This is Copyrighted Material 26 | % For Copying permissions see COPYING.m 27 | % Comments? e-mail wavelab@stat.stanford.edu 28 | -------------------------------------------------------------------------------- /Workouts/Toons/toon0548.m: -------------------------------------------------------------------------------- 1 | % toon0548 -- Data Compression of Ingrid Daubechies 2 | % 3 | % A side-by-side comparison of the 95% wavelet 4 | % and Fourier compressions. 5 | % 6 | subplot(121); 7 | GrayImage(icw_ingrid,256); 8 | title('(a) 95% Wavelet Compression of Ingrid'); 9 | % 10 | subplot(122) 11 | GrayImage(icf_ingrid,256); 12 | title('(b) 95% Fourier Compression of Ingrid'); 13 | 14 | 15 | 16 | 17 | % 18 | % Part of Wavelab Version 850 19 | % Built Tue Jan 3 13:20:43 EST 2006 20 | % This is Copyrighted Material 21 | % For Copying permissions see COPYING.m 22 | % Comments? e-mail wavelab@stat.stanford.edu 23 | -------------------------------------------------------------------------------- /Books/WaveTour/Contents.m: -------------------------------------------------------------------------------- 1 | % WaveTour - Figures of the book "A Wavelet Tour of Signal Processing" 2 | % 3 | % A Wavelet Tour of Signal Processing 4 | % Stephane Mallat 5 | % ISBN: 0-12-466605-1 6 | % Academic Press, 1998 7 | % 8 | % This book explains the applications of wavelets to signal processing. 9 | % A preview of the book can be found in: 10 | % 11 | % http://www.cmap.polytechnique.fr/users/www.mallat 12 | % and 13 | % http://cs.nyu.edu/cs/faculty/mallat 14 | % 15 | % The subdirectories WTCh... contain files that reproduce the figures in 16 | % each chapter, as explained in the Appendix B of the book. 17 | % 18 | -------------------------------------------------------------------------------- /Datasets/barton.txt: -------------------------------------------------------------------------------- 1 | barton.raw -- Gray-scale reproduction of Barton painting 2 | 3 | Access 4 | barton = ReadImage('Barton'); 5 | 6 | Size 7 | 512 by 512 8 | 9 | Gray Levels 10 | 256 11 | 12 | Source 13 | Supplied by Jan-Olov Stromberg, who used it as the example dataset 14 | in his article "Image Compression using Franklin Wavelets." In that 15 | article he uses orthogonal wavelets defined by recursive filtering 16 | to compress this image by factors of 50 to 1. 17 | 18 | Jan-Olov Stromberg is the original inventor of smooth orthonormal 19 | Wavelet bases; see his article in the Zygmund Festschrift 20 | -------------------------------------------------------------------------------- /DeNoising/HardThresh.m: -------------------------------------------------------------------------------- 1 | function x = HardThresh(y,t) 2 | % HardThresh -- Apply Hard Threshold 3 | % Usage 4 | % x = HardThresh(y,t) 5 | % Inputs 6 | % y Noisy Data 7 | % t Threshold 8 | % Outputs 9 | % x y 1_{|y|>t} 10 | % 11 | x = y .* (abs(y) > t); 12 | 13 | % 14 | % Copyright (c) 1993-5. Jonathan Buckheit, David Donoho and Iain Johnstone 15 | % 16 | 17 | 18 | 19 | 20 | 21 | % 22 | % Part of Wavelab Version 850 23 | % Built Tue Jan 3 13:20:39 EST 2006 24 | % This is Copyrighted Material 25 | % For Copying permissions see COPYING.m 26 | % Comments? e-mail wavelab@stat.stanford.edu 27 | -------------------------------------------------------------------------------- /Papers/Tour/fasthist.m: -------------------------------------------------------------------------------- 1 | function [bloc,count] = fasthist(w,M) 2 | % FastHist -- fast histogram tool 3 | q = (max(w) - min(w))/ M ; 4 | lo = min(w); 5 | x = sort( [ (0:(M-1)) floor( (w -lo) / q )] ); 6 | x(length(x)) = M-1; 7 | y = diff([(-1) x]) > .01 ; 8 | n = 1:length(x); 9 | cum = [n( y) (length(x)+1)]; 10 | count = (diff(cum)-1); 11 | count = count(1:M); 12 | bloc = lo + (0:(M-1)).*q; 13 | 14 | 15 | 16 | 17 | % 18 | % Part of Wavelab Version 850 19 | % Built Tue Jan 3 13:20:42 EST 2006 20 | % This is Copyrighted Material 21 | % For Copying permissions see COPYING.m 22 | % Comments? e-mail wavelab@stat.stanford.edu 23 | -------------------------------------------------------------------------------- /Packets/Two-D/qnode.m: -------------------------------------------------------------------------------- 1 | function ix = qnode(d,bx,by) 2 | % qnode -- Quad tree indexing 3 | % Usage 4 | % ix = qnode(d,bx,by) 5 | % Inputs 6 | % d depth in splitting 7 | % bx,by box coordinates at that depth 8 | % Outputs 9 | % ix index of that node in tree 10 | % 11 | % Description 12 | % ix = 4^(d) + by + bx*2^(d) 13 | % 14 | ix = 4^(d) + by + bx*2^(d); 15 | 16 | 17 | 18 | 19 | 20 | % 21 | % Part of Wavelab Version 850 22 | % Built Tue Jan 3 13:20:41 EST 2006 23 | % This is Copyrighted Material 24 | % For Copying permissions see COPYING.m 25 | % Comments? e-mail wavelab@stat.stanford.edu 26 | -------------------------------------------------------------------------------- /Datasets/fingerprint.txt: -------------------------------------------------------------------------------- 1 | fingerprint.raw -- Gray-scale fingerprint image 2 | 3 | Access 4 | Smudge = ReadImage('Fingerprint'); 5 | 6 | Size 7 | 512 by 512 8 | 9 | Gray Levels 10 | 256 11 | 12 | Source 13 | This is a cropped version of a fingerprint which was 14 | obtained by anonymous FTP from Los Alamos National Labs. 15 | The fingerprint was made available by Christopher Brislawn, 16 | and is aparently referenced in the article ``The FBI 17 | wavelet/scalar qunatization standard for gray-scale 18 | fingerprint image compression'' by J. Bradley, C. Brislawn, 19 | and T. Hopper. Proc SPIE Vol. 1961, 1993. 20 | -------------------------------------------------------------------------------- /Browsers/One-D/def_nlevel.m: -------------------------------------------------------------------------------- 1 | function def_nlevel(m) 2 | % def_nlevel -- Called by WLBrowser 3 | % Usage 4 | % def_nlevel(m) 5 | % 6 | do_global; global h_nlvmenu 7 | 8 | for i=1:3, 9 | set(h_nlvmenu(i),'Checked','off'); 10 | end 11 | set(h_nlvmenu(m),'Checked','on'); 12 | 13 | if m==0, 14 | namp = 0. 15 | elseif m==1, 16 | namp =1; 17 | else 18 | namp = input('New Noise Level?'); 19 | end 20 | 21 | 22 | 23 | 24 | % 25 | % Part of Wavelab Version 850 26 | % Built Tue Jan 3 13:20:39 EST 2006 27 | % This is Copyrighted Material 28 | % For Copying permissions see COPYING.m 29 | % Comments? e-mail wavelab@stat.stanford.edu 30 | -------------------------------------------------------------------------------- /Papers/MIPT/mitable51.m: -------------------------------------------------------------------------------- 1 | % mitable51 -- Theoretically Derived MIPT Thresholds 2 | % 3 | 4 | scriptname = 'mitable51'; 5 | L = 2; 6 | type = 'theoretical'; 7 | for J = 10:13, 8 | J, 9 | thrg = MIPTThreshold('Gaussian', J, L, type) 10 | thrc = MIPTThreshold('Cauchy', J, L, type) 11 | end 12 | 13 | RegisterPlot(scriptname, '{R}') 14 | 15 | % 16 | % Copyright (c) 1996. David Donoho and Thomas P.Y. Yu 17 | % 18 | 19 | 20 | 21 | % 22 | % Part of Wavelab Version 850 23 | % Built Tue Jan 3 13:20:42 EST 2006 24 | % This is Copyrighted Material 25 | % For Copying permissions see COPYING.m 26 | % Comments? e-mail wavelab@stat.stanford.edu 27 | -------------------------------------------------------------------------------- /Papers/ShortCourse/SAIDyadUp.m: -------------------------------------------------------------------------------- 1 | function [beta,alfa] = SAIDyadUp(afine,D,F,EF,t,j) 2 | % SAIDyadUp -- SAI Dyad Up 3 | % Usage 4 | % [beta,alfa] = SAIDyadUp(afine,D,F,EF,t,j) 5 | % 6 | 7 | n = length(afine); 8 | acoarse = (afine(1:2:(n-1)) + afine(2:2:n)) ./ 2; 9 | ahat = SegRefine(acoarse,D,F,EF,t,j); 10 | adif = afine - ahat; 11 | alfa = sqrt(2) .* adif(2:2:n); 12 | beta = sqrt(2) .* acoarse; 13 | 14 | 15 | 16 | 17 | 18 | % 19 | % Part of Wavelab Version 850 20 | % Built Tue Jan 3 13:20:42 EST 2006 21 | % This is Copyrighted Material 22 | % For Copying permissions see COPYING.m 23 | % Comments? e-mail wavelab@stat.stanford.edu 24 | -------------------------------------------------------------------------------- /Papers/ShortCourse/FWT_SegAI.m: -------------------------------------------------------------------------------- 1 | function wc = FWT_SegAI(x,L,D,F,EF,t) 2 | % FWT_SegAI -- Forward Segmented Transform 3 | % Usage 4 | % wc = FWT_SegAI(x,L,D,F,EF,t) 5 | % 6 | 7 | [n,J] = dyadlength(x); 8 | wc = zeros(1,n); 9 | sig = x; 10 | for j=(J-1):-1:L , 11 | [beta,alfa] = SAIDyadUp(sig,D,F,EF,t,j); 12 | wc(dyad(j)) = alfa; 13 | sig = beta; 14 | end 15 | wc(1:2^L) = sig; 16 | % 17 | 18 | 19 | 20 | 21 | 22 | 23 | % 24 | % Part of Wavelab Version 850 25 | % Built Tue Jan 3 13:20:42 EST 2006 26 | % This is Copyrighted Material 27 | % For Copying permissions see COPYING.m 28 | % Comments? e-mail wavelab@stat.stanford.edu 29 | -------------------------------------------------------------------------------- /Browsers/One-D/wl_spectrum.m: -------------------------------------------------------------------------------- 1 | function sp = wl_spectrum(x,n) 2 | % wl_spectrum -- Called by WLBrowser 3 | % Usage 4 | % sp = wl_spectrum(x,n) 5 | % Inputs 6 | % x time series 7 | % n length of time series 8 | % Outputs 9 | % sp power spectrum of input data 10 | % 11 | % Description 12 | % Computes and returns power spectrum in conventional way. 13 | % 14 | sp = abs(fft(x)).^2; 15 | sp = sp(1:n); 16 | 17 | 18 | 19 | 20 | % 21 | % Part of Wavelab Version 850 22 | % Built Tue Jan 3 13:20:39 EST 2006 23 | % This is Copyrighted Material 24 | % For Copying permissions see COPYING.m 25 | % Comments? e-mail wavelab@stat.stanford.edu 26 | -------------------------------------------------------------------------------- /Datasets/makediag.m: -------------------------------------------------------------------------------- 1 | function im = makediag(m,n) 2 | % makediag -- Make a diagonal pattern 3 | % Usage 4 | % im = makediag(m,n) 5 | % Inputs 6 | % m,n size of desired image 7 | % Outputs 8 | % im m by n image 9 | 10 | im = zeros(m,n); 11 | for i=1:m, 12 | t = (i-.5)*n/m; 13 | im(i,1:floor(t)) = ones(1,floor(t)); 14 | if floor(t) < t, 15 | im(i,ceil(t)) = t - floor(t); 16 | end 17 | end 18 | 19 | 20 | 21 | 22 | 23 | % 24 | % Part of Wavelab Version 850 25 | % Built Tue Jan 3 13:20:39 EST 2006 26 | % This is Copyrighted Material 27 | % For Copying permissions see COPYING.m 28 | % Comments? e-mail wavelab@stat.stanford.edu 29 | -------------------------------------------------------------------------------- /Datasets/raw2mat.m: -------------------------------------------------------------------------------- 1 | function mat = RAW2MAT(filename,lines,columns) 2 | 3 | % RAW2MAT mat = RAW2MAT(filename,lines,columns) loads a '.raw' file into 4 | % matrix 'mat' of size 'lines' * 'columns'. 5 | 6 | fid = fopen(filename,'r'); 7 | mat = fread(fid,[columns,lines])'; 8 | status = fclose(fid); 9 | % if status == 0 10 | % disp('successful') 11 | % else 12 | % disp('unsuccessful') 13 | % end 14 | 15 | 16 | 17 | 18 | % 19 | % Part of Wavelab Version 850 20 | % Built Tue Jan 3 13:20:39 EST 2006 21 | % This is Copyrighted Material 22 | % For Copying permissions see COPYING.m 23 | % Comments? e-mail wavelab@stat.stanford.edu 24 | -------------------------------------------------------------------------------- /DeNoising/GWN.m: -------------------------------------------------------------------------------- 1 | function B = GWN(n,beta) 2 | % GWN- Generation of Gaussian White Noise 3 | % Usage 4 | % B=GWN(n,beta) 5 | % Inputs 6 | % n size of datas 7 | % beta standard deviation 8 | % Outputs 9 | % B resulting noise 10 | % 11 | 12 | B=randn(1,n); 13 | B=B*beta; 14 | 15 | % Written by Maureen Clerc and Jerome Kalifa, 1997 16 | % clerc@cmapx.polytechnique.fr, kalifa@cmapx.polytechnique.fr 17 | 18 | 19 | 20 | 21 | % 22 | % Part of Wavelab Version 850 23 | % Built Tue Jan 3 13:20:39 EST 2006 24 | % This is Copyrighted Material 25 | % For Copying permissions see COPYING.m 26 | % Comments? e-mail wavelab@stat.stanford.edu 27 | -------------------------------------------------------------------------------- /Papers/Tour/rootogram.m: -------------------------------------------------------------------------------- 1 | function [t,y] = rootogram(x,n) 2 | % Rootogram -- compute rootogram of counts data 3 | % Usage 4 | % [t,y] = rootogram(x,n) 5 | % Inputs 6 | % x sample of data, no need for dyadic length 7 | % n number of bins, dyadic 8 | % Outputs 9 | % t ordinate of rootogram 10 | % y abscissa of rootogram 11 | % 12 | [t,y] = fasthist(x,n); 13 | y = sqrt(y + .375); 14 | 15 | 16 | 17 | 18 | % 19 | % Part of Wavelab Version 850 20 | % Built Tue Jan 3 13:20:42 EST 2006 21 | % This is Copyrighted Material 22 | % For Copying permissions see COPYING.m 23 | % Comments? e-mail wavelab@stat.stanford.edu 24 | -------------------------------------------------------------------------------- /Datasets/daubechies.txt: -------------------------------------------------------------------------------- 1 | daubechies.raw -- Gray-scale image of Ingrid Daubechies 2 | 3 | Access 4 | Ingrid = ReadImage('Daubechies'); 5 | 6 | Size 7 | 256 by 256 8 | 9 | Gray Levels 10 | 256 11 | 12 | Description 13 | Ingrid Daubechies is a very active researcher in the field of 14 | wavelet analysis and author of the book "Ten Lectures on Wavelets," 15 | SIAM, 1992. She is inventor of smooth orthonormal wavelets 16 | of compact support. 17 | 18 | Source 19 | Photograph of Ingrid Daubechies at the 1993 AMS winter meetings 20 | in San Antonio, Texas. Taken by David Donoho with Canon XapShot 21 | video still-frame camera. 22 | -------------------------------------------------------------------------------- /Papers/MIPT/MIPTIntro.m: -------------------------------------------------------------------------------- 1 | % MIPTIntro -- Info for MIPTDemo 2 | % 3 | % The .m files in this directory can reproduce the figures 4 | % in the article 5 | % 6 | % Robust "Wavelet Transforms" Based on 7 | % Median-Interpolation 8 | % by 9 | % D.L. Donoho and T. P.Y. Yu 10 | % 11 | % submitted to SIAM Journal of Mathematical Analysis. 12 | % 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | % 21 | % Part of Wavelab Version 850 22 | % Built Tue Jan 3 13:20:42 EST 2006 23 | % This is Copyrighted Material 24 | % For Copying permissions see COPYING.m 25 | % Comments? e-mail wavelab@stat.stanford.edu 26 | -------------------------------------------------------------------------------- /DeNoising/GWN2.m: -------------------------------------------------------------------------------- 1 | function B = GWN2(n,beta) 2 | % GWN2- Generation of 2-D Gaussian White NNoise 3 | % Usage 4 | % B=GWN2(n,beta) 5 | % Inputs 6 | % n size of datas 7 | % beta standard deviation 8 | % Outputs 9 | % B resulting noise 10 | % 11 | 12 | B=randn(n,n); 13 | B=B*beta; 14 | 15 | % Written by Maureen Clerc and Jerome Kalifa, 1997 16 | % clerc@cmapx.polytechnique.fr, kalifa@cmapx.polytechnique.fr 17 | 18 | 19 | 20 | 21 | 22 | % 23 | % Part of Wavelab Version 850 24 | % Built Tue Jan 3 13:20:39 EST 2006 25 | % This is Copyrighted Material 26 | % For Copying permissions see COPYING.m 27 | % Comments? e-mail wavelab@stat.stanford.edu 28 | -------------------------------------------------------------------------------- /Workouts/Toons/toon0545.m: -------------------------------------------------------------------------------- 1 | % toon0545 -- Data Compression of Ingrid Daubechies 2 | % 3 | % Try to compress Daubechies in the Fourier Domain. 4 | % 5 | fingrid = dct2_iv(ingrid); 6 | fcsort = sort(abs(fingrid(:))); 7 | % 8 | fthresh = fcsort(floor(.95*65536)); 9 | cf_ingrid = fingrid .* (abs(fingrid) > fthresh); 10 | icf_ingrid = dct2_iv(cf_ingrid); 11 | GrayImage(icf_ingrid,256); 12 | title('95% DCT Co/Dec of Ingrid'); 13 | 14 | 15 | 16 | 17 | 18 | % 19 | % Part of Wavelab Version 850 20 | % Built Tue Jan 3 13:20:43 EST 2006 21 | % This is Copyrighted Material 22 | % For Copying permissions see COPYING.m 23 | % Comments? e-mail wavelab@stat.stanford.edu 24 | -------------------------------------------------------------------------------- /Books/WaveTour/WTCh07/Sigma8.m: -------------------------------------------------------------------------------- 1 | function s = Sigma8(omega); 2 | 3 | omega = omega./2; 4 | cos2 = cos(omega).^2; 5 | sin2 = 1-cos2; 6 | cos4 = cos2.^2; 7 | sin4 = sin2.^2; 8 | sin6 = sin2.^3; 9 | sin8 = sin4.^2; 10 | s = (5+30.*cos2+30.*sin2.*cos2+70.*cos4+2.*sin4.*cos2+2.*sin6./3); 11 | s = s ./105 ./sin8 ./2^8; 12 | 13 | % Written by Maureen Clerc and Jerome Kalifa, 1997 14 | % clerc@cmapx.polytechnique.fr, kalifa@cmapx.polytechnique.fr 15 | 16 | 17 | 18 | 19 | % 20 | % Part of Wavelab Version 850 21 | % Built Tue Jan 3 13:20:39 EST 2006 22 | % This is Copyrighted Material 23 | % For Copying permissions see COPYING.m 24 | % Comments? e-mail wavelab@stat.stanford.edu 25 | -------------------------------------------------------------------------------- /DeNoising/SoftThresh.m: -------------------------------------------------------------------------------- 1 | function x = SoftThresh(y,t) 2 | % SoftThresh -- Apply Soft Threshold 3 | % Usage 4 | % x = SoftThresh(y,t) 5 | % Inputs 6 | % y Noisy Data 7 | % t Threshold 8 | % Outputs 9 | % x sign(y)(|y|-t)_+ 10 | % 11 | res = (abs(y) - t); 12 | res = (res + abs(res))/2; 13 | x = sign(y).*res; 14 | 15 | % 16 | % Copyright (c) 1993-5. Jonathan Buckheit, David Donoho and Iain Johnstone 17 | % 18 | 19 | 20 | 21 | 22 | % 23 | % Part of Wavelab Version 850 24 | % Built Tue Jan 3 13:20:39 EST 2006 25 | % This is Copyrighted Material 26 | % For Copying permissions see COPYING.m 27 | % Comments? e-mail wavelab@stat.stanford.edu 28 | -------------------------------------------------------------------------------- /Papers/RiskAnalysis/use_wavelet.m: -------------------------------------------------------------------------------- 1 | function use_wavelet(m) 2 | global h_wavmenu Wav_type 3 | 4 | for i=1:4, 5 | set(h_wavmenu(i),'Checked','off'); 6 | end 7 | set(h_wavmenu(m),'Checked','on'); 8 | 9 | if m==1, 10 | Wav_type = 'Haar'; 11 | elseif m==2, 12 | Wav_type = 'Daubechies 6'; 13 | elseif m==3, 14 | Wav_type = 'Symmlet 8'; 15 | else 16 | Wav_type = 'Coiflet 3'; 17 | end 18 | disp(['You have chosen the Wavelet :' Wav_type]); 19 | 20 | 21 | 22 | 23 | % 24 | % Part of Wavelab Version 850 25 | % Built Tue Jan 3 13:20:42 EST 2006 26 | % This is Copyrighted Material 27 | % For Copying permissions see COPYING.m 28 | % Comments? e-mail wavelab@stat.stanford.edu 29 | -------------------------------------------------------------------------------- /Workouts/Toons/toon0233.m: -------------------------------------------------------------------------------- 1 | % toon0233 -- Visualize Wavelet Xform 2 | % 3 | % Here we display a 2-d image and its 2-d wavelet transform 4 | % 5 | ingrid = ReadImage('Daubechies'); 6 | % 7 | clf; subplot(121); 8 | GrayImage(ingrid); 9 | title('Ingrid Daubechies'); 10 | % 11 | % 12 | Q = MakeONFilter('Coiflet',2); 13 | wingrid = FWT2_PO(ingrid,3,Q); 14 | % 15 | % 16 | subplot(122); 17 | zmat = abs(wingrid); 18 | GrayImage(zmat); brighten(.5); 19 | 20 | 21 | 22 | 23 | % 24 | % Part of Wavelab Version 850 25 | % Built Tue Jan 3 13:20:43 EST 2006 26 | % This is Copyrighted Material 27 | % For Copying permissions see COPYING.m 28 | % Comments? e-mail wavelab@stat.stanford.edu 29 | -------------------------------------------------------------------------------- /Papers/Blocky/BlockyIntro.m: -------------------------------------------------------------------------------- 1 | % BlockyIntro -- Info about BlockyDemo % % The files in this directory may be used to reproduce the % figures in the paper % % ``Smooth Wavelet Decompositions with Blocky Coefficient Kernels'' % by D.L. Donoho % % The paper may be obtained by WWW from % http://www-stat.stanford.edu/~donoho/Reports/1993/blocky.ps.Z. % % The paper shows how to make wavelets which satisfy prescribed % boxcar averages and illustrates some applications of these. % 2 | 3 | % 4 | % Part of Wavelab Version 850 5 | % Built Tue Jan 3 13:20:41 EST 2006 6 | % This is Copyrighted Material 7 | % For Copying permissions see COPYING.m 8 | % Comments? e-mail wavelab@stat.stanford.edu 9 | -------------------------------------------------------------------------------- /Workouts/Toons/PlotLevelNorms.m: -------------------------------------------------------------------------------- 1 | function PlotLevelNorms(wc,L) 2 | % PlotLevelNorms -- Plot level-wise norms 3 | % Usage 4 | % PlotLevelNorms(wc,L) 5 | % Inputs 6 | % wc wavelet coeffs 7 | % L splitting depth 8 | % 9 | 10 | [n,J] = dyadlength(wc); 11 | norms = zeros(1,J-L); 12 | % 13 | norms(1) = norm(wc(1:2^L)); 14 | for j=L:(J-1), 15 | norms(j-L+1) = norm(wc(dyad(j))); 16 | end 17 | % 18 | semilogy(L:(J-1),norms) 19 | 20 | 21 | 22 | 23 | % 24 | % Part of Wavelab Version 850 25 | % Built Tue Jan 3 13:20:43 EST 2006 26 | % This is Copyrighted Material 27 | % For Copying permissions see COPYING.m 28 | % Comments? e-mail wavelab@stat.stanford.edu 29 | -------------------------------------------------------------------------------- /Documentation/FEEDBACK.m: -------------------------------------------------------------------------------- 1 | % FEEDBACK -- Encouraging User Feedback about WaveLab 2 | % 3 | % Please let us have your comments and suggestions! 4 | % 5 | % e-mail: 6 | % wavelab@stat.stanford.edu 7 | % 8 | % Individuals: 9 | % Ofer Levi levio@stat.stanford.edu 10 | % Mark Dunjcan mduncan@stat.stanford.edu 11 | % Dave Donoho donoho@stat.stanford.edu 12 | % 13 | 14 | % Revision History 15 | % 10/02/99 DLD updated e-mails addresses 16 | 17 | 18 | 19 | 20 | % 21 | % Part of Wavelab Version 850 22 | % Built Tue Jan 3 13:20:40 EST 2006 23 | % This is Copyrighted Material 24 | % For Copying permissions see COPYING.m 25 | % Comments? e-mail wavelab@stat.stanford.edu 26 | -------------------------------------------------------------------------------- /Papers/Adapt/adfig02.m: -------------------------------------------------------------------------------- 1 | % adfig02 -- Adapt Figure 02: Noisy Versions of Four Signals % % The four objects of Figure 1 with white noise superposed. % The noise is normally distributed with variance 1. % % global N L t global yblocks ybumps yheavi yDoppler % %clf; versaplot(221,t,yblocks, [],' 2 (a) Noisy Blocks ' ,[],[]) versaplot(222,t,ybumps, [],' 2 (b) Noisy Bumps ' ,[],[]) versaplot(223,t,yheavi, [],' 2 (c) Noisy HeaviSine ',[],[]) versaplot(224,t,yDoppler,[],' 2 (d) Noisy Doppler ' ,[],[]) 2 | 3 | % 4 | % Part of Wavelab Version 850 5 | % Built Tue Jan 3 13:20:41 EST 2006 6 | % This is Copyrighted Material 7 | % For Copying permissions see COPYING.m 8 | % Comments? e-mail wavelab@stat.stanford.edu 9 | -------------------------------------------------------------------------------- /Utilities/UnlockAxes.m: -------------------------------------------------------------------------------- 1 | function UnlockAxes 2 | % UnlockAxes -- Version-independent axis command 3 | % Usage 4 | % UnlockAxes 5 | % 6 | % Side Effects 7 | % Cancels the *hold* side effect of LockAxes using a method 8 | % which works under both v3.5 and v4.0 of MATLAB. 9 | % 10 | % See Also 11 | % LockAxes, MATLABVERSION 12 | % 13 | global MATLABVERSION 14 | if MATLABVERSION == 3.5, 15 | hold off; axis; 16 | else 17 | hold off; 18 | end 19 | 20 | 21 | 22 | 23 | % 24 | % Part of Wavelab Version 850 25 | % Built Tue Jan 3 13:20:43 EST 2006 26 | % This is Copyrighted Material 27 | % For Copying permissions see COPYING.m 28 | % Comments? e-mail wavelab@stat.stanford.edu 29 | -------------------------------------------------------------------------------- /Biorthogonal/extend.m: -------------------------------------------------------------------------------- 1 | function y = extend(x,par1,par2) 2 | % extend -- perform various kinds of symmetric extension 3 | % 4 | if par1==1 & par2==1, 5 | y = [x x((length(x)-1):-1:2)]; 6 | elseif par1==1 & par2==2, 7 | y = [x x((length(x)-1):-1:1)]; 8 | elseif par1==2 & par2==1, 9 | y = [x x(length(x):-1:2)]; 10 | elseif par1==2 & par2==2, 11 | y = [x reverse(x)]; 12 | end 13 | 14 | % 15 | % Copyright (c) 1996. Thomas P.Y. Yu 16 | % 17 | 18 | 19 | 20 | 21 | % 22 | % Part of Wavelab Version 850 23 | % Built Tue Jan 3 13:20:38 EST 2006 24 | % This is Copyrighted Material 25 | % For Copying permissions see COPYING.m 26 | % Comments? e-mail wavelab@stat.stanford.edu 27 | -------------------------------------------------------------------------------- /Browsers/One-D/plot_new_data.m: -------------------------------------------------------------------------------- 1 | function plot_new_data 2 | % plot_new_data -- Called by WLBrowser 3 | % Usage 4 | % plot_new_data 5 | % 6 | global PlotFig x_use HC n signal_name 7 | 8 | ntmp = zeros(1,n+3); 9 | ntmp(1) = min(min(x_use)); 10 | ntmp(2) = max(max(x_use)); 11 | ntmp(3) = min(n/2,2048); 12 | ntmp(4:(n+3)) = x_use(:); 13 | set(PlotFig,'UserData',ntmp); 14 | update_plot(get(HC,'value')); 15 | set(PlotFig,'Name',['Signal: ' signal_name]); 16 | 17 | 18 | 19 | 20 | % 21 | % Part of Wavelab Version 850 22 | % Built Tue Jan 3 13:20:39 EST 2006 23 | % This is Copyrighted Material 24 | % For Copying permissions see COPYING.m 25 | % Comments? e-mail wavelab@stat.stanford.edu 26 | -------------------------------------------------------------------------------- /Datasets/canaletto.txt: -------------------------------------------------------------------------------- 1 | canaletto.raw -- Gray-scale image of Canaletto painting 2 | 3 | Access 4 | Canal = ReadImage('Canaletto'); 5 | 6 | Size 7 | 512 by 512 8 | 9 | Gray Levels 10 | 256 11 | 12 | Description 13 | This image was used in an article by P. Perona and J. Malik, 14 | "Scale-Space Filtering by Anisotropic Diffusions," IEE PAMI. 15 | Malik digitized the image from a small reproduction of the 16 | original, which hangs in the National Gallery in Washington, 17 | D.C. and was painted in Venice by Antonio Canal, nicknamed 18 | `Canaletto,'' in 1720. 19 | 20 | Source 21 | Obtained from John Canny and Jitendra Malik, of EECS at 22 | U.C. Berkeley. 23 | -------------------------------------------------------------------------------- /Papers/ShortCourse/SegRefine.m: -------------------------------------------------------------------------------- 1 | function a2 = SegRefine(a,D,Filter,EdgeFilter,t,j) 2 | % SegRefine -- Perform refinement 3 | % Usage 4 | % a2 = SegRefine(a,D,Filter,EdgeFilter,t,j) 5 | % 6 | k0 = floor(2^j * t); kk0 = k0; 7 | eta0 = (2^j * t) - k0; 8 | if eta0 > .5, 9 | kk0 = k0+1; 10 | %fprintf('flipping: [eta0,k0,j,t]= '), disp([eta0,k0,j,t]) 11 | end 12 | SegFilter = MakeAISegmentFilter(D,eta0); 13 | a2 = SRefine(a,D,Filter,EdgeFilter,SegFilter,k0,kk0); 14 | 15 | 16 | 17 | 18 | % 19 | % Part of Wavelab Version 850 20 | % Built Tue Jan 3 13:20:42 EST 2006 21 | % This is Copyrighted Material 22 | % For Copying permissions see COPYING.m 23 | % Comments? e-mail wavelab@stat.stanford.edu 24 | -------------------------------------------------------------------------------- /Workouts/Toons/toon0512.m: -------------------------------------------------------------------------------- 1 | % toon0512 -- Lincoln Refinement Scheme 2 | % 3 | % Now show Abe as the upper left corner of a 128*128 4 | % two-dimensional wavelet transform. 5 | % 6 | HonestAbe = ReadImage('Lincoln'); 7 | CrudeAbe = HCoarsen2d(HonestAbe,1); 8 | % 9 | BigAbe = zeros(128,128); 10 | BigAbe(1:32,1:32) = CrudeAbe; 11 | image(BigAbe); 12 | axis('image') 13 | colormap(gray(32)); 14 | title('Extension to 128*128 in Wavelet Domain'); 15 | 16 | 17 | 18 | 19 | 20 | % 21 | % Part of Wavelab Version 850 22 | % Built Tue Jan 3 13:20:43 EST 2006 23 | % This is Copyrighted Material 24 | % For Copying permissions see COPYING.m 25 | % Comments? e-mail wavelab@stat.stanford.edu 26 | -------------------------------------------------------------------------------- /Packets/One-D/node.m: -------------------------------------------------------------------------------- 1 | function index = node(d,b) 2 | % node -- Tree indexing function 3 | % Usage 4 | % index = node(d,b) 5 | % Inputs 6 | % d depth from root of tree 7 | % b index among the 2^d possibilities 8 | % in a left-right scan at that depth 9 | % Outputs 10 | % index linear index of node in tree structure 11 | % 12 | index = 2^d + b; 13 | 14 | % 15 | % Copyright (c) 1993. David L. Donoho 16 | % 17 | 18 | 19 | 20 | 21 | 22 | % 23 | % Part of Wavelab Version 850 24 | % Built Tue Jan 3 13:20:40 EST 2006 25 | % This is Copyrighted Material 26 | % For Copying permissions see COPYING.m 27 | % Comments? e-mail wavelab@stat.stanford.edu 28 | -------------------------------------------------------------------------------- /DeNoising/SNR.m: -------------------------------------------------------------------------------- 1 | function value = SNR(sig1,sig2) 2 | % SNR- Signal/Noise ratio 3 | % Usage 4 | % value=SNR(sig1,sig2) 5 | % Inputs 6 | % sig1 Original reference signal 7 | % sig2 Restored or noisy signal 8 | % Outputs 9 | % value Signal/Noise ratio. 10 | % 11 | 12 | 13 | value=20*log10(norm(sig1)/norm(sig1-sig2)); 14 | 15 | % Written by Maureen Clerc and Jerome Kalifa, 1997 16 | % clerc@cmapx.polytechnique.fr, kalifa@cmapx.polytechnique.fr 17 | 18 | 19 | 20 | 21 | 22 | % 23 | % Part of Wavelab Version 850 24 | % Built Tue Jan 3 13:20:39 EST 2006 25 | % This is Copyrighted Material 26 | % For Copying permissions see COPYING.m 27 | % Comments? e-mail wavelab@stat.stanford.edu 28 | -------------------------------------------------------------------------------- /Papers/SpinCycle/cspinf16.m: -------------------------------------------------------------------------------- 1 | % cspinf16 -- Non-Spinning Fourier De-Noising 2 | % 3 | global RatSine IrrSine yRatSine yIrrSine 4 | global tsine nsine 5 | % 6 | global fRatSine fIrrSine 7 | % 8 | fRatSine = real(FourierDeNoise(yRatSine)); 9 | % 10 | fIrrSine = real(FourierDeNoise(yIrrSine)); 11 | % 12 | % figure; 13 | subplot(221); plot(fRatSine); title(' 16(a) Fourier DeNoise[yRatSine] '); 14 | subplot(222); plot(fIrrSine); title(' 16(b) Fourier DeNoise[yIrrSine] '); 15 | 16 | 17 | 18 | 19 | % 20 | % Part of Wavelab Version 850 21 | % Built Tue Jan 3 13:20:42 EST 2006 22 | % This is Copyrighted Material 23 | % For Copying permissions see COPYING.m 24 | % Comments? e-mail wavelab@stat.stanford.edu 25 | -------------------------------------------------------------------------------- /Browsers/One-D/sonify.m: -------------------------------------------------------------------------------- 1 | function sonify(frac) 2 | % sonfiy -- Called by WLBrowser 3 | % Usage 4 | % sonfiy(frac) 5 | % 6 | global PlotFig HC n 7 | tmp = get(PlotFig,'UserData'); 8 | %n 9 | %disp(tmp(1:10)) 10 | s = length(tmp); 11 | x = tmp(4:s); 12 | m = round(frac*n); 13 | panel = tmp(3); 14 | lo = m - panel + 1; 15 | hi = m + panel ; 16 | lo = max(1,min(lo,n-2*panel)); 17 | hi = min(n,max(hi,2*panel+1)); 18 | %[lo hi panel] 19 | r = lo:hi; 20 | sound(x(r),8192); 21 | 22 | 23 | 24 | 25 | % 26 | % Part of Wavelab Version 850 27 | % Built Tue Jan 3 13:20:39 EST 2006 28 | % This is Copyrighted Material 29 | % For Copying permissions see COPYING.m 30 | % Comments? e-mail wavelab@stat.stanford.edu 31 | -------------------------------------------------------------------------------- /Utilities/WaitUntil.m: -------------------------------------------------------------------------------- 1 | function WaitUntil(oldclock,sec) 2 | % WaitUntil -- Burn up CPU cycles until sec seconds elapse from oldclock 3 | % Usage 4 | % WaitUntil(oldclock,sec) 5 | % Inputs 6 | % oldclock old clock value 7 | % sec number of seconds to wait 8 | % 9 | % Side Effects 10 | % A pause of sec will be effected 11 | % 12 | 13 | while etime(clock,oldclock) < sec 14 | for i=1:1000, x = zeros(1,100); end 15 | etime(clock,oldclock); 16 | end 17 | 18 | 19 | 20 | 21 | % 22 | % Part of Wavelab Version 850 23 | % Built Tue Jan 3 13:20:43 EST 2006 24 | % This is Copyrighted Material 25 | % For Copying permissions see COPYING.m 26 | % Comments? e-mail wavelab@stat.stanford.edu 27 | -------------------------------------------------------------------------------- /Workouts/Toons/toon0547.m: -------------------------------------------------------------------------------- 1 | % toon0547 -- Data Compression of Ingrid Daubechies 2 | % 3 | % Visualize residuals (reconstruction errors) for 4 | % the wavelet and DCT transforms of Daubechies. 5 | % 6 | subplot(1,2,1) 7 | GrayImage(abs(ingrid-icw_ingrid),32); 8 | title('Errors from 95% Wavelet Co/Dec') 9 | colormap(1-gray(32)) 10 | 11 | subplot(1,2,2) 12 | GrayImage(abs(ingrid-icf_ingrid),32); 13 | title('Errors from 95% DCT Co/Dec') 14 | colormap(1-gray(32)) 15 | 16 | 17 | 18 | 19 | 20 | % 21 | % Part of Wavelab Version 850 22 | % Built Tue Jan 3 13:20:43 EST 2006 23 | % This is Copyrighted Material 24 | % For Copying permissions see COPYING.m 25 | % Comments? e-mail wavelab@stat.stanford.edu 26 | -------------------------------------------------------------------------------- /Workouts/BestOrthoBasis/BBWork43.m: -------------------------------------------------------------------------------- 1 | % BBWork43 -- WP and CP Tours on Transients Signal 2 | % 3 | figure; 4 | tr = ReadSignal('Transients'); 5 | WPTour('P', tr,9,MakeONFilter('Coiflet',3),'Transient'); 6 | subplot(2,2,3); axis([0 500 -5 5]) 7 | subplot(2,2,4); brighten(-.5) 8 | ifprint(gcf,'bbwork431.ps'); 9 | % 10 | figure; 11 | CPTour('P', tr,6,'Transient'); 12 | subplot(2,2,3); axis([0 500 -5 5]) 13 | subplot(2,2,4); brighten(-.5) 14 | ifprint(gcf,'bbwork432.ps'); 15 | 16 | 17 | 18 | 19 | % 20 | % Part of Wavelab Version 850 21 | % Built Tue Jan 3 13:20:43 EST 2006 22 | % This is Copyrighted Material 23 | % For Copying permissions see COPYING.m 24 | % Comments? e-mail wavelab@stat.stanford.edu 25 | -------------------------------------------------------------------------------- /Documentation/REGISTRATION.m: -------------------------------------------------------------------------------- 1 | % REGISTRATION -- WaveLab Registration 2 | % 3 | % Please Register yourself as a user of WaveLab so that we can send 4 | % you e-mail about upgrades and enhancements. 5 | % To Register: 6 | % e-mail wavelab@stat.stanford.edu, 7 | % with subject line ``registration'' 8 | % 9 | % If you like, please include information about the version of MATLAB 10 | % you are using and about the type of machine you are using. 11 | % 12 | 13 | 14 | 15 | 16 | % 17 | % Part of Wavelab Version 850 18 | % Built Tue Jan 3 13:20:40 EST 2006 19 | % This is Copyrighted Material 20 | % For Copying permissions see COPYING.m 21 | % Comments? e-mail wavelab@stat.stanford.edu 22 | -------------------------------------------------------------------------------- /Datasets/coifman.txt: -------------------------------------------------------------------------------- 1 | coifman.raw -- Gray-scale image of R.R. Coifman 2 | 3 | Access 4 | Raphy = ReadImage('Coifman'); 5 | 6 | Size 7 | 256 by 256 8 | 9 | Gray Levels 10 | 256 11 | 12 | Description 13 | Ronald R. Coifman, Professor of Mathematics at Yale University, 14 | has developed much of the field that is now known as "adapted 15 | wavelet analysis." He has invented, in collaboration with 16 | Y. Meyer, wavelet packets and cosine packets, as well as the 17 | Coifman-Wickerhauser best-basis algorithm. 18 | 19 | Source 20 | Photograph of R.R. Coifman at the 1993 AMS winter meetings 21 | in San Antonio, Texas. Taken by David Donoho with Canon XapShot 22 | video still-frame camera. 23 | -------------------------------------------------------------------------------- /Books/WaveTour/WTCh02/WTCh02Demo.m: -------------------------------------------------------------------------------- 1 | function WTCh02Demo 2 | % WTCh02Demo -- Demo Browser for chapter 2. 3 | % Usage 4 | % WTCh02Demo 5 | % Inputss 6 | % none 7 | % Outputs 8 | % none 9 | % 10 | 11 | choice=menu('Chapter 2', 'figure 1', 'Exit Chapter 2'); 12 | 13 | switch(choice); 14 | case(1), wt02fig01, WTCh02Demo; 15 | case(2), close all; 16 | end 17 | 18 | % Written by Maureen Clerc and Jerome Kalifa, 1997 19 | % clerc@cmapx.polytechnique.fr, kalifa@cmapx.polytechnique.fr 20 | 21 | 22 | 23 | 24 | % 25 | % Part of Wavelab Version 850 26 | % Built Tue Jan 3 13:20:38 EST 2006 27 | % This is Copyrighted Material 28 | % For Copying permissions see COPYING.m 29 | % Comments? e-mail wavelab@stat.stanford.edu 30 | -------------------------------------------------------------------------------- /Books/WaveTour/WTCh04/Analytic.m: -------------------------------------------------------------------------------- 1 | function g = Analytic(f); 2 | % 3 | % Takes the Analytic part of signal f 4 | % 5 | f0 = f; 6 | f = f(:); 7 | N = length(f); 8 | hatf = fft(f); 9 | hatg = zeros(N,1); 10 | hatg(1) = hatf(1); 11 | hatg(2:N/2) = 2*hatf(2:N/2); 12 | hatg(N/2+1) = hatf(N/2+1); 13 | g = ifft(hatg); 14 | 15 | % g = ShapeLike(g,f0); 16 | 17 | % Written by Maureen Clerc and Jerome Kalifa, 1997 18 | % clerc@cmapx.polytechnique.fr, kalifa@cmapx.polytechnique.fr 19 | 20 | 21 | 22 | 23 | % 24 | % Part of Wavelab Version 850 25 | % Built Tue Jan 3 13:20:38 EST 2006 26 | % This is Copyrighted Material 27 | % For Copying permissions see COPYING.m 28 | % Comments? e-mail wavelab@stat.stanford.edu 29 | -------------------------------------------------------------------------------- /Books/WaveTour/WTCh06/cantor.m: -------------------------------------------------------------------------------- 1 | function x = cantor(x,n1,n2,p,a1,a2,b1,b2); 2 | 3 | if n2-n1 < 0, 4 | disp('problem') 5 | elseif (n2 - n1 + 1) <= 6, 6 | for i = ceil(n1) : floor(n2), 7 | x(i) = p ./ (floor(n2) - ceil(n1) + 1); 8 | end 9 | else 10 | x = cantor(x,n1,n1+(n2-n1+1)*a1-1,p*b1,a1,a2,b1,b2); 11 | x = cantor(x,n1+(n2-n1+1)*a2,n2,p*b2,a1,a2,b1,b2); 12 | end 13 | 14 | % Written by Maureen Clerc and Jerome Kalifa, 1997 15 | % clerc@cmapx.polytechnique.fr, kalifa@cmapx.polytechnique.fr 16 | 17 | 18 | 19 | 20 | % 21 | % Part of Wavelab Version 850 22 | % Built Tue Jan 3 13:20:39 EST 2006 23 | % This is Copyrighted Material 24 | % For Copying permissions see COPYING.m 25 | % Comments? e-mail wavelab@stat.stanford.edu 26 | -------------------------------------------------------------------------------- /Books/WaveTour/WTCh07/Meyerhath.m: -------------------------------------------------------------------------------- 1 | function [hath] = Meyerhath(omega); 2 | 3 | omega = modulo(omega+pi,2*pi)-pi; 4 | n = length(omega); 5 | hath = zeros(1,n); 6 | supp = find((abs(omega) >= pi/3) & (abs(omega) <= 2*pi/3)); 7 | hath(supp) = sqrt(2) .* cos(pi/2.*beta01(3*abs(omega(supp))/pi-1)); 8 | supp2 = find(abs(omega) < pi/3); 9 | hath(supp2) = sqrt(2)* ones(size(supp2)); 10 | 11 | % Written by Maureen Clerc and Jerome Kalifa, 1997 12 | % clerc@cmapx.polytechnique.fr, kalifa@cmapx.polytechnique.fr 13 | 14 | 15 | 16 | 17 | % 18 | % Part of Wavelab Version 850 19 | % Built Tue Jan 3 13:20:39 EST 2006 20 | % This is Copyrighted Material 21 | % For Copying permissions see COPYING.m 22 | % Comments? e-mail wavelab@stat.stanford.edu 23 | -------------------------------------------------------------------------------- /DeNoising/GWNoisy2.m: -------------------------------------------------------------------------------- 1 | function Noisyim = GWNoisy2(im,sigma) 2 | % GWNoisy2- Addition of a 2D Gaussian White Noise 3 | % Usage 4 | % Noisyim = GWNoisy2(im,sigma) 5 | % Inputs 6 | % im Input simage 7 | % sigma s.d for additive GWN 8 | % Outputs 9 | % Noisyim Noisy image 10 | % 11 | 12 | n=length(im); 13 | Noise=GWN2(n,sigma); 14 | Noisyim=im+Noise; 15 | 16 | % Written by Maureen Clerc and Jerome Kalifa, 1997 17 | % clerc@cmapx.polytechnique.fr, kalifa@cmapx.polytechnique.fr 18 | 19 | 20 | 21 | 22 | % 23 | % Part of Wavelab Version 850 24 | % Built Tue Jan 3 13:20:39 EST 2006 25 | % This is Copyrighted Material 26 | % For Copying permissions see COPYING.m 27 | % Comments? e-mail wavelab@stat.stanford.edu 28 | -------------------------------------------------------------------------------- /Orthogonal/dyad2ix.m: -------------------------------------------------------------------------------- 1 | function ix = dyad2ix(j,k) 2 | % dyad2ix -- Convert wavelet indexing into linear indexing 3 | % Usage 4 | % ix = dyad2ix(j,k) 5 | % Inputs 6 | % j Resolution Level. j >= 0. 7 | % k Spatial Position. 0 <= k < 2^j 8 | % Outputs 9 | % ix index in linear 1-d wavelet transform array where 10 | % the (j,k) wavelet coefficient is stored 11 | % 12 | ix = 2^j + k + 1; 13 | 14 | % 15 | % Copyright (c) 1993. David L. Donoho 16 | % 17 | 18 | 19 | 20 | 21 | 22 | 23 | % 24 | % Part of Wavelab Version 850 25 | % Built Tue Jan 3 13:20:40 EST 2006 26 | % This is Copyrighted Material 27 | % For Copying permissions see COPYING.m 28 | % Comments? e-mail wavelab@stat.stanford.edu 29 | -------------------------------------------------------------------------------- /Papers/ShortCourse/scfig21.m: -------------------------------------------------------------------------------- 1 | % scfig21 -- Short Course 21: Four Noisy Time-Frequency test signals 2 | % 3 | % We display here four noisy versions of the signals in Figure 20. 4 | % 5 | global yQuad yMish vBumps vDoppler tt 6 | % 7 | % clf; 8 | versaplot(221,tt,yQuad,[], ' 21 (a) Noisy QuadChirp ',[],[]) 9 | versaplot(222,tt,yMish,[], ' 21 (b) Noisy MishMash ',[],[]) 10 | versaplot(223,tt,vBumps,[], ' 21 (c) Noisy Bumps ',[],[]) 11 | versaplot(224,tt,vDoppler,[],' 21 (d) Noisy Doppler ',[],[]) 12 | 13 | 14 | 15 | 16 | % 17 | % Part of Wavelab Version 850 18 | % Built Tue Jan 3 13:20:42 EST 2006 19 | % This is Copyrighted Material 20 | % For Copying permissions see COPYING.m 21 | % Comments? e-mail wavelab@stat.stanford.edu 22 | -------------------------------------------------------------------------------- /Papers/RiskAnalysis/redo_plot.m: -------------------------------------------------------------------------------- 1 | function redo_plot(frac) 2 | global PlotFig HC x_length x_name 3 | tmp = get(PlotFig,'UserData'); 4 | %disp(tmp(1:10)) 5 | s = length(tmp); 6 | x = tmp(4:s); 7 | m = round(frac*x_length); 8 | panel = tmp(3); 9 | lo = m - panel + 1; 10 | hi = m + panel; 11 | lo = max(1,min(lo,x_length-2*panel)); 12 | hi = min(x_length,max(hi,2*panel+1)); 13 | %[lo hi panel] 14 | r = lo:hi; 15 | plot(r/x_length,x(r)); 16 | axis([0,1,(tmp(1)-0.2),(tmp(2)+0.2)]); 17 | grid 18 | title(x_name); 19 | 20 | 21 | 22 | 23 | % 24 | % Part of Wavelab Version 850 25 | % Built Tue Jan 3 13:20:42 EST 2006 26 | % This is Copyrighted Material 27 | % For Copying permissions see COPYING.m 28 | % Comments? e-mail wavelab@stat.stanford.edu 29 | -------------------------------------------------------------------------------- /Papers/RiskAnalysis/sonify.m: -------------------------------------------------------------------------------- 1 | function sonify(frac) 2 | % sonify -- Called by WLBrowser 3 | % Usage 4 | % sonfiy(frac) 5 | % 6 | global PlotFig HC n 7 | tmp = get(PlotFig,'UserData'); 8 | %n 9 | %disp(tmp(1:10)) 10 | s = length(tmp); 11 | x = tmp(4:s); 12 | m = round(frac*n); 13 | panel = tmp(3); 14 | lo = m - panel + 1; 15 | hi = m + panel ; 16 | lo = max(1,min(lo,n-2*panel)); 17 | hi = min(n,max(hi,2*panel+1)); 18 | %[lo hi panel] 19 | r = lo:hi; 20 | sound(x(r),8192); 21 | 22 | 23 | 24 | 25 | 26 | 27 | % 28 | % Part of Wavelab Version 850 29 | % Built Tue Jan 3 13:20:42 EST 2006 30 | % This is Copyrighted Material 31 | % For Copying permissions see COPYING.m 32 | % Comments? e-mail wavelab@stat.stanford.edu 33 | -------------------------------------------------------------------------------- /Workouts/Toons/toon0231.m: -------------------------------------------------------------------------------- 1 | % toon0231 -- Visualize Wavelet Xform 2 | % 3 | % Here we display a 2-d image (a stick figure) 4 | % and its 2-d wavelet transform. 5 | % 6 | stick = Make2dSignal('StickFigure', 128); 7 | % 8 | clf; subplot(121); 9 | AutoImage(stick); 10 | title('Skinny'); 11 | % 12 | Q = MakeONFilter('Coiflet',2); 13 | wstick = FWT2_PO(stick,3,Q); 14 | % 15 | subplot(122); 16 | zmat = sqrt(abs(wstick)); 17 | zmat = 256-3.8*zmat; 18 | AutoImage(zmat); 19 | title('WT2[Skinny]'); 20 | 21 | 22 | 23 | 24 | % 25 | % Part of Wavelab Version 850 26 | % Built Tue Jan 3 13:20:43 EST 2006 27 | % This is Copyrighted Material 28 | % For Copying permissions see COPYING.m 29 | % Comments? e-mail wavelab@stat.stanford.edu 30 | -------------------------------------------------------------------------------- /Orthogonal/DownDyadLo.m: -------------------------------------------------------------------------------- 1 | function d = DownDyadLo(x,qmf) 2 | % DownDyadLo -- Lo-Pass Downsampling operator (periodized) 3 | % Usage 4 | % d = DownDyadLo(x,f) 5 | % Inputs 6 | % x 1-d signal at fine scale 7 | % f filter 8 | % Outputs 9 | % y 1-d signal at coarse scale 10 | % 11 | % See Also 12 | % DownDyadHi, UpDyadHi, UpDyadLo, FWT_PO, aconv 13 | % 14 | d = aconv(qmf,x); 15 | n = length(d); 16 | d = d(1:2:(n-1)); 17 | 18 | % 19 | % Copyright (c) 1993. Iain M. Johnstone 20 | % 21 | 22 | 23 | 24 | 25 | % 26 | % Part of Wavelab Version 850 27 | % Built Tue Jan 3 13:20:40 EST 2006 28 | % This is Copyrighted Material 29 | % For Copying permissions see COPYING.m 30 | % Comments? e-mail wavelab@stat.stanford.edu 31 | -------------------------------------------------------------------------------- /Papers/Asymp/AsympIntro.m: -------------------------------------------------------------------------------- 1 | % AsympIntro -- Info for AsympDemo 2 | % 3 | % The .m files in this firectory can reproduce the figures 4 | % in the article 5 | % 6 | % Wavelet Shrinkage: Asymptopia? 7 | % by 8 | % D.L. Donoho, I.M. Johnstone, G. Kerkyacharian, D. Picard 9 | % 10 | % to appear in J. Roy. Stat. Soc. B, with discussion 11 | % 12 | % These figures illustrate the application of thresholding of wavelet 13 | % transforms of noisy and incomplete data. 14 | % 15 | 16 | 17 | 18 | 19 | 20 | % 21 | % Part of Wavelab Version 850 22 | % Built Tue Jan 3 13:20:41 EST 2006 23 | % This is Copyrighted Material 24 | % For Copying permissions see COPYING.m 25 | % Comments? e-mail wavelab@stat.stanford.edu 26 | -------------------------------------------------------------------------------- /Biorthogonal/dyadpartition.m: -------------------------------------------------------------------------------- 1 | function dp = dyadpartition(n) 2 | % dyadpartition -- determine dyadic partition in wavelet transform of 3 | % nondyadic signals 4 | 5 | J = ceil(log2(n)); 6 | 7 | m = n; 8 | for j=J-1:-1:0; 9 | if rem(m,2)==0, 10 | dps(j+1) = m/2; 11 | m = m/2; 12 | else 13 | dps(j+1) = (m-1)/2; 14 | m = (m+1)/2; 15 | end 16 | end 17 | 18 | dp = cumsum([1 dps]); 19 | 20 | % 21 | % Copyright (c) 1996. Thomas P.Y. Yu 22 | % 23 | 24 | 25 | 26 | 27 | 28 | % 29 | % Part of Wavelab Version 850 30 | % Built Tue Jan 3 13:20:38 EST 2006 31 | % This is Copyrighted Material 32 | % For Copying permissions see COPYING.m 33 | % Comments? e-mail wavelab@stat.stanford.edu 34 | -------------------------------------------------------------------------------- /Books/WaveTour/WTCh04/ourphase.m: -------------------------------------------------------------------------------- 1 | function phi = ourphase(g,epsilon); 2 | % phi = ourphase(g); 3 | % calculates the complex phase of vector g ; 4 | % coordinates whose moduli are smaller than a defined 5 | % threshold epsilon are associated to phi = -pi/2; 6 | 7 | 8 | 9 | phase = rem(imag(log(g)),2*pi.*ones(size(g))); 10 | phi = phase.*(abs(g) > epsilon) - pi * (abs(g) <= epsilon); 11 | 12 | % Written by Maureen Clerc and Jerome Kalifa, 1997 13 | % clerc@cmapx.polytechnique.fr, kalifa@cmapx.polytechnique.fr 14 | 15 | 16 | 17 | 18 | 19 | % 20 | % Part of Wavelab Version 850 21 | % Built Tue Jan 3 13:20:38 EST 2006 22 | % This is Copyrighted Material 23 | % For Copying permissions see COPYING.m 24 | % Comments? e-mail wavelab@stat.stanford.edu 25 | -------------------------------------------------------------------------------- /Datasets/mat2raw.m: -------------------------------------------------------------------------------- 1 | function MAT2RAW(filename,x) 2 | 3 | % MAT2RAW MAT2RAW(filename,x) writes matrix 'x' into file 'filename' in 4 | % 'raw' form. 5 | 6 | [s1,s2]=size(x); 7 | for i=1:s1 8 | for j=1:s2 9 | if x(i,j)<0 x(i,j)=0;end; 10 | if x(i,j)>255 x(i,j)=255;end; 11 | end 12 | end 13 | 14 | fid = fopen(filename,'w'); 15 | count = fwrite(fid,x','char') 16 | status = fclose(fid); 17 | if status == 0 18 | disp('successful') 19 | else 20 | disp('unsuccessful') 21 | end 22 | 23 | 24 | 25 | 26 | % 27 | % Part of Wavelab Version 850 28 | % Built Tue Jan 3 13:20:39 EST 2006 29 | % This is Copyrighted Material 30 | % For Copying permissions see COPYING.m 31 | % Comments? e-mail wavelab@stat.stanford.edu 32 | -------------------------------------------------------------------------------- /DeNoising/GWNoisy.m: -------------------------------------------------------------------------------- 1 | function Noisysig = GWNoisy(data,sigma) 2 | % GWNoisy- Addition of a Gaussian White Noise 3 | % Usage 4 | % Noisysig = GWNoisy(sig,sigma) 5 | % Inputs 6 | % sig Input signal 7 | % sigma s.d for additive Gaussian White Noise 8 | % Outputs 9 | % Noisysig 1-d signal 10 | % 11 | 12 | n=length(data); 13 | Noise=GWN(n,sigma); 14 | Noisysig=Noise+data; 15 | 16 | % Written by Maureen Clerc and Jerome Kalifa, 1997 17 | % clerc@cmapx.polytechnique.fr, kalifa@cmapx.polytechnique.fr 18 | 19 | 20 | 21 | 22 | % 23 | % Part of Wavelab Version 850 24 | % Built Tue Jan 3 13:20:39 EST 2006 25 | % This is Copyrighted Material 26 | % For Copying permissions see COPYING.m 27 | % Comments? e-mail wavelab@stat.stanford.edu 28 | -------------------------------------------------------------------------------- /Packets/One-D/packet.m: -------------------------------------------------------------------------------- 1 | function p = packet(d,b,n) 2 | % packet -- Packet table indexing 3 | % Usage 4 | % p = packet(d,b,n) 5 | % Inputs 6 | % d depth of splitting in packet decomposition 7 | % b block index among 2^d possibilities at depth d 8 | % n length of signal 9 | % Outputs 10 | % p linear indices of all coeff's in that block 11 | % 12 | 13 | npack = 2^d; 14 | p = ( (b * (n/npack) + 1) : ((b+1)*n/npack ) ) ; 15 | 16 | % 17 | % Copyright (c) 1993. David L. Donoho 18 | % 19 | 20 | 21 | 22 | 23 | % 24 | % Part of Wavelab Version 850 25 | % Built Tue Jan 3 13:20:40 EST 2006 26 | % This is Copyrighted Material 27 | % For Copying permissions see COPYING.m 28 | % Comments? e-mail wavelab@stat.stanford.edu 29 | -------------------------------------------------------------------------------- /Workouts/Toons/toon0513.m: -------------------------------------------------------------------------------- 1 | % toon0513 -- Lincoln Refinement Scheme 2 | % 3 | % Thinking of the picture in toon0512 as a 128*128 wavelet transform 4 | % of an image, undo the transform to extend the original 32*32 image 5 | % into one of 128*128. 6 | % 7 | L =2; 8 | D =2; 9 | Fil = MakeAIFilter(2); 10 | Efil = MakeAIBdryFilter(2); 11 | DandyAbe = AIRefine2d(CrudeAbe,L,D,Fil,Efil); 12 | % 13 | image(DandyAbe); 14 | axis('image') 15 | colormap(gray(32)); 16 | title('Extension to 128*128 in Original Domain'); 17 | 18 | 19 | 20 | 21 | % 22 | % Part of Wavelab Version 850 23 | % Built Tue Jan 3 13:20:43 EST 2006 24 | % This is Copyrighted Material 25 | % For Copying permissions see COPYING.m 26 | % Comments? e-mail wavelab@stat.stanford.edu 27 | -------------------------------------------------------------------------------- /Books/WaveTour/WTCh06/ConjGrad.m: -------------------------------------------------------------------------------- 1 | function [fnew,pnew,rnew,Lp] = ConjGrad(f,p,pold,r,u,J0,Lpold); 2 | 3 | %Lp = L(u,FWT_Dyad(p,J0)); 4 | Lp = L(u.*FWT_ATrou(p,J0)); 5 | lambda = (r'*p) / (p'*Lp); 6 | fnew = f + lambda * p; 7 | rnew = r - lambda * Lp; 8 | pnew = Lp - (Lp'*Lp) / (p'*Lp) * p; 9 | if ~(pold == 0), 10 | pnew = pnew - (Lp'*Lpold) / (pold'*Lpold) * pold; 11 | end 12 | 13 | % Written by Maureen Clerc and Jerome Kalifa, 1997 14 | % clerc@cmapx.polytechnique.fr, kalifa@cmapx.polytechnique.fr 15 | 16 | 17 | 18 | 19 | 20 | % 21 | % Part of Wavelab Version 850 22 | % Built Tue Jan 3 13:20:39 EST 2006 23 | % This is Copyrighted Material 24 | % For Copying permissions see COPYING.m 25 | % Comments? e-mail wavelab@stat.stanford.edu 26 | -------------------------------------------------------------------------------- /Invariant/IWT_Stat.m: -------------------------------------------------------------------------------- 1 | function x = IWT_Stat(StatWT,qmf) 2 | % IWT_Stat -- Invert Stationary Wavelet Transform 3 | % Usage 4 | % x = IWT_Stat(StatWT,L,qmf) 5 | % Inputs 6 | % StatWT stationary wavelet transform table 7 | % qmf quadrature mirror filter 8 | % Outputs 9 | % x 1-d signal reconstructed from StatWT 10 | % 11 | % See Also 12 | % FWT_Stat 13 | % 14 | TIWT = Stat2TI(StatWT); 15 | x = IWT_TI(TIWT,qmf); 16 | 17 | % 18 | % Copyright (c) 1994. David Donoho and Shaobing Chen 19 | % 20 | 21 | 22 | 23 | 24 | % 25 | % Part of Wavelab Version 850 26 | % Built Tue Jan 3 13:20:40 EST 2006 27 | % This is Copyrighted Material 28 | % For Copying permissions see COPYING.m 29 | % Comments? e-mail wavelab@stat.stanford.edu 30 | -------------------------------------------------------------------------------- /Orthogonal/DownDyadHi.m: -------------------------------------------------------------------------------- 1 | function d = DownDyadHi(x,qmf) 2 | % DownDyadHi -- Hi-Pass Downsampling operator (periodized) 3 | % Usage 4 | % d = DownDyadHi(x,f) 5 | % Inputs 6 | % x 1-d signal at fine scale 7 | % f filter 8 | % Outputs 9 | % y 1-d signal at coarse scale 10 | % 11 | % See Also 12 | % DownDyadLo, UpDyadHi, UpDyadLo, FWT_PO, iconv 13 | % 14 | d = iconv( MirrorFilt(qmf),lshift(x)); 15 | n = length(d); 16 | d = d(1:2:(n-1)); 17 | 18 | % 19 | % Copyright (c) 1993. Iain M. Johnstone 20 | % 21 | 22 | 23 | 24 | % 25 | % Part of Wavelab Version 850 26 | % Built Tue Jan 3 13:20:40 EST 2006 27 | % This is Copyrighted Material 28 | % For Copying permissions see COPYING.m 29 | % Comments? e-mail wavelab@stat.stanford.edu 30 | -------------------------------------------------------------------------------- /Workouts/Toons/toon0232.m: -------------------------------------------------------------------------------- 1 | % toon0232 -- Visualize Wavelet Xform 2 | % 3 | % Here we display a 2-d image (a box with an X in it) 4 | % and its 2-d wavelet transform. 5 | % 6 | box = Make2dSignal('BoxWithCross', 128); 7 | % 8 | clf; subplot(121); 9 | AutoImage(box); 10 | title('X Marks the Spot'); 11 | % 12 | % 13 | Q = MakeONFilter('Coiflet',2); 14 | wbox = FWT2_PO(box,3,Q); 15 | % 16 | % 17 | subplot(122); 18 | zmat = sqrt(abs(wbox)); 19 | zmat = 256-3.8*zmat; 20 | AutoImage(zmat); 21 | title('WT2[X Marks the Spot]'); 22 | 23 | 24 | 25 | % 26 | % Part of Wavelab Version 850 27 | % Built Tue Jan 3 13:20:43 EST 2006 28 | % This is Copyrighted Material 29 | % For Copying permissions see COPYING.m 30 | % Comments? e-mail wavelab@stat.stanford.edu 31 | -------------------------------------------------------------------------------- /Continuous/CalcCWTNorms.m: -------------------------------------------------------------------------------- 1 | function norms = CalcCWTNorms(cw,p) 2 | % CalcCWTNorms -- Calculate Norm at each Scale of CWT 3 | % Usage 4 | % norms = CalcCWTNorms(cw,p); 5 | % Inputs 6 | % cw CWT array 7 | % p optional, default = Inf 8 | % Outputs 9 | % norms vector of p-norms scale by scale 10 | % 11 | 12 | if nargin < 2, 13 | p = inf; 14 | end 15 | 16 | sz = size(cw); 17 | nscale = sz(2); 18 | norms = zeros(1,nscale); 19 | 20 | for k=1:nscale, 21 | norms(k) = norm(cw(:,k),p); 22 | end 23 | 24 | 25 | 26 | 27 | % 28 | % Part of Wavelab Version 850 29 | % Built Tue Jan 3 13:20:39 EST 2006 30 | % This is Copyrighted Material 31 | % For Copying permissions see COPYING.m 32 | % Comments? e-mail wavelab@stat.stanford.edu 33 | -------------------------------------------------------------------------------- /Orthogonal/MirrorFilt.m: -------------------------------------------------------------------------------- 1 | function y = MirrorFilt(x) 2 | % MirrorFilt -- Apply (-1)^t modulation 3 | % Usage 4 | % h = MirrorFilt(l) 5 | % Inputs 6 | % l 1-d signal 7 | % Outputs 8 | % h 1-d signal with DC frequency content shifted 9 | % to Nyquist frequency 10 | % 11 | % Description 12 | % h(t) = (-1)^(t-1) * x(t), 1 <= t <= length(x) 13 | % 14 | % See Also 15 | % DyadDownHi 16 | % 17 | 18 | y = -( (-1).^(1:length(x)) ).*x; 19 | 20 | % 21 | % Copyright (c) 1993. Iain M. Johnstone 22 | % 23 | 24 | 25 | 26 | 27 | % 28 | % Part of Wavelab Version 850 29 | % Built Tue Jan 3 13:20:40 EST 2006 30 | % This is Copyrighted Material 31 | % For Copying permissions see COPYING.m 32 | % Comments? e-mail wavelab@stat.stanford.edu 33 | -------------------------------------------------------------------------------- /Papers/SpinCycle/FourierDeNoise.m: -------------------------------------------------------------------------------- 1 | function recon = FourierDeNoise(y) 2 | % FourierDeNoise -- Hard thresholding in Fourier Domain 3 | % Usage 4 | % recon = FourierDeNoise(y) 5 | % Inputs 6 | % y 1-d complex valued signal; 7 | % noise should be complex-valued white noise 8 | % Outputs 9 | % recon reconstruction after sqrt(2 log(n)) thresholding 10 | % 11 | n = length(y); 12 | fy = fft(y); 13 | af = abs(fy); 14 | ty = af > (sqrt(2 * log(n)) .* sqrt(n)); 15 | cy = fy .* ty; 16 | recon = ifft(cy); 17 | 18 | 19 | 20 | 21 | % 22 | % Part of Wavelab Version 850 23 | % Built Tue Jan 3 13:20:42 EST 2006 24 | % This is Copyrighted Material 25 | % For Copying permissions see COPYING.m 26 | % Comments? e-mail wavelab@stat.stanford.edu 27 | -------------------------------------------------------------------------------- /MEXSource/downlo.c: -------------------------------------------------------------------------------- 1 | #include "wavelab.h" 2 | 3 | void downlo(x,n,lpf,m,y) 4 | DOUBLE x[],lpf[],y[]; 5 | int n,m; 6 | { 7 | int n2, mlo, mhi, i, h, j; 8 | DOUBLE s; 9 | /*lowpass version */ 10 | n2 = n/2; 11 | mlo = m /2; 12 | mhi = n2-mlo; 13 | if(2*mhi + (m-1) >= n) --mhi; 14 | if(mhi < 0) mhi = -1; 15 | for( i= 0; i<=mhi; i++){ 16 | s = 0.; 17 | for( h=0; h < m; h++) 18 | s += lpf[h]*x[2*i+h]; 19 | y[i] = s; 20 | } 21 | 22 | /* fix up edge values */ 23 | for( i= mhi+1; i= n) j -= n; 28 | s += lpf[h]*x[j]; 29 | j++; 30 | } 31 | y[i] = s; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Workouts/Toons/toon0552.m: -------------------------------------------------------------------------------- 1 | % toon0552 -- Noisy Versions of Four Signals 2 | % 3 | % The four objects of Figure 1 with white noise superposed. 4 | % The noise is normally distributed with variance 1. 5 | % 6 | global yblocks ybumps yheavi yDoppler t 7 | % 8 | clf; 9 | versaplot(221,t,yblocks, [],' 2 (a) Noisy Blocks ' ,[],[]) 10 | versaplot(222,t,ybumps, [],' 2 (b) Noisy Bumps ' ,[],[]) 11 | versaplot(223,t,yheavi, [],' 2 (c) Noisy HeaviSine ',[],[]) 12 | versaplot(224,t,yDoppler,[],' 2 (d) Noisy Doppler ' ,[],[]) 13 | 14 | 15 | 16 | 17 | 18 | 19 | % 20 | % Part of Wavelab Version 850 21 | % Built Tue Jan 3 13:20:43 EST 2006 22 | % This is Copyrighted Material 23 | % For Copying permissions see COPYING.m 24 | % Comments? e-mail wavelab@stat.stanford.edu 25 | -------------------------------------------------------------------------------- /Continuous/CalcCWTPars.m: -------------------------------------------------------------------------------- 1 | function [n,nscale,nvoice,noctave] = CalcCWTPars(sz) 2 | % CalcCWTPars -- Calculate Underlying Parameters of CWT Structure 3 | % Usage 4 | % [n,nscale,nvoice,noctave] = CalcCWTPars(sz) 5 | % Inputs 6 | % sz size of CWT array 7 | % Outputs 8 | % n signal length 9 | % nscale number of scales 10 | % nvoice number of voices 11 | % noctave number of octaves 12 | % 13 | 14 | n = sz(1); nscale = sz(2); 15 | noctave = floor(log2(n))-5; 16 | nvoice = nscale ./ noctave; 17 | 18 | 19 | 20 | 21 | 22 | % 23 | % Part of Wavelab Version 850 24 | % Built Tue Jan 3 13:20:39 EST 2006 25 | % This is Copyrighted Material 26 | % For Copying permissions see COPYING.m 27 | % Comments? e-mail wavelab@stat.stanford.edu 28 | -------------------------------------------------------------------------------- /Papers/SpinCycle/cspinf02.m: -------------------------------------------------------------------------------- 1 | % cspinf02 -- Noisy Versions of Four Signals 2 | % 3 | % The four objects of Figure 1 with white noise superposed. 4 | % The noise is normally distributed with variance 1. 5 | % 6 | % 7 | global yblocks ybumps yheavi yDoppler t 8 | % 9 | % clf; 10 | versaplot(221,t,yblocks, [],' 2 (a) Noisy Blocks ' ,[],[]) 11 | versaplot(222,t,ybumps, [],' 2 (b) Noisy Bumps ' ,[],[]) 12 | versaplot(223,t,yheavi, [],' 2 (c) Noisy HeaviSine ',[],[]) 13 | versaplot(224,t,yDoppler,[],' 2 (d) Noisy Doppler ' ,[],[]) 14 | 15 | 16 | 17 | 18 | 19 | % 20 | % Part of Wavelab Version 850 21 | % Built Tue Jan 3 13:20:42 EST 2006 22 | % This is Copyrighted Material 23 | % For Copying permissions see COPYING.m 24 | % Comments? e-mail wavelab@stat.stanford.edu 25 | -------------------------------------------------------------------------------- /Papers/Tour/toufig02.m: -------------------------------------------------------------------------------- 1 | % toufig02 -- Tour Figure 02: Noisy Versions of Four Signals 2 | % 3 | % The four objects of Figure 1 with white noise superposed. 4 | % The noise is normally distributed with variance 1. 5 | % 6 | % 7 | global yblocks ybumps yheavi yDoppler t 8 | % 9 | % clf; 10 | versaplot(221,t,yblocks, [],' 2 (a) Noisy Blocks ' ,[],[]) 11 | versaplot(222,t,ybumps, [],' 2 (b) Noisy Bumps ' ,[],[]) 12 | versaplot(223,t,yheavi, [],' 2 (c) Noisy HeaviSine ',[],[]) 13 | versaplot(224,t,yDoppler,[],' 2 (d) Noisy Doppler ' ,[],[]) 14 | 15 | 16 | 17 | 18 | % 19 | % Part of Wavelab Version 850 20 | % Built Tue Jan 3 13:20:42 EST 2006 21 | % This is Copyrighted Material 22 | % For Copying permissions see COPYING.m 23 | % Comments? e-mail wavelab@stat.stanford.edu 24 | -------------------------------------------------------------------------------- /Utilities/GrayImage.m: -------------------------------------------------------------------------------- 1 | function GrayImage(img,ngray) 2 | % GrayImage -- Standard gray-scale image display 3 | % Usage 4 | % GrayImage(img,ngray) 5 | % Inputs 6 | % img a 2-d image, n by n 7 | % ngray optional. number of gray levels in colormap, default 255 8 | % 9 | % Side Effects 10 | % A gray scale presentation of img 11 | % 12 | if nargin < 2, 13 | ngray =255; 14 | end 15 | % 16 | % clg; 17 | image(img); 18 | axis('image'); 19 | colormap(gray(ngray)); 20 | 21 | 22 | 23 | 24 | 25 | % 26 | % Part of Wavelab Version 850 27 | % Built Tue Jan 3 13:20:43 EST 2006 28 | % This is Copyrighted Material 29 | % For Copying permissions see COPYING.m 30 | % Comments? e-mail wavelab@stat.stanford.edu 31 | -------------------------------------------------------------------------------- /Workouts/Toons/toon0543.m: -------------------------------------------------------------------------------- 1 | % toon0543 -- Data Compression of Ingrid Daubechies 2 | % 3 | % Investigate Sparsity in the Wavelet Transform of Daubechies. 4 | % 5 | wcsort = sort(abs(wingrid(:))); 6 | wcerr = cumsum(wcsort.^2); 7 | wcerr = flipud(wcerr); 8 | % 9 | % Sparsify Image 10 | % 11 | wthresh = wcsort(floor(.95*65536)); 12 | cw_ingrid = wingrid .* (abs(wingrid) > wthresh); 13 | [i,j,s] = find(cw_ingrid); 14 | sp_ingrid = sparse(i,j,s,256,256); 15 | spy(sp_ingrid) 16 | title('Nonzero Pattern in Sparsification of WT[Daubechies]') 17 | 18 | 19 | 20 | 21 | % 22 | % Part of Wavelab Version 850 23 | % Built Tue Jan 3 13:20:43 EST 2006 24 | % This is Copyrighted Material 25 | % For Copying permissions see COPYING.m 26 | % Comments? e-mail wavelab@stat.stanford.edu 27 | -------------------------------------------------------------------------------- /Papers/MinEntSeg/MESInit.m: -------------------------------------------------------------------------------- 1 | function MESInit 2 | % MESInit -- Setup global variables for MES Demo 3 | % 4 | global n x id 5 | global Ramp Cusp Noise HeaviSine 6 | global E2 F2 7 | % 8 | if isempty(n), 9 | n = 1024; 10 | end 11 | x = (0:(n-1)) ./ n; 12 | % 13 | % 14 | 15 | [Ramp,x,id] = MakeMESTestSig('Ramp',n); 16 | Cusp = MakeMESTestSig('Cusp',n); 17 | Noise = MakeMESTestSig('Noise',n); 18 | HeaviSine = MakeMESTestSig('HeaviSine',n); 19 | % 20 | E2 = MakeAIBdryFilter(2); 21 | F2 = MakeAIFilter(2); 22 | 23 | 24 | 25 | 26 | 27 | 28 | % 29 | % Part of Wavelab Version 850 30 | % Built Tue Jan 3 13:20:41 EST 2006 31 | % This is Copyrighted Material 32 | % For Copying permissions see COPYING.m 33 | % Comments? e-mail wavelab@stat.stanford.edu 34 | -------------------------------------------------------------------------------- /Papers/Adapt/AdaptCleanup.m: -------------------------------------------------------------------------------- 1 | function AdaptCleanup % AdaptCleanup -- Clean up Adapt global variables % Usage % AdaptCleanup % clear global ADAPTFIGNUM Spline_Data xheavi clear global Blocks Spline_Pnty yDoppler clear global Bumps yblocks clear global Doppler qmf ybumps clear global HeaviSine t yheavi clear global L xDoppler rho clear global xblocks N xbumps 2 | 3 | % 4 | % Part of Wavelab Version 850 5 | % Built Tue Jan 3 13:20:41 EST 2006 6 | % This is Copyrighted Material 7 | % For Copying permissions see COPYING.m 8 | % Comments? e-mail wavelab@stat.stanford.edu 9 | -------------------------------------------------------------------------------- /Utilities/getlength.m: -------------------------------------------------------------------------------- 1 | % method of class @signal 2 | % 3 | % INPUT VALUES: 4 | % 5 | % RETURN VALUE: 6 | % 7 | % 8 | % (c) 2003, University of Cambridge, Medical Research Council 9 | % Stefan Bleeck (stefan@bleeck.de) 10 | % http://www.mrc-cbu.cam.ac.uk/cnbh/aimmanual 11 | % $Date: 2003/01/17 16:57:43 $ 12 | % $Revision: 1.3 $ 13 | 14 | function res =getlength(sig) 15 | % returns the length in seconds 16 | 17 | nr=size(sig.werte,1); 18 | % r1=bin2time(sig,0); 19 | % r2=bin2time(sig,nr); 20 | % res=r2-r1; 21 | 22 | sr=getsr(sig); 23 | res=nr/sr; 24 | 25 | 26 | 27 | % 28 | % Part of Wavelab Version 850 29 | % Built Tue Jan 3 13:20:43 EST 2006 30 | % This is Copyrighted Material 31 | % For Copying permissions see COPYING.m 32 | % Comments? e-mail wavelab@stat.stanford.edu 33 | -------------------------------------------------------------------------------- /Papers/RiskAnalysis/mtitle.m: -------------------------------------------------------------------------------- 1 | function [ax,h] = mtitle(text) 2 | % 3 | %Centers a title over a group of subplots. 4 | %Returns a handle to the title and the handle to an axis. 5 | % [ax,h]=mtitle(text) 6 | % returns handles to both the axis and the title. 7 | % ax=mtitle(text) 8 | % returns a handle to the axis only. 9 | 10 | ax=axes('Units','Normal','Position',[.1 .1 .85 .85],'Visible','off'); 11 | set(get(ax,'Title'),'Visible','on') 12 | title(text,'FontSize',18); 13 | if (nargout < 2) 14 | return 15 | end 16 | h=get(ax,'Title'); 17 | 18 | 19 | 20 | 21 | 22 | % 23 | % Part of Wavelab Version 850 24 | % Built Tue Jan 3 13:20:42 EST 2006 25 | % This is Copyrighted Material 26 | % For Copying permissions see COPYING.m 27 | % Comments? e-mail wavelab@stat.stanford.edu 28 | -------------------------------------------------------------------------------- /Papers/Tour/toufig11.m: -------------------------------------------------------------------------------- 1 | % toufig11 -- Tour Figure 11: Noisy Differentiation in Wavelet Domain 2 | % 3 | % Here the procedure of Figure 16 is displayed in the Wavelet domain. 4 | % 5 | % The noise in the naive inversion grows rapidly in size 6 | % as we move to finer resolutions. 7 | % 8 | global w wb ws 9 | % 10 | % clf; 11 | subplot(221); PlotWaveCoeff(wb,5,0.); title('11 (a) WT[Object]') 12 | subplot(222); PlotWaveCoeff(w,5,0.); title('11 (b) WT[ Naive Reconstruction ]') 13 | subplot(223); PlotWaveCoeff(ws,5,0.); title('11 (c) WT[ WVD Reconstruction ]') 14 | 15 | 16 | 17 | 18 | % 19 | % Part of Wavelab Version 850 20 | % Built Tue Jan 3 13:20:42 EST 2006 21 | % This is Copyrighted Material 22 | % For Copying permissions see COPYING.m 23 | % Comments? e-mail wavelab@stat.stanford.edu 24 | -------------------------------------------------------------------------------- /Pursuit/ix2pkt.m: -------------------------------------------------------------------------------- 1 | function [d,b,k] = ix2pkt(ix,D,n) 2 | % ix2pkt -- Convert linear index to packet table index 3 | % Usage 4 | % [d,b,k] = ix2pkt(ix,D,n) 5 | % Inputs 6 | % ix linear position in packet table array 7 | % D,n shape of packet table 8 | % Outputs 9 | % d,b,k 1-d packet table index 10 | % 11 | % See Also 12 | % pkt2ix, packet 13 | % 14 | 15 | d = floor((ix-1)/n); 16 | row = rem(ix-1,n); 17 | nc = n/2^d; 18 | b = floor(row/nc); 19 | k = row - b*nc ; 20 | 21 | % 22 | % Copyright (c) 1993. David L. Donoho 23 | % 24 | 25 | 26 | 27 | % 28 | % Part of Wavelab Version 850 29 | % Built Tue Jan 3 13:20:43 EST 2006 30 | % This is Copyrighted Material 31 | % For Copying permissions see COPYING.m 32 | % Comments? e-mail wavelab@stat.stanford.edu 33 | -------------------------------------------------------------------------------- /Papers/Ideal/IMJPlotWaveCoeff.m: -------------------------------------------------------------------------------- 1 | function IMJPlotWaveCoeff(wavecoef,L,scal) 2 | % IMJPlotWaveCoeff -- Wavelet Coeffts Plot: IMJ version with changed axis labelling 3 | [n,J] = dyadlength(wavecoef); 4 | if scal==0, 5 | seg = (1+ 2^(L)):(n); 6 | scal = .75 ./ max(abs(wavecoef(seg))); 7 | end 8 | LockAxes([0 1 (L-1) J]); 9 | for j=(J-1):(-1):L 10 | tj = (.5:(2^(j)-.5))./2^(j) ; 11 | PlotSpikes(j,tj,(wavecoef(dyad(j)).*scal)); 12 | end 13 | %xlabel('k, spatial position'); ylabel('j, resolution scale'); 14 | %title('Wavelet Decomposition'); 15 | UnlockAxes; 16 | 17 | 18 | 19 | 20 | % 21 | % Part of Wavelab Version 850 22 | % Built Tue Jan 3 13:20:41 EST 2006 23 | % This is Copyrighted Material 24 | % For Copying permissions see COPYING.m 25 | % Comments? e-mail wavelab@stat.stanford.edu 26 | -------------------------------------------------------------------------------- /Papers/ShortCourse/scfig05.m: -------------------------------------------------------------------------------- 1 | % scfig05 -- Short Course 05: Noisy Versions of Four Signals 2 | % 3 | % The four objects of Figure 4 with white noise superposed. 4 | % The noise is normally distributed with variance 1. 5 | % 6 | % 7 | global yblocks ybumps yheavi yDoppler t 8 | % 9 | % clf; 10 | versaplot(221,t,yblocks, [],' 5 (a) Noisy Blocks ' ,[],[]) 11 | versaplot(222,t,ybumps, [],' 5 (b) Noisy Bumps ' ,[],[]) 12 | versaplot(223,t,yheavi, [],' 5 (c) Noisy HeaviSine ',[],[]) 13 | versaplot(224,t,yDoppler,[],' 5 (d) Noisy Doppler ' ,[],[]) 14 | 15 | 16 | 17 | 18 | 19 | % 20 | % Part of Wavelab Version 850 21 | % Built Tue Jan 3 13:20:42 EST 2006 22 | % This is Copyrighted Material 23 | % For Copying permissions see COPYING.m 24 | % Comments? e-mail wavelab@stat.stanford.edu 25 | -------------------------------------------------------------------------------- /Pursuit/pkt2ix.m: -------------------------------------------------------------------------------- 1 | function [row,ix] = pkt2ix(d,b,k,D,n) 2 | % pkt2ix -- Convert packet table index to linear index 3 | % Usage 4 | % [row,ix] = pkt2ix(d,b,k,D,n) 5 | % Inputs 6 | % d,b,k 1-d packet table index 7 | % D,n shape of packet table 8 | % Outputs 9 | % ix linear position in packet table 10 | % row row in packet table 11 | % 12 | % See Also 13 | % ix2pkt, packet 14 | % 15 | 16 | nc = n/2^d; 17 | row = 1 + b*nc + k; 18 | ix = row + d*n ; 19 | 20 | % 21 | % Copyright (c) 1993. David L. Donoho 22 | % 23 | 24 | 25 | 26 | 27 | 28 | % 29 | % Part of Wavelab Version 850 30 | % Built Tue Jan 3 13:20:43 EST 2006 31 | % This is Copyrighted Material 32 | % For Copying permissions see COPYING.m 33 | % Comments? e-mail wavelab@stat.stanford.edu 34 | -------------------------------------------------------------------------------- /Papers/MinEntSeg/MakeBumps.m: -------------------------------------------------------------------------------- 1 | function MakeBumps 2 | % MakeBumps -- Make Bumps Object for Segmentation Pursuit 3 | % Usage 4 | % MakeBumps 5 | % 6 | 7 | global n 8 | global ord 9 | global pos Bumps 10 | % 11 | n = 2048; 12 | ord = (0:(n-1))./n; 13 | pos = [ .2 .23 .25 .33 .35 .50 .54 .65 .66 .68 .71]; 14 | hgt = [ 4 5 3 4 5 4.2 2.1 4.3 3.1 5.1 4.2]; 15 | wth = [.005 .005 .006 .01 .01 .03 .01 .01 .005 .008 .005]; 16 | Bumps = 0.*ord; 17 | for j =1:length(pos) 18 | Bumps = Bumps + hgt(j)./( 1 + abs((ord - pos(j))./wth(j))).^4; 19 | end 20 | 21 | 22 | 23 | 24 | % 25 | % Part of Wavelab Version 850 26 | % Built Tue Jan 3 13:20:41 EST 2006 27 | % This is Copyrighted Material 28 | % For Copying permissions see COPYING.m 29 | % Comments? e-mail wavelab@stat.stanford.edu 30 | -------------------------------------------------------------------------------- /Books/WaveTour/WTCh06/DownShift.m: -------------------------------------------------------------------------------- 1 | function outimg = DownShift(matrix) 2 | % DownShift -- Shift matrix down by one, move bottom line to the top. 3 | % Usage 4 | % outimg = DownShift(matrix); 5 | % Inputs 6 | % matrix a matrix 7 | % Outputs 8 | % outimg output image 9 | % Examples 10 | % Test_DownShift.m 11 | % See Also 12 | % aconv2 13 | 14 | [rows cols] = size(matrix); 15 | outimg = zeros(rows, cols); 16 | outimg(1,:) = matrix(rows,:); 17 | outimg(2:rows,:) = matrix(1:(rows-1),:); 18 | 19 | % 20 | % Copyright (c) 1996. Xiaoming Huo 21 | % 22 | 23 | 24 | 25 | 26 | % 27 | % Part of Wavelab Version 850 28 | % Built Tue Jan 3 13:20:39 EST 2006 29 | % This is Copyrighted Material 30 | % For Copying permissions see COPYING.m 31 | % Comments? e-mail wavelab@stat.stanford.edu 32 | -------------------------------------------------------------------------------- /Browsers/One-D/update_plot.m: -------------------------------------------------------------------------------- 1 | function update_plot(frac) 2 | % update_plot -- Called by WLBrowser 3 | % Usage 4 | % update_plot(frac) 5 | % 6 | global PlotFig HC n signal_name 7 | tmp = get(PlotFig,'UserData'); 8 | %n 9 | %disp(tmp(1:10)) 10 | s = length(tmp); 11 | x = tmp(4:s); 12 | m = round(frac*n); 13 | panel = tmp(3); 14 | lo = m - panel + 1; 15 | hi = m + panel ; 16 | lo = max(1,min(lo,n-2*panel)); 17 | hi = min(n,max(hi,2*panel+1)); 18 | %[lo hi panel] 19 | r = lo:hi; 20 | plot(r,x(r)); 21 | axis([lo,hi,tmp(1),tmp(2)]); 22 | grid 23 | title(signal_name); 24 | 25 | 26 | 27 | 28 | % 29 | % Part of Wavelab Version 850 30 | % Built Tue Jan 3 13:20:39 EST 2006 31 | % This is Copyrighted Material 32 | % For Copying permissions see COPYING.m 33 | % Comments? e-mail wavelab@stat.stanford.edu 34 | -------------------------------------------------------------------------------- /FastAlgorithms/ndyad.m: -------------------------------------------------------------------------------- 1 | function ix = ndyad(j,gender) 2 | % ndyad -- Index dyad of nonstandard wavelet transform 3 | % Usage 4 | % ix = ndyad(j,gender) 5 | % Inputs 6 | % j dyad index 7 | % gender (1 = female, 0 = male) 8 | % Outputs 9 | % ix vector of subscripts of all coefficients 10 | % at j-th level attached to wavelets of indicated gender 11 | % 12 | % See Also 13 | % FNWT_PO, INWT_PO, dyad 14 | % 15 | if gender, 16 | ix = (2^(j+1)+ 2^j+1):2^(j+2); 17 | else 18 | ix = (2^(j+1)+1):(2^(j+1)+ 2^j); 19 | end 20 | 21 | 22 | 23 | 24 | 25 | % 26 | % Part of Wavelab Version 850 27 | % Built Tue Jan 3 13:20:40 EST 2006 28 | % This is Copyrighted Material 29 | % For Copying permissions see COPYING.m 30 | % Comments? e-mail wavelab@stat.stanford.edu 31 | -------------------------------------------------------------------------------- /Papers/Ideal/idfig03.m: -------------------------------------------------------------------------------- 1 | % idfig03 -- Ideal Figure 03: Noisy Versions of Four Signals 2 | % 3 | % The four objects of Figure 1 with white noise superposed. 4 | % The noise is normally distributed with variance 1. 5 | % 6 | % 7 | 8 | global yblocks ybumps yheavi yDoppler 9 | global t 10 | % 11 | %clf; 12 | versaplot(221,t,yblocks, [],' 3 (a) Noisy Blocks ' ,[],[]) 13 | versaplot(222,t,ybumps, [],' 3 (b) Noisy Bumps ' ,[],[]) 14 | versaplot(223,t,yheavi, [],' 3 (c) Noisy HeaviSine ',[],[]) 15 | versaplot(224,t,yDoppler,[],' 3 (d) Noisy Doppler ' ,[],[]) 16 | 17 | 18 | 19 | 20 | 21 | % 22 | % Part of Wavelab Version 850 23 | % Built Tue Jan 3 13:20:41 EST 2006 24 | % This is Copyrighted Material 25 | % For Copying permissions see COPYING.m 26 | % Comments? e-mail wavelab@stat.stanford.edu 27 | -------------------------------------------------------------------------------- /Books/WaveTour/WTCh08/PlotSquareWPPlane.m: -------------------------------------------------------------------------------- 1 | function PlotSquareWPPlane(pkt) 2 | % function PlotSquareWPPlane(pkt) 3 | % 4 | % Time-frequency representation of wavelet decomposition 5 | % 6 | % See also : wavelet2packet 7 | % 8 | [n,L] = size(pkt); 9 | L = L-1; 10 | v = 1; 11 | basis = zeros(1,2*n-1); 12 | for d = 0:L-5, 13 | for k = 0:2^d-1, 14 | basis(node(d,k)) = 1; 15 | end 16 | end 17 | ImagePhasePlane('WP',basis,pkt); 18 | 19 | % Written by Maureen Clerc and Jerome Kalifa, 1997 20 | % clerc@cmapx.polytechnique.fr, kalifa@cmapx.polytechnique.fr 21 | 22 | 23 | 24 | 25 | 26 | % 27 | % Part of Wavelab Version 850 28 | % Built Tue Jan 3 13:20:39 EST 2006 29 | % This is Copyrighted Material 30 | % For Copying permissions see COPYING.m 31 | % Comments? e-mail wavelab@stat.stanford.edu 32 | -------------------------------------------------------------------------------- /DeNoising/Wiener.m: -------------------------------------------------------------------------------- 1 | function out = Wiener(Noisy,in,sigma) 2 | % Wiener -- Wiener filter. 3 | % Usage 4 | % out = wiener(Noisy,in,sigma) 5 | % Inputs 6 | % Noisy Noisy input signal. 7 | % in Original signal. 8 | % sigma s.d of the additve GWN 9 | % Outputs 10 | % out Restored image. 11 | % 12 | 13 | Y=fft(in); 14 | FN=fft(Noisy); 15 | n=length(in); 16 | PY=abs(Y.*Y); 17 | H=PY./(PY+ n*sigma^2); 18 | FN=FN.*H; 19 | out=real(ifft(FN)); 20 | 21 | % Written by Maureen Clerc and Jerome Kalifa, 1997 22 | % clerc@cmapx.polytechnique.fr, kalifa@cmapx.polytechnique.fr 23 | 24 | 25 | 26 | 27 | % 28 | % Part of Wavelab Version 850 29 | % Built Tue Jan 3 13:20:40 EST 2006 30 | % This is Copyrighted Material 31 | % For Copying permissions see COPYING.m 32 | % Comments? e-mail wavelab@stat.stanford.edu 33 | -------------------------------------------------------------------------------- /Papers/Tour/LogoGram.m: -------------------------------------------------------------------------------- 1 | function [t,g] = LogoGram(ser) 2 | % LogoGram -- Time Series Spectrum Estimation 3 | % Usage 4 | % [t,g] = LogoGram(ser) 5 | % Inputs 6 | % ser zero-mean time series, dyadic length 7 | % Outputs 8 | % t ordinate of logogram 9 | % g abscissa of logogram 10 | % 11 | n = length(ser); 12 | Ij = abs(fft(ser)).^2 ./ ( n); 13 | Yj = log(Ij) + .57721; 14 | Yj(1) = Yj(1) - .57721 + (log(2) + .57721)/pi ; 15 | Yj(n/2+1) = Yj(n/2+1) - .57721 + (log(2) + .57721)/pi ; 16 | g = Yj .* sqrt(6)/pi; 17 | t = 2 * pi * (0: (n-1)) ./ n; 18 | 19 | 20 | 21 | 22 | 23 | % 24 | % Part of Wavelab Version 850 25 | % Built Tue Jan 3 13:20:42 EST 2006 26 | % This is Copyrighted Material 27 | % For Copying permissions see COPYING.m 28 | % Comments? e-mail wavelab@stat.stanford.edu 29 | -------------------------------------------------------------------------------- /Biorthogonal/DownDyadLo_PBS.m: -------------------------------------------------------------------------------- 1 | function d = DownDyadLo_PBS(x,qmf) 2 | % DownDyadLo_PBS -- Lo-Pass Downsampling operator (periodized,symmetric) 3 | % Usage 4 | % d = DownDyadLo_PBS(x,sf) 5 | % Inputs 6 | % x 1-d signal at fine scale 7 | % sf symmetric filter 8 | % Outputs 9 | % y 1-d signal at coarse scale 10 | % 11 | % See Also 12 | % DownDyadHi_PBS, UpDyadHi_PBS, UpDyadLo_PBS, FWT_PBSi, symm_aconv 13 | % 14 | d = symm_aconv(qmf,x); 15 | n = length(d); 16 | d = d(1:2:(n-1)); 17 | 18 | % 19 | % Copyright (c) 1995. David L. Donoho 20 | % 21 | 22 | 23 | 24 | 25 | 26 | % 27 | % Part of Wavelab Version 850 28 | % Built Tue Jan 3 13:20:38 EST 2006 29 | % This is Copyrighted Material 30 | % For Copying permissions see COPYING.m 31 | % Comments? e-mail wavelab@stat.stanford.edu 32 | -------------------------------------------------------------------------------- /Books/WaveTour/WTCh06/RightShift.m: -------------------------------------------------------------------------------- 1 | function outmatrix= RightShift(inmatrix) 2 | % RightShift -- Shift right matrix, the last column is moved to the first. 3 | % Usage 4 | % outmatrix= RightShift(inmatrix); 5 | % Inputs 6 | % inmatrix 7 | % Outputs 8 | % outmatrix 9 | % Examples 10 | % Test_RightShift.m 11 | % See Also 12 | % aconv2 13 | 14 | [rows cols] = size(inmatrix); 15 | outmatrix = zeros(rows, cols); 16 | outmatrix(:,1) = inmatrix(:,cols); 17 | outmatrix(:,2:cols) = inmatrix(:,1:(cols-1)); 18 | 19 | % 20 | % Copyright (c) 1996. Xiaoming Huo 21 | % 22 | 23 | 24 | 25 | 26 | % 27 | % Part of Wavelab Version 850 28 | % Built Tue Jan 3 13:20:39 EST 2006 29 | % This is Copyrighted Material 30 | % For Copying permissions see COPYING.m 31 | % Comments? e-mail wavelab@stat.stanford.edu 32 | -------------------------------------------------------------------------------- /Books/WaveTour/WTCh08/PlotMBandPlane.m: -------------------------------------------------------------------------------- 1 | function PlotMBandPlane(pkt) 2 | % function PlotMBandPlane(pkt) 3 | % 4 | % Time-frequency representation of wavelet decomposition 5 | % 6 | % See also : wavelet2packet 7 | % 8 | [n,L] = size(pkt); 9 | L = L-1; 10 | v = 1; 11 | basis = zeros(1,2*n-1); 12 | for d = 0:L-1, 13 | for k = 0:min(2^v-1,2^d-1), 14 | basis(node(d,k)) = 1; 15 | end 16 | end 17 | ImagePhasePlane('WP',basis,pkt); 18 | 19 | 20 | % Written by Maureen Clerc and Jerome Kalifa, 1997 21 | % clerc@cmapx.polytechnique.fr, kalifa@cmapx.polytechnique.fr 22 | 23 | 24 | 25 | 26 | 27 | % 28 | % Part of Wavelab Version 850 29 | % Built Tue Jan 3 13:20:39 EST 2006 30 | % This is Copyrighted Material 31 | % For Copying permissions see COPYING.m 32 | % Comments? e-mail wavelab@stat.stanford.edu 33 | -------------------------------------------------------------------------------- /Documentation/SUPPORT.m: -------------------------------------------------------------------------------- 1 | % SUPPORT -- WaveLab Support 2 | % 3 | % This software has been developed as part of the research 4 | % effort of the authors under various federally supported 5 | % grants. If you find that it does not work correctly, 6 | % please e-mail a notification of your problem to WaveLab. 7 | % Use the format indicated in the file BUGREPORTS.m. 8 | % 9 | % To the extent that we can isolate the problem and develop a 10 | % solution, and to the extent that it fits in with our 11 | % schedule with releasing a new version, we will attempt to 12 | % fix the problem. 13 | % 14 | 15 | 16 | 17 | 18 | % 19 | % Part of Wavelab Version 850 20 | % Built Tue Jan 3 13:20:40 EST 2006 21 | % This is Copyrighted Material 22 | % For Copying permissions see COPYING.m 23 | % Comments? e-mail wavelab@stat.stanford.edu 24 | -------------------------------------------------------------------------------- /Workouts/Contents.m: -------------------------------------------------------------------------------- 1 | % Workouts:Contents v850 -- WaveLab Workouts 2 | % 3 | % This directory contains several subdirectories, each containing 4 | % scripts to "work out" various aspects of wavelet theory and 5 | % applications. They are: 6 | % 7 | % BestOrthoBasis - Workouts for Best Ortho Basis (Coifman-Wickerhauser) 8 | % 9 | % MatchingPursuit - Workouts for Matching Pursuits (Mallat-Zhang) 10 | % 11 | % MultiFractal - Workouts illustrating some aspects 12 | % of the Continuous Wavelet Transform 13 | % 14 | % Toons - "Cartoon Guide to Wavelets" 15 | % 16 | 17 | 18 | % 19 | % Part of Wavelab Version 850 20 | % Built Tue Jan 3 13:20:43 EST 2006 21 | % This is Copyrighted Material 22 | % For Copying permissions see COPYING.m 23 | % Comments? e-mail wavelab@stat.stanford.edu 24 | -------------------------------------------------------------------------------- /Books/WaveTour/WTCh08/PlotSquareCPPlane.m: -------------------------------------------------------------------------------- 1 | function PlotSquareCPPlane(pkt) 2 | % function PlotSquareCPPlane(pkt) 3 | % 4 | % Time-frequency representation of wavelet decomposition 5 | % 6 | % See also : wavelet2packet 7 | % 8 | [n,L] = size(pkt); 9 | L = L-1; 10 | v = 1; 11 | basis = zeros(1,2*n-1); 12 | for d = 0:L-3, 13 | for k = 0:2^d-1, 14 | basis(node(d,k)) = 1; 15 | end 16 | end 17 | ImagePhasePlane('CP',basis,pkt,''); 18 | 19 | 20 | % Written by Maureen Clerc and Jerome Kalifa, 1997 21 | % clerc@cmapx.polytechnique.fr, kalifa@cmapx.polytechnique.fr 22 | 23 | 24 | 25 | 26 | 27 | % 28 | % Part of Wavelab Version 850 29 | % Built Tue Jan 3 13:20:39 EST 2006 30 | % This is Copyrighted Material 31 | % For Copying permissions see COPYING.m 32 | % Comments? e-mail wavelab@stat.stanford.edu 33 | -------------------------------------------------------------------------------- /Papers/Correl/PlotWaveCoeffLocal.m: -------------------------------------------------------------------------------- 1 | function PlotWaveCoeffLocal(wavecoef,L,scal) 2 | % IMJPlotWaveCoeff -- Wavelet Coeffts Plot: IMJ version with 3 | % changed axis labelling 4 | [n,J] = dyadlength(wavecoef); 5 | if scal==0, 6 | seg = (1+ 2^(L)):(n); 7 | scal = .75 ./ max(abs(wavecoef(seg))); 8 | end 9 | LockAxes([0 1 (L-1) J]); 10 | for j=(J-1):(-1):L 11 | tj = (.5:(2^(j)-.5))./2^(j) ; 12 | PlotSpikes(j,tj,(wavecoef(dyad(j)).*scal)); 13 | end 14 | %xlabel('k, spatial position'); ylabel('j, resolution scale'); 15 | %title('Wavelet Decomposition'); 16 | UnlockAxes; 17 | 18 | 19 | 20 | 21 | 22 | % 23 | % Part of Wavelab Version 850 24 | % Built Tue Jan 3 13:20:41 EST 2006 25 | % This is Copyrighted Material 26 | % For Copying permissions see COPYING.m 27 | % Comments? e-mail wavelab@stat.stanford.edu 28 | -------------------------------------------------------------------------------- /Books/WaveTour/WTCh08/wt08fig21.m: -------------------------------------------------------------------------------- 1 | % CAPTION 2 | fprintf('\n'); 3 | disp('Figure 8.21') 4 | disp('The grid shows the support of the square windows') 5 | disp('of a "best" local cosine basis selected in the local cosine quad-tree.') 6 | fprintf('\n'); 7 | 8 | close all; 9 | global WLVERBOSE; 10 | WLVERBOSE='No'; 11 | img = ReadImage('Lenna'); 12 | MaxDepth = 5; 13 | [bb,stats,coef] = CP2Tour(img,MaxDepth,''); 14 | axis('off'); 15 | title(''); 16 | WLVERBOSE='Yes'; 17 | 18 | % Written by Maureen Clerc and Jerome Kalifa, 1997 19 | % clerc@cmapx.polytechnique.fr, kalifa@cmapx.polytechnique.fr 20 | 21 | 22 | 23 | 24 | % 25 | % Part of Wavelab Version 850 26 | % Built Tue Jan 3 13:20:39 EST 2006 27 | % This is Copyrighted Material 28 | % For Copying permissions see COPYING.m 29 | % Comments? e-mail wavelab@stat.stanford.edu 30 | -------------------------------------------------------------------------------- /MEXSource/uphipbs.c: -------------------------------------------------------------------------------- 1 | void uphipbs(x,n,hpf,m,y) 2 | DOUBLE x[],hpf[],y[]; 3 | int n,m; 4 | { 5 | int meven, modd, pos, i, h, j, k; 6 | DOUBLE s; 7 | 8 | /*hipass version */ 9 | meven = (m+1)/2; 10 | modd = m/2; 11 | 12 | k = meven + 2*n - m; 13 | j = (int) (k / 2); 14 | pos = k-2*j; 15 | k = j; 16 | 17 | for(i=0;i= n) j -= n; 22 | while(j < 0) j += n; 23 | s += hpf[2*h+pos]*x[j]; 24 | j++; 25 | } 26 | y[2*i+1] = s; 27 | 28 | s = 0; 29 | j = k; 30 | for(h=0;h= n) j -= n; 32 | while(j < 0) j += n; 33 | s += hpf[2*h+1-pos]*x[j]; 34 | j++; 35 | } 36 | y[2*i] = s; 37 | 38 | k++; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Papers/RiskAnalysis/plot_newdata.m: -------------------------------------------------------------------------------- 1 | function plot_new_data 2 | 3 | global PlotFig x_use HC x_length x_name 4 | figure(PlotFig); 5 | ntmp = zeros(1,x_length+3); 6 | ntmp(1) = min(min(x_use)); 7 | ntmp(2) = max(max(x_use)); 8 | ntmp(3) = x_length; 9 | ntmp(4:(x_length+3)) = x_use(:); 10 | set(PlotFig,'UserData',ntmp); 11 | HC = ... 12 | uicontrol('style','slider','units','normal','pos',[.05,.05,.9,.05],... 13 | 'min',0,'max',1,'value',.5,... 14 | 'call','do_button(''slider'');'); 15 | redo_plot(get(HC,'value')); 16 | set(PlotFig,'Name',['Signal: ' x_name]); 17 | 18 | 19 | 20 | 21 | % 22 | % Part of Wavelab Version 850 23 | % Built Tue Jan 3 13:20:42 EST 2006 24 | % This is Copyrighted Material 25 | % For Copying permissions see COPYING.m 26 | % Comments? e-mail wavelab@stat.stanford.edu 27 | -------------------------------------------------------------------------------- /TimeFrequency/Interpol2.m: -------------------------------------------------------------------------------- 1 | function g = Interpol2(f); 2 | % 3 | % Interpolates signal f (length N ) to a signal g (length 2N) 4 | % such that g(2*n) = f(n) 5 | % 6 | % 7 | f0 = f; 8 | f = f(:); 9 | N = length(f); 10 | hatf = fft(f); 11 | hatg = zeros(2*N,1); 12 | hatg(1:N/2) = 2*hatf(1:N/2); 13 | hatg(3*N/2+2:2*N) = 2*hatf(N/2+2:N); 14 | hatg(N/2+1)=hatf(N/2+1); 15 | hatg(3*N/2+1)=hatf(N/2+1); 16 | g = ifft(hatg); 17 | g = ShapeLike(g,f0); 18 | 19 | % Written by Maureen Clerc and Jerome Kalifa, 1997 20 | % clerc@cmapx.polytechnique.fr, kalifa@cmapx.polytechnique.fr 21 | 22 | 23 | 24 | 25 | % 26 | % Part of Wavelab Version 850 27 | % Built Tue Jan 3 13:20:43 EST 2006 28 | % This is Copyrighted Material 29 | % For Copying permissions see COPYING.m 30 | % Comments? e-mail wavelab@stat.stanford.edu 31 | -------------------------------------------------------------------------------- /Browsers/One-D/setfigure.m: -------------------------------------------------------------------------------- 1 | function setfigure 2 | % setfigure -- Called by WLBrowser 3 | % Usage 4 | % setfigure 5 | % Inputs 6 | % none 7 | % Outputs 8 | % none 9 | % 10 | % Description 11 | % The figure and title indicated are reset. The figure to be 12 | % reset is indicated by the global variable m. 13 | % 14 | % Side Effects 15 | % Figure is reset 16 | % 17 | if fig_handle(m) == 0 18 | figure; 19 | fig_handle(m) = gcf; 20 | else 21 | figure( fig_handle(m) ); 22 | end 23 | 24 | signaltitle = [ st ': ' signal_name ]; 25 | set( gcf, 'Name', signaltitle ); 26 | 27 | 28 | 29 | 30 | % 31 | % Part of Wavelab Version 850 32 | % Built Tue Jan 3 13:20:39 EST 2006 33 | % This is Copyrighted Material 34 | % For Copying permissions see COPYING.m 35 | % Comments? e-mail wavelab@stat.stanford.edu 36 | -------------------------------------------------------------------------------- /DeNoising/SUREThresh.m: -------------------------------------------------------------------------------- 1 | function [x,thresh] = SUREThresh(y) 2 | % SUREThresh -- Adaptive Threshold Selection Using Principle of SURE 3 | % Usage 4 | % thresh = SUREThresh(y) 5 | % Inputs 6 | % y Noisy Data with Std. Deviation = 1 7 | % Outputs 8 | % x Estimate of mean vector 9 | % thresh Threshold used 10 | % 11 | % Description 12 | % SURE referes to Stein's Unbiased Risk Estimate. 13 | % 14 | thresh = ValSUREThresh(y); 15 | x = HardThresh(y,thresh); 16 | 17 | % 18 | % Copyright (c) 1993-5. Jonathan Buckheit, David Donoho and Iain Johnstone 19 | % 20 | 21 | 22 | 23 | 24 | % 25 | % Part of Wavelab Version 850 26 | % Built Tue Jan 3 13:20:39 EST 2006 27 | % This is Copyrighted Material 28 | % For Copying permissions see COPYING.m 29 | % Comments? e-mail wavelab@stat.stanford.edu 30 | -------------------------------------------------------------------------------- /Orthogonal/dyadlength.m: -------------------------------------------------------------------------------- 1 | function [n,J] = dyadlength(x) 2 | % dyadlength -- Find length and dyadic length of array 3 | % Usage 4 | % [n,J] = dyadlength(x) 5 | % Inputs 6 | % x array of length n = 2^J (hopefully) 7 | % Outputs 8 | % n length(x) 9 | % J least power of two greater than n 10 | % 11 | % Side Effects 12 | % A warning is issued if n is not a power of 2. 13 | % 14 | % See Also 15 | % quadlength, dyad, dyad2ix 16 | % 17 | n = length(x) ; 18 | J = ceil(log(n)/log(2)); 19 | if 2^J ~= n , 20 | disp('Warning in dyadlength: n != 2^J') 21 | end 22 | 23 | 24 | 25 | 26 | % 27 | % Part of Wavelab Version 850 28 | % Built Tue Jan 3 13:20:40 EST 2006 29 | % This is Copyrighted Material 30 | % For Copying permissions see COPYING.m 31 | % Comments? e-mail wavelab@stat.stanford.edu 32 | -------------------------------------------------------------------------------- /Books/WaveTour/WTCh07/wt07fig23.m: -------------------------------------------------------------------------------- 1 | %CAPTION 2 | fprintf('\n'); 3 | disp('Figure 7.23') 4 | disp('Multiresolution approximations a_j[n,m] of an image') 5 | disp('at scales 2^j, for 5>j>0.') 6 | 7 | close all; 8 | global WLVERBOSE; 9 | WLVERBOSE='No'; 10 | Image = ReadImage('Lenna'); 11 | [n,J] = quadlength(Image); 12 | qmf = MakeONFilter('Daubechies',8); 13 | L = 5; 14 | wc = FWT2_PO(Image,L,qmf); 15 | figure(1);clf 16 | Display2dProjV(wc,L,qmf); 17 | WLVERBOSE='Yes'; 18 | 19 | % Written by Maureen Clerc and Jerome Kalifa, 1997 20 | % clerc@cmapx.polytechnique.fr, kalifa@cmapx.polytechnique.fr 21 | 22 | 23 | 24 | 25 | 26 | % 27 | % Part of Wavelab Version 850 28 | % Built Tue Jan 3 13:20:39 EST 2006 29 | % This is Copyrighted Material 30 | % For Copying permissions see COPYING.m 31 | % Comments? e-mail wavelab@stat.stanford.edu 32 | -------------------------------------------------------------------------------- /Papers/Adapt/AdaptIntro.m: -------------------------------------------------------------------------------- 1 | % AdaptIntro -- Info about AdaptDemo % % The files in this directory can reproduce the figures in the paper % ``Adapting to Unknown Smoothness via Wavelet Shrinkage'' % by D.L. Donoho and I.M. Johnstone. % % This paper is available by www from % http://www-stat.stanford.edu/~donoho/Reports/1993/ausws.ps.Z % % The paper proposes soft thresholding of wavelet coefficients % with an adaptively-chosen threshold. The threshold is chosen % using the SURE (Stein's unbiased estimate of risk) for the % Soft Thresholding Estimator. The paper shows that this has % various optimality properties for mean-squared error estimation. % 2 | 3 | % 4 | % Part of Wavelab Version 850 5 | % Built Tue Jan 3 13:20:41 EST 2006 6 | % This is Copyrighted Material 7 | % For Copying permissions see COPYING.m 8 | % Comments? e-mail wavelab@stat.stanford.edu 9 | -------------------------------------------------------------------------------- /DeNoising/MultiSURE.m: -------------------------------------------------------------------------------- 1 | function ws = MultiSURE(wc,L) 2 | % MultiSURE -- Apply Shrinkage to Wavelet Coefficients 3 | % Usage 4 | % ws = MultiSURE(wc,L) 5 | % Inputs 6 | % wc Wavelet Transform of noisy sequence with N(0,1) noise 7 | % L low-frequency cutoff for Wavelet Transform 8 | % Outputs 9 | % ws result of applying SUREThresh to each dyadic block 10 | % 11 | [n,J] = dyadlength(wc); 12 | for j=(J-1):-1:L 13 | wc(dyad(j)) = SUREThresh(wc(dyad(j))) ; 14 | end 15 | ws = wc; 16 | 17 | % 18 | % Copyright (c) 1993-5. Jonathan Buckheit, David Donoho and Iain Johnstone 19 | % 20 | 21 | 22 | 23 | 24 | % 25 | % Part of Wavelab Version 850 26 | % Built Tue Jan 3 13:20:39 EST 2006 27 | % This is Copyrighted Material 28 | % For Copying permissions see COPYING.m 29 | % Comments? e-mail wavelab@stat.stanford.edu 30 | -------------------------------------------------------------------------------- /MEXSource/uplopbs.c: -------------------------------------------------------------------------------- 1 | #include 2 | void uplopbs(x,n,lpf,m,y) 3 | DOUBLE x[],lpf[],y[]; 4 | int n,m; 5 | { 6 | int meven, modd, pos, i, h, j, k; 7 | DOUBLE s; 8 | 9 | /*lopass version */ 10 | meven = (m+1)/2; 11 | modd = m/2; 12 | 13 | k = meven -1; 14 | j = (int) (k / 2); 15 | pos = k-2*j; 16 | k = j; 17 | 18 | for(i=0;i= n) j -= n; 24 | s += lpf[2*h+pos]*x[j]; 25 | j--; 26 | } 27 | y[2*i] = s; 28 | 29 | s = 0; 30 | j = k+pos; 31 | for(h=0;h<(modd+pos);h++){ 32 | while(j < 0) j += n; 33 | while(j >= n) j -= n; 34 | s += lpf[2*h+1-pos]*x[j]; 35 | j--; 36 | } 37 | y[2*i+1] = s; 38 | 39 | k++; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Papers/VillardDeLans/vdlfig01.m: -------------------------------------------------------------------------------- 1 | % vdlfig01 -- Plot of Doppler Signal 2 | % 3 | % Display the Doppler signal built-into WaveLab. 4 | % 5 | % Distribution of datasets, both synthetic and real, is a crucial 6 | % part of reproducibility. Here we illustrate one interface to 7 | % retrieving such data from WaveLab. 8 | % 9 | 10 | doppler = MakeSignal('Doppler',1024); 11 | plot(doppler); 12 | title('Figure 1: Doppler Signal'); 13 | 14 | % 15 | % Copyright (c) 1995, Jonathan Buckheit. 16 | % Prepared for ``WaveLab and Reproducible Research'' 17 | % for XV Recontres Franco-Belges symposium proceedings. 18 | % 19 | 20 | 21 | 22 | 23 | % 24 | % Part of Wavelab Version 850 25 | % Built Tue Jan 3 13:20:42 EST 2006 26 | % This is Copyrighted Material 27 | % For Copying permissions see COPYING.m 28 | % Comments? e-mail wavelab@stat.stanford.edu 29 | -------------------------------------------------------------------------------- /Biorthogonal/DownDyadHi_PBS.m: -------------------------------------------------------------------------------- 1 | function d = DownDyadHi_PBS(x,qmf) 2 | % DownDyadHi_PBS -- Hi-Pass Downsampling operator (periodized,symmetric) 3 | % Usage 4 | % d = DownDyadHi_PBS(x,sqmf) 5 | % Inputs 6 | % x 1-d signal at fine scale 7 | % sqmf symmetric filter 8 | % Outputs 9 | % y 1-d signal at coarse scale 10 | % 11 | % See Also 12 | % DownDyadLo_PBS, UpDyadHi_PBS, UpDyadLo_PBS, FWT_PBS, symm_iconv 13 | % 14 | d = symm_iconv( MirrorSymmFilt(qmf),lshift(x)); 15 | n = length(d); 16 | d = d(1:2:(n-1)); 17 | 18 | % 19 | % Copyright (c) 1995. David L. Donoho 20 | % 21 | 22 | 23 | 24 | 25 | 26 | % 27 | % Part of Wavelab Version 850 28 | % Built Tue Jan 3 13:20:38 EST 2006 29 | % This is Copyrighted Material 30 | % For Copying permissions see COPYING.m 31 | % Comments? e-mail wavelab@stat.stanford.edu 32 | -------------------------------------------------------------------------------- /Biorthogonal/MirrorSymmFilt.m: -------------------------------------------------------------------------------- 1 | function y = MirrorSymmFilt(x) 2 | % MirrorSymmFilt -- apply (-1)^t modulation to symmetric filter 3 | % Usage 4 | % h = MirrorSymmFilt(l) 5 | % Inputs 6 | % l symmetric filter 7 | % Outputs 8 | % h symmetric filter with DC frequency content shifted 9 | % to Nyquist frequency 10 | % 11 | % Description 12 | % h(t) = (-1)^t * x(t), -k <= t <= k ; length(x)=2k+1 13 | % 14 | % See Also 15 | % DownDyadHi_PBS 16 | % 17 | k = (length(x)-1)/2; 18 | y = ( (-1).^((-k):k) ) .*x; 19 | 20 | % 21 | % Copyright (c) 1993. Iain M. Johnstone 22 | % 23 | 24 | 25 | 26 | 27 | % 28 | % Part of Wavelab Version 850 29 | % Built Tue Jan 3 13:20:38 EST 2006 30 | % This is Copyrighted Material 31 | % For Copying permissions see COPYING.m 32 | % Comments? e-mail wavelab@stat.stanford.edu 33 | -------------------------------------------------------------------------------- /Browsers/One-D/reset_slider.m: -------------------------------------------------------------------------------- 1 | function reset_slider 2 | % reset_slider -- Called by WLBrowser 3 | % Usage 4 | % reset_slider 5 | % Inputs 6 | % none 7 | % Outputs 8 | % none 9 | % 10 | % Description 11 | % This routine resets the state and parameters of the slider. 12 | % Side Effects 13 | % Slider is reset. 14 | 15 | if n_work == n_use 16 | set(HC,'Visible','off'); 17 | else 18 | set(HC,'Visible','on'); 19 | slide_max = (n_use - n_work)/n_use; 20 | slide_val = (offset/(n_use))/slide_max; 21 | set(HC,'pos',[.02,y_sli, slide_max,.05]); 22 | set(HC,'value',slide_val); 23 | end 24 | 25 | 26 | 27 | 28 | % 29 | % Part of Wavelab Version 850 30 | % Built Tue Jan 3 13:20:39 EST 2006 31 | % This is Copyrighted Material 32 | % For Copying permissions see COPYING.m 33 | % Comments? e-mail wavelab@stat.stanford.edu 34 | -------------------------------------------------------------------------------- /Papers/MinEntSeg/off_filter.m: -------------------------------------------------------------------------------- 1 | function y = off_filter(x,f,offset) 2 | % off_filter -- Offset-index convolution 3 | % Usage 4 | % y = off_filter(x,f,offset) 5 | % Inputs 6 | % x input signal 7 | % f filter 8 | % offset integer offset parameter 9 | % Outputs 10 | % y output signal 11 | % 12 | % Description 13 | % y(i) = sum{h=offset,m-offset-1}{ x(i+h)f(h+offset) } 14 | % 15 | % 16 | m = length(f); n = length(x); 17 | z = conv(x,f); 18 | m0 = max(1+offset,m); 19 | n0 = min(n,n+offset); 20 | % 21 | y = zeros(1,n); 22 | y((m0-offset):(n0-offset)) = z(m0:n0); 23 | 24 | 25 | 26 | 27 | % 28 | % Part of Wavelab Version 850 29 | % Built Tue Jan 3 13:20:41 EST 2006 30 | % This is Copyrighted Material 31 | % For Copying permissions see COPYING.m 32 | % Comments? e-mail wavelab@stat.stanford.edu 33 | -------------------------------------------------------------------------------- /Utilities/LockAxes.m: -------------------------------------------------------------------------------- 1 | function LockAxes(a) 2 | % LockAxes -- Version-independent axis command 3 | % Usage 4 | % LockAxes(a) 5 | % Inputs 6 | % a axis parameter, just as required by axis() 7 | % 8 | % Side Effects 9 | % The axes are set to a and held, using a method 10 | % which works under both v3.5 and v4.0 of MATLAB. 11 | % 12 | % See Also 13 | % UnlockAxes, MATLABVERSION 14 | % 15 | global MATLABVERSION 16 | if MATLABVERSION == 3.5, 17 | axis(a); 18 | plot(a(1)-.5, a(3)-.5); 19 | hold on; 20 | else 21 | plot(a(1)-.5, a(3)-.5); 22 | axis(a); 23 | hold on; 24 | end 25 | 26 | 27 | 28 | 29 | % 30 | % Part of Wavelab Version 850 31 | % Built Tue Jan 3 13:20:43 EST 2006 32 | % This is Copyrighted Material 33 | % For Copying permissions see COPYING.m 34 | % Comments? e-mail wavelab@stat.stanford.edu 35 | -------------------------------------------------------------------------------- /Books/WaveTour/WTCh06/mMakeBrownian.m: -------------------------------------------------------------------------------- 1 | function fbm = MakeBrownian(N,H) 2 | % MakeBrownian -- Create Fractional Brownian Signal 3 | % Usage 4 | % fBr = MakeBrownian(n,H) 5 | % Inputs 6 | % n signal length 7 | % H fbm exponent (0=zeros(1,2*N)); 17 | v=u.*((max(ix,epsilon)/(N-1)).^(H-0.5)); 18 | fbm=conv(v,randn(2*N,1)); 19 | fbm=fbm(N+1:2*N); 20 | % 21 | % Written June 7, 1996 (Maureen Clerc) 22 | % 23 | 24 | 25 | 26 | 27 | 28 | % 29 | % Part of Wavelab Version 850 30 | % Built Tue Jan 3 13:20:39 EST 2006 31 | % This is Copyrighted Material 32 | % For Copying permissions see COPYING.m 33 | % Comments? e-mail wavelab@stat.stanford.edu 34 | -------------------------------------------------------------------------------- /DeNoising/MultiHybrid.m: -------------------------------------------------------------------------------- 1 | function ws = MultiHybrid(wc,L) 2 | % MultiHybrid -- Apply Shrinkage to Wavelet Coefficients 3 | % Usage 4 | % ws = MultiHybrid(wc,L) 5 | % Inputs 6 | % wc Wavelet Transform of noisy sequence with N(0,1) noise 7 | % L low-frequency cutoff for Wavelet Transform 8 | % Outputs 9 | % ws result of applying HybridThresh to each dyadic block 10 | % 11 | [n,J] = dyadlength(wc); 12 | for j=(J-1):-1:L 13 | wc(dyad(j)) = HybridThresh(wc(dyad(j))) ; 14 | end 15 | ws = wc; 16 | 17 | % 18 | % Copyright (c) 1993-5. Jonathan Buckheit, David Donoho and Iain Johnstone 19 | % 20 | 21 | 22 | 23 | 24 | % 25 | % Part of Wavelab Version 850 26 | % Built Tue Jan 3 13:20:39 EST 2006 27 | % This is Copyrighted Material 28 | % For Copying permissions see COPYING.m 29 | % Comments? e-mail wavelab@stat.stanford.edu 30 | -------------------------------------------------------------------------------- /DeNoising/Wiener2.m: -------------------------------------------------------------------------------- 1 | function out = Wiener2(Noisy,in,sigma) 2 | % Wiener -- Wiener filter for images. 3 | % Usage 4 | % out = Wiener2(Noisy,in,sigma) 5 | % Inputs 6 | % Noisy Noisy input signal. 7 | % in Original signal. 8 | % sigma s.d of the additve GWN 9 | % Outputs 10 | % out Restored image. 11 | % 12 | 13 | Y=fft2(in); 14 | FN=fft2(Noisy); 15 | PY=abs(Y.*Y); 16 | [nc, nr]=size(in); 17 | n=nc*nr; 18 | H=PY./(PY+ n*sigma^2); 19 | FN=FN.*H; 20 | out=real(ifft2(FN)); 21 | 22 | % Written by Maureen Clerc and Jerome Kalifa, 1997 23 | % clerc@cmapx.polytechnique.fr, kalifa@cmapx.polytechnique.fr 24 | 25 | 26 | 27 | 28 | % 29 | % Part of Wavelab Version 850 30 | % Built Tue Jan 3 13:20:40 EST 2006 31 | % This is Copyrighted Material 32 | % For Copying permissions see COPYING.m 33 | % Comments? e-mail wavelab@stat.stanford.edu 34 | -------------------------------------------------------------------------------- /Orthogonal/UpDyadLo.m: -------------------------------------------------------------------------------- 1 | function y = UpDyadLo(x,qmf) 2 | % UpDyadLo -- Lo-Pass Upsampling operator; periodized 3 | % Usage 4 | % u = UpDyadLo(d,f) 5 | % Inputs 6 | % d 1-d signal at coarser scale 7 | % f filter 8 | % Outputs 9 | % u 1-d signal at finer scale 10 | % 11 | % See Also 12 | % DownDyadLo, DownDyadHi, UpDyadHi, IWT_PO, iconv 13 | % 14 | y = iconv(qmf, UpSampleN(x) ); 15 | 16 | 17 | % Revision History 18 | % 10/1/05 AM UpSample is changed to UpSampleN 19 | 20 | % 21 | % Copyright (c) 1993. Iain M. Johnstone 22 | % Last modified on October 2005. 23 | % 24 | 25 | 26 | 27 | 28 | % 29 | % Part of Wavelab Version 850 30 | % Built Tue Jan 3 13:20:40 EST 2006 31 | % This is Copyrighted Material 32 | % For Copying permissions see COPYING.m 33 | % Comments? e-mail wavelab@stat.stanford.edu 34 | -------------------------------------------------------------------------------- /Books/WaveTour/WTCh05/WTCh05Demo.m: -------------------------------------------------------------------------------- 1 | function WTCh05Demo 2 | % WTCh05Demo -- Demo Browser for chapter 5. 3 | % Usage 4 | % WTCh05Demo 5 | % Inputss 6 | % none 7 | % Outputs 8 | % none 9 | % 10 | 11 | choice=menu('Chapter 5 : which figure?', 'figure 4', 'figure 5', ... 12 | 'figure 6','Exit Chapter 5'); 13 | 14 | switch(choice); 15 | case(1), wt05fig04,WTCh05Demo; 16 | case(2), wt05fig05,WTCh05Demo; 17 | case(3), wt05fig06,WTCh05Demo; 18 | case(4), close all; 19 | end 20 | 21 | % Written by Maureen Clerc and Jerome Kalifa, 1997 22 | % clerc@cmapx.polytechnique.fr, kalifa@cmapx.polytechnique.fr 23 | 24 | 25 | 26 | 27 | % 28 | % Part of Wavelab Version 850 29 | % Built Tue Jan 3 13:20:39 EST 2006 30 | % This is Copyrighted Material 31 | % For Copying permissions see COPYING.m 32 | % Comments? e-mail wavelab@stat.stanford.edu 33 | -------------------------------------------------------------------------------- /reverse.m: -------------------------------------------------------------------------------- 1 | function r = reverse(x) 2 | % reverse -- Reverse order of elements in 1-d signal 3 | % Usage 4 | % r = reverse(x) 5 | % Inputs 6 | % x 1-d signal 7 | % Outputs 8 | % r 1-d time-reversed signal 9 | % 10 | % See Also 11 | % flipud, fliplr 12 | % 13 | r = x(length(x):-1:1); 14 | 15 | % 16 | % Copyright (c) 1993. David L. Donoho 17 | % 18 | 19 | 20 | % 21 | % Part of WaveLab Version 802 22 | % Built Sunday, October 3, 1999 8:52:27 AM 23 | % This is Copyrighted Material 24 | % For Copying permissions see COPYING.m 25 | % Comments? e-mail wavelab@stat.stanford.edu 26 | % 27 | 28 | 29 | 30 | % 31 | % Part of Wavelab Version 850 32 | % Built Tue Jan 3 13:20:38 EST 2006 33 | % This is Copyrighted Material 34 | % For Copying permissions see COPYING.m 35 | % Comments? e-mail wavelab@stat.stanford.edu 36 | -------------------------------------------------------------------------------- /Biorthogonal/UpDyadLo_PBS.m: -------------------------------------------------------------------------------- 1 | function y = UpDyadLo_PBS(x,qmf) 2 | % UpDyadLo_PBS -- Lo-Pass Upsampling operator; periodized 3 | % Usage 4 | % u = UpDyadLo_PBS(d,sf) 5 | % Inputs 6 | % d 1-d signal at coarser scale 7 | % sf symmetric filter 8 | % Outputs 9 | % u 1-d signal at finer scale 10 | % 11 | % See Also 12 | % DownDyadLo_PBS , DownDyadHi_PBS , UpDyadHi_PBS, IWT_PBS, symm_iconv 13 | % 14 | y = symm_iconv(qmf, UpSampleN(x) ); 15 | 16 | % 17 | % Copyright (c) 1995. David L. Donoho 18 | % 19 | % Revision History 20 | % 10/1/05 AM UpSample is changed to UpSampleN 21 | 22 | 23 | 24 | 25 | 26 | % 27 | % Part of Wavelab Version 850 28 | % Built Tue Jan 3 13:20:38 EST 2006 29 | % This is Copyrighted Material 30 | % For Copying permissions see COPYING.m 31 | % Comments? e-mail wavelab@stat.stanford.edu 32 | -------------------------------------------------------------------------------- /Continuous/CalcCWTScale.m: -------------------------------------------------------------------------------- 1 | function [scales,xtick,ytick] = CalcCWTScale(sz) 2 | % CalcCWTScale -- Calculate Scales and TickMarks for CWT Display 3 | % Usage 4 | % [scales,xtick,ytick] = CalcCWTScale(sz); 5 | % Inputs 6 | % sz size of CWT array 7 | % Outputs 8 | % scales vector of scales in CWT 9 | % xtick vector of positions 10 | % ytick vector of log2(scales) 11 | % 12 | 13 | n = sz(1); nscale = sz(2); 14 | noctave = floor(log2(n))-5; 15 | nvoice = nscale ./ noctave; 16 | scales = 2.^(2 + (1:nscale)./nvoice); 17 | xtick = (.5:(n-.5))./n; 18 | ytick = (2 + (1:nscale)./nvoice); 19 | 20 | 21 | 22 | 23 | 24 | % 25 | % Part of Wavelab Version 850 26 | % Built Tue Jan 3 13:20:39 EST 2006 27 | % This is Copyrighted Material 28 | % For Copying permissions see COPYING.m 29 | % Comments? e-mail wavelab@stat.stanford.edu 30 | -------------------------------------------------------------------------------- /DeNoising/MultiVisu.m: -------------------------------------------------------------------------------- 1 | function ws = MultiVisu(wc,L) 2 | % MultiVisu -- Apply sqrt(2log(n)) Thresholding to Wavelet Coefficients 3 | % Usage 4 | % ws = MultiVisu(wc,L) 5 | % Inputs 6 | % wc Wavelet Transform of noisy sequence with N(0,1) noise 7 | % L low-frequency cutoff for Wavelet Transform 8 | % Outputs 9 | % ws result of applying VisuThresh to each High Frequency 10 | % Dyadic Block 11 | % 12 | [n,J] = dyadlength(wc); 13 | ws = wc; 14 | ws((2^(L)+1):n) = VisuThresh(wc((2^(L)+1):n)) ; 15 | 16 | % 17 | % Copyright (c) 1993-5. Jonathan Buckheit, David Donoho and Iain Johnstone 18 | % 19 | 20 | 21 | 22 | 23 | % 24 | % Part of Wavelab Version 850 25 | % Built Tue Jan 3 13:20:39 EST 2006 26 | % This is Copyrighted Material 27 | % For Copying permissions see COPYING.m 28 | % Comments? e-mail wavelab@stat.stanford.edu 29 | -------------------------------------------------------------------------------- /Papers/Blocky/BlockyDemo2.m: -------------------------------------------------------------------------------- 1 | % BlockyDemo -- Show Blocky Figs with Point & Click Interface % To run, type BlockyDemo header = 'Blocky Figures'; labels = ['Change Settings' ; 'Run All Scripts' ; ... 'Run One Script ' ; 'Clean Up ']; callbacks = ['BlockyFig(19)'; 'BlockyFig(20)'; ... 'BlockyFig(21)'; 'BlockyCleanup']; global BLOCKYFIGNUM BLOCKYFIGNUM = 0; clc; help('BlockyIntro'); %choices('Blocky',header,labels,callbacks); NumberOfChoices=4; choice=0; while (choice 1. Take the 2-d Wavelet Transform of the matrix 5 | % 2. ``compress'' the 2-d wavelet transform 6 | % 3. ``stretch'' it into a nonstandard form 7 | % 4. apply the nonstandard form by matrix multiplication. 8 | % 9 | % Here we look at the Wavelet Transform of the matrix. It is SPARSE. 10 | % 11 | g = MakeONFilter('Coiflet',2); 12 | wmat = FWT2_PO(mat,3,g); 13 | % 14 | zmat = (wmat + 51) .* 4; 15 | GrayImage(zmat); 16 | title('Wavelet Transform of Matrix'); 17 | 18 | 19 | 20 | 21 | % 22 | % Part of Wavelab Version 850 23 | % Built Tue Jan 3 13:20:43 EST 2006 24 | % This is Copyrighted Material 25 | % For Copying permissions see COPYING.m 26 | % Comments? e-mail wavelab@stat.stanford.edu 27 | -------------------------------------------------------------------------------- /Books/WaveTour/WTCh07/DisplayProjV.m: -------------------------------------------------------------------------------- 1 | function DisplayProjV(wc,L,qmf); 2 | 3 | wcoef = ShapeAsRow(wc); 4 | [n,J] = dyadlength(wcoef); 5 | t = (.5:(n-.5)); 6 | LockAxes([0 n 0 (J-L+1)]); 7 | scale = .9; 8 | w = wcoef(1:2^L); 9 | for j = L:J-1, 10 | tj = n.*(.5:(2^(j+1)-.5))./2^(j+1); 11 | w = UpDyadLo(w,qmf) + UpDyadHi(wcoef(dyad(j)),qmf); 12 | maxw = max(w); 13 | newPlotSpikes(J-j,tj, scale .* (w./maxw),n); 14 | text(0,-j+J-1/5,sprintf('2^%d',-j+J)); 15 | end 16 | axis off 17 | 18 | 19 | % Written by Maureen Clerc and Jerome Kalifa, 1997 20 | % clerc@cmapx.polytechnique.fr, kalifa@cmapx.polytechnique.fr 21 | 22 | 23 | 24 | 25 | 26 | % 27 | % Part of Wavelab Version 850 28 | % Built Tue Jan 3 13:20:39 EST 2006 29 | % This is Copyrighted Material 30 | % For Copying permissions see COPYING.m 31 | % Comments? e-mail wavelab@stat.stanford.edu 32 | -------------------------------------------------------------------------------- /Browsers/WaveTour/Contents.m: -------------------------------------------------------------------------------- 1 | % WaveTour - Figures of the book "A Wavelet Tour of Signal Processing" 2 | % 3 | % A Wavelet Tour of Signal Processing 4 | % Stephane Mallat 5 | % ISBN: 0-12-466605-1 6 | % Academic Press, 1998 7 | % 8 | % This book explains the applications of wavelets to signal processing. 9 | % A preview of the book can be found in: 10 | % 11 | % http://www.cmap.polytechnique.fr/users/www.mallat 12 | % and 13 | % http://cs.nyu.edu/cs/faculty/mallat 14 | % 15 | % The subdirectories WTCh... contain files that reproduce the figures in 16 | % each chapter, as explained in the Appendix B of the book. 17 | % 18 | 19 | 20 | 21 | % 22 | % Part of Wavelab Version 850 23 | % Built Tue Jan 3 13:20:39 EST 2006 24 | % This is Copyrighted Material 25 | % For Copying permissions see COPYING.m 26 | % Comments? e-mail wavelab@stat.stanford.edu 27 | -------------------------------------------------------------------------------- /Workouts/MatchingPursuit/PlotSemiCompressNum.m: -------------------------------------------------------------------------------- 1 | function PlotSemiCompressNum(cnums,type,Title) 2 | % PlotSemiCompressNum -- Plot Compression Numbers on Semilog Scale 3 | % Usage 4 | % PlotSemiCompressNum(cnums,type,Title) 5 | % 6 | 7 | if strcmp(type,'MPWP'), 8 | pch = 'y--'; 9 | elseif strcmp(type,'MPCP'), 10 | pch = 'b-'; 11 | elseif strcmp(type,'BBWP'), 12 | pch = 'r:'; 13 | elseif strcmp(type,'BBCP'), 14 | pch = 'g-.'; 15 | end 16 | 17 | semilogy(cnums,pch) 18 | xlabel('m') 19 | ylabel('c_m') 20 | title(['Compression Numbers: ' Title]) 21 | axis([0 400 10^(-2) 10^4]) 22 | hold on 23 | 24 | 25 | 26 | 27 | 28 | 29 | % 30 | % Part of Wavelab Version 850 31 | % Built Tue Jan 3 13:20:43 EST 2006 32 | % This is Copyrighted Material 33 | % For Copying permissions see COPYING.m 34 | % Comments? e-mail wavelab@stat.stanford.edu 35 | -------------------------------------------------------------------------------- /Workouts/Toons/toon0333.m: -------------------------------------------------------------------------------- 1 | % toon0333 -- Behavior of Wavelet Transform of Singularities 2 | % 3 | % Show the MRA's of the signals in toon0331. 4 | % 5 | qmf = MakeONFilter('Coiflet',3); 6 | wcRamp = FWT_PO(Ramp,3,qmf); 7 | wcCrease = FWT_PO(Crease,3,qmf); 8 | wcCusp = FWT_PO(Cusp,3,qmf); 9 | wcSing = FWT_PO(Sing,3,qmf); 10 | % 11 | subplot(221); PlotMultiRes(wcRamp ,3,2.,qmf); title('MR Ramp') 12 | subplot(222); PlotMultiRes(wcCrease,3,2.,qmf); title('MR Crease') 13 | subplot(223); PlotMultiRes(wcCusp ,3,2.,qmf); title('MR Cusp') 14 | subplot(224); PlotMultiRes(wcSing ,3,0.,qmf); title('MR Sing') 15 | 16 | 17 | 18 | 19 | 20 | 21 | % 22 | % Part of Wavelab Version 850 23 | % Built Tue Jan 3 13:20:43 EST 2006 24 | % This is Copyrighted Material 25 | % For Copying permissions see COPYING.m 26 | % Comments? e-mail wavelab@stat.stanford.edu 27 | -------------------------------------------------------------------------------- /Browsers/One-D/def_filter.m: -------------------------------------------------------------------------------- 1 | function def_filter(m) 2 | % def_filter -- Called by WLBrowser 3 | % Usage 4 | % def_filter(m) 5 | % 6 | 7 | do_global; global h_wavemenu 8 | 9 | for i=1:5, 10 | set(h_wavemenu(i),'Checked','off') 11 | end 12 | set(h_wavemenu(m),'Checked','on') 13 | 14 | filter_type = m; 15 | if filter_type == 1 16 | % 'Haar' 17 | QMF_Filter = MakeONFilter('Haar', 1); 18 | 19 | elseif filter_type == 4 20 | %'Coiflet'; 21 | Par = 2; 22 | QMF_Filter = MakeONFilter('Coiflet',Par); 23 | 24 | elseif filter_type == 5 25 | %'Symmlet'; 26 | Par = 6; 27 | QMF_Filter = MakeONFilter('Symmlet',Par); 28 | end 29 | 30 | 31 | 32 | % 33 | % Part of Wavelab Version 850 34 | % Built Tue Jan 3 13:20:39 EST 2006 35 | % This is Copyrighted Material 36 | % For Copying permissions see COPYING.m 37 | % Comments? e-mail wavelab@stat.stanford.edu 38 | -------------------------------------------------------------------------------- /Papers/Tour/TourIntro.m: -------------------------------------------------------------------------------- 1 | % TourIntro -- Info about TourDemo 2 | % 3 | % The files in this directory can reproduce the figures in the paper 4 | % ``Wavelet Shrinkage and W.V.D.: A Ten-Minute Tour'' 5 | % by D.L. Donoho. 6 | % 7 | % This paper is available by www at URL 8 | % http://www-stat.stanford.edu/~donoho/Reports/1993/toulouse.ps.Z. 9 | % 10 | % The paper briefly describes several applications of wavelets to recovering 11 | % objects from noisy and incomplete data, including uses of wavelets 12 | % in numerical differentiation, density estimation, spectral density estimation 13 | % and deconvolution 14 | % 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | % 23 | % Part of Wavelab Version 850 24 | % Built Tue Jan 3 13:20:42 EST 2006 25 | % This is Copyrighted Material 26 | % For Copying permissions see COPYING.m 27 | % Comments? e-mail wavelab@stat.stanford.edu 28 | -------------------------------------------------------------------------------- /Utilities/WhiteNoise.m: -------------------------------------------------------------------------------- 1 | function y = WhiteNoise(x) 2 | % WhiteNoise -- Version-independent white noise generator 3 | % Usage 4 | % y = WhiteNoise(x) 5 | % Inputs 6 | % x nonempty matrix 7 | % Outputs 8 | % y matrix shaped like x, filled with 9 | % standard normal random numbers. 10 | % 11 | % Description 12 | % The method used avoids warning messages under both 13 | % MATLAB v3.5 and v4.0. 14 | % 15 | % See Also 16 | % MATLABVERSION 17 | % 18 | global MATLABVERSION 19 | if MATLABVERSION == 3.5, 20 | rand('normal'); 21 | y = rand(x); 22 | else 23 | y = randn(size(x)); 24 | end 25 | 26 | 27 | 28 | 29 | % 30 | % Part of Wavelab Version 850 31 | % Built Tue Jan 3 13:20:43 EST 2006 32 | % This is Copyrighted Material 33 | % For Copying permissions see COPYING.m 34 | % Comments? e-mail wavelab@stat.stanford.edu 35 | -------------------------------------------------------------------------------- /Workouts/Toons/toon0563.m: -------------------------------------------------------------------------------- 1 | % toon0563 -- Fast Algorithm for Matrix Multiplication 2 | % 3 | % The Beylkin-Coifman-Rokhlin method is to 4 | % 1. Take the 2-d Wavelet Transform of the matrix 5 | % -> 2. ``compress'' the 2-d wavelet transform 6 | % 3. ``stretch'' it into a nonstandard form 7 | % 4. apply the nonstandard form by matrix multiplication. 8 | % 9 | % How many non-negligible vales in WT ? 10 | % 11 | figure; 12 | worder = sort(abs(wmat(:))); 13 | plot(log(reverse(worder)+eps)) 14 | title('log(sort(abs(NS[Matrix])))') 15 | xlabel('Ordered Coefficient'); ylabel('log(size(coefficient))'); 16 | 17 | 18 | 19 | 20 | 21 | 22 | % 23 | % Part of Wavelab Version 850 24 | % Built Tue Jan 3 13:20:43 EST 2006 25 | % This is Copyrighted Material 26 | % For Copying permissions see COPYING.m 27 | % Comments? e-mail wavelab@stat.stanford.edu 28 | -------------------------------------------------------------------------------- /Workouts/Toons/toon0565.m: -------------------------------------------------------------------------------- 1 | % toon0565 -- Fast Algorithm for Matrix Multiplication 2 | % 3 | % The Beylkin-Coifman-Rokhlin method is to 4 | % 1. Take the 2-d Wavelet Transform of the matrix 5 | % 2. ``compress'' the 2-d wavelet transform 6 | % -> 3. ``stretch'' it into a nonstandard form 7 | % 4. apply the nonstandard form by matrix multiplication. 8 | % 9 | % Here we look at the nonstandard form of the compressed matrix. 10 | % It is ``stretched out''. 11 | % 12 | [inew,jnew] = StretchMatrix(i,j,128,3); 13 | snsmat = sparse(inew,jnew,s,256,256); 14 | spy(snsmat) 15 | title('Sparse Nonstandard form of Matrix') 16 | 17 | 18 | 19 | 20 | % 21 | % Part of Wavelab Version 850 22 | % Built Tue Jan 3 13:20:43 EST 2006 23 | % This is Copyrighted Material 24 | % For Copying permissions see COPYING.m 25 | % Comments? e-mail wavelab@stat.stanford.edu 26 | -------------------------------------------------------------------------------- /Papers/Ideal/IdealIntro.m: -------------------------------------------------------------------------------- 1 | % IdealIntro -- Info about IdealDemo 2 | % 3 | % The files in this directory can reproduce the figures in the paper 4 | % ``Ideal Spatial Adaptation via Wavelet Shrinkage'' 5 | % by D.L. Donoho and I.M. Johnstone. 6 | % 7 | % This paper is available by www from 8 | % http://www-stat.stanford.edu/~donoho/Reports/1992/isaws.ps.Z. 9 | % 10 | % The paper shows that soft thresholding of wavelet coefficients 11 | % is a spatially adaptive method for estimation of functions from 12 | % noisy data, and that it is a nearly-ideal method of spatial 13 | % adaptation in some well-defined theoretical sense. 14 | % 15 | 16 | 17 | 18 | 19 | 20 | % 21 | % Part of Wavelab Version 850 22 | % Built Tue Jan 3 13:20:41 EST 2006 23 | % This is Copyrighted Material 24 | % For Copying permissions see COPYING.m 25 | % Comments? e-mail wavelab@stat.stanford.edu 26 | -------------------------------------------------------------------------------- /Workouts/Toons/toon0514.m: -------------------------------------------------------------------------------- 1 | % toon0514 -- Lincoln Refinement Scheme 2 | % 3 | % Show the 32*32 image and the 128*128 refinement side by side. 4 | % 5 | HonestAbe = ReadImage('Lincoln'); 6 | CrudeAbe = HCoarsen2d(HonestAbe,1); 7 | % 8 | clf; 9 | subplot(121); 10 | image(CrudeAbe); 11 | axis('image') 12 | colormap(gray(32)); 13 | title('32 * 32 Image'); 14 | % 15 | L =2; 16 | D =2; 17 | Fil = MakeAIFilter(2); 18 | Efil = MakeAIBdryFilter(2); 19 | DandyAbe = AIRefine2d(CrudeAbe,L,D,Fil,Efil); 20 | % 21 | subplot(122); 22 | image(DandyAbe); 23 | axis('image') 24 | colormap(gray(32)); 25 | title('Refinement to 128*128'); 26 | 27 | 28 | 29 | 30 | % 31 | % Part of Wavelab Version 850 32 | % Built Tue Jan 3 13:20:43 EST 2006 33 | % This is Copyrighted Material 34 | % For Copying permissions see COPYING.m 35 | % Comments? e-mail wavelab@stat.stanford.edu 36 | -------------------------------------------------------------------------------- /Biorthogonal/UpDyadHi_PBS.m: -------------------------------------------------------------------------------- 1 | function y = UpDyadHi_PBS(x,qmf) 2 | % UpDyadHi_PBS -- Hi-Pass Upsampling operator; periodized 3 | % Usage 4 | % u = UpDyadHi_PBS(d,f) 5 | % Inputs 6 | % d 1-d signal at coarser scale 7 | % sf symmetric filter 8 | % Outputs 9 | % u 1-d signal at finer scale 10 | % 11 | % See Also 12 | % DownDyadLo_PBS, DownDyadHi_PBS, UpDyadLo_PBS, IWT_PBS, symm_aconv 13 | % 14 | 15 | y = symm_aconv( MirrorSymmFilt(qmf), rshift( UpSampleN(x) ) ); 16 | 17 | % 18 | % Copyright (c) 1995. David L. Donoho 19 | % 20 | % Revision History 21 | % 10/1/05 AM UpSample is changed to UpSampleN 22 | 23 | 24 | 25 | 26 | % 27 | % Part of Wavelab Version 850 28 | % Built Tue Jan 3 13:20:38 EST 2006 29 | % This is Copyrighted Material 30 | % For Copying permissions see COPYING.m 31 | % Comments? e-mail wavelab@stat.stanford.edu 32 | -------------------------------------------------------------------------------- /Median/HigherDegree/Contents.m: -------------------------------------------------------------------------------- 1 | % Median:Contents v.850 -- Median Interpolating Pyramid Transform Tools 2 | % 3 | % The routines in this directory implements an iterative algorithm 4 | % for median-interpolation for D > 2. At the moment, the convergence 5 | % property of this algorithm is still missing a step in the proof. 6 | % However, experiments (and the not yet completed theory) suggest 7 | % an exponential rate of convergence. 8 | % 9 | % Background Reading: D.L. Donoho and T. P.Y. Yu, Robust Nonlinear Wavelet 10 | % Transform based on Median Interpolation 11 | % 12 | 13 | % 14 | % Copyright (c) 1997. David L. Donoho and Thomas P.Y.Yu 15 | % 16 | 17 | 18 | 19 | % 20 | % Part of Wavelab Version 850 21 | % Built Tue Jan 3 13:20:40 EST 2006 22 | % This is Copyrighted Material 23 | % For Copying permissions see COPYING.m 24 | % Comments? e-mail wavelab@stat.stanford.edu 25 | -------------------------------------------------------------------------------- /Orthogonal/UpDyadHi.m: -------------------------------------------------------------------------------- 1 | function y = UpDyadHi(x,qmf) 2 | % UpDyadHi -- Hi-Pass Upsampling operator; periodized 3 | % Usage 4 | % u = UpDyadHi(d,f) 5 | % Inputs 6 | % d 1-d signal at coarser scale 7 | % f filter 8 | % Outputs 9 | % u 1-d signal at finer scale 10 | % 11 | % See Also 12 | % DownDyadLo, DownDyadHi, UpDyadLo, IWT_PO, aconv 13 | % 14 | 15 | y = aconv( MirrorFilt(qmf), rshift( UpSampleN(x) ) ); 16 | 17 | 18 | % Revision History 19 | % 10/1/05 AM UpSample is changed to UpSampleN 20 | 21 | % 22 | % Copyright (c) 1993. Iain M. Johnstone 23 | % last modified on October 2005 24 | 25 | 26 | 27 | 28 | 29 | % 30 | % Part of Wavelab Version 850 31 | % Built Tue Jan 3 13:20:40 EST 2006 32 | % This is Copyrighted Material 33 | % For Copying permissions see COPYING.m 34 | % Comments? e-mail wavelab@stat.stanford.edu 35 | -------------------------------------------------------------------------------- /Orthogonal/UpSampleN.m: -------------------------------------------------------------------------------- 1 | function y = UpSampleN(x,s) 2 | % UpSample -- Upsampling operator 3 | % Usage 4 | % u = UpSample(d[,s]) 5 | % Inputs 6 | % d 1-d signal, of length n 7 | % s upsampling scale, default = 2 8 | % Outputs 9 | % u 1-d signal, of length s*n with zeros 10 | % interpolating alternate samples 11 | % u(s*i-1) = d(i), i=1,...,n 12 | % 13 | 14 | if nargin == 1, s = 2; end 15 | n = length(x)*s; 16 | y = zeros(1,n); 17 | y(1:s:(n-s+1) )=x; 18 | 19 | 20 | %Revision History 21 | % 10/1/05 AM the name of this function changed from UpSample to 22 | % UpSampleN 23 | 24 | 25 | 26 | 27 | % 28 | % Part of Wavelab Version 850 29 | % Built Tue Jan 3 13:20:40 EST 2006 30 | % This is Copyrighted Material 31 | % For Copying permissions see COPYING.m 32 | % Comments? e-mail wavelab@stat.stanford.edu 33 | -------------------------------------------------------------------------------- /Papers/MinEntSeg/mefig205.m: -------------------------------------------------------------------------------- 1 | % mefig205 -- Four Test Functions 2 | % 3 | % We illustrate here four test functions, Ramp, 4 | % Cusp, noise, and HeaviSine, for demonstration 5 | % of segmented average-interpolation. 6 | % 7 | global n x 8 | global Ramp Cusp Noise HeaviSine 9 | % 10 | %clf; 11 | subplot(221); plot(x,Ramp); title('2.5a Ramp') 12 | subplot(222); plot(x,Cusp); title('2.5b Cusp') 13 | subplot(223); plot(x,Noise); title('2.5c Noise') 14 | subplot(224); plot(x,HeaviSine); title('2.5d Heavisine') 15 | 16 | % 17 | % Prepared for the paper Minimum Entropy Segmentation 18 | % Copyright (c) 1994 David L. Donoho 19 | % 20 | 21 | 22 | 23 | 24 | % 25 | % Part of Wavelab Version 850 26 | % Built Tue Jan 3 13:20:41 EST 2006 27 | % This is Copyrighted Material 28 | % For Copying permissions see COPYING.m 29 | % Comments? e-mail wavelab@stat.stanford.edu 30 | -------------------------------------------------------------------------------- /Workouts/MatchingPursuit/PlotEquivRate.m: -------------------------------------------------------------------------------- 1 | function PlotEquivRate(cnumbers,type,Title) 2 | % PlotEquivRate -- Plot Equivalent Rates 3 | % Usage 4 | % PlotEquivRate(cnumbers,type,Title) 5 | % 6 | 7 | if strcmp(type,'WP'), 8 | pch = 'b--'; 9 | elseif strcmp(type,'CP'), 10 | pch = 'y-'; 11 | end 12 | 13 | n = length(cnumbers); 14 | plot((1:(n-1))' .* log(cnumbers(1:(n-1))./cnumbers(2:n)),pch); 15 | h = text(.70*n,9,'MPCP - '); set(h,'Color','Blue'); 16 | h = text(.70*n,8,'MPWP --'); set(h,'Color','Yellow'); 17 | xlabel('m') 18 | ylabel('m * log( c_m / c_{m+1} )') 19 | title(['Equivalent Rate: ' Title]) 20 | axis([0 n 0 10 ]) 21 | hold on; 22 | 23 | 24 | 25 | % 26 | % Part of Wavelab Version 850 27 | % Built Tue Jan 3 13:20:43 EST 2006 28 | % This is Copyrighted Material 29 | % For Copying permissions see COPYING.m 30 | % Comments? e-mail wavelab@stat.stanford.edu 31 | -------------------------------------------------------------------------------- /DeNoising/MinMaxThresh.m: -------------------------------------------------------------------------------- 1 | function [x] = MinMaxThresh(y) 2 | % MinMaxThresh -- Minimax Thresholding 3 | % Usage 4 | % x = MinMaxThresh(y) 5 | % Inputs 6 | % y signal upon which to perform thresholding 7 | % Outputs 8 | % x result 9 | % 10 | % References 11 | % ``Ideal Spatial Adaptation via Wavelet Shrinkage'' 12 | % by D.L. Donoho and I.M. Johnstone. 13 | % 14 | 15 | lamlist = [0 0 0 0 0 1.27 1.47 1.67 1.86 2.05 2.23 2.41 2.6 2.77 2.95 3.13]; 16 | [n,j] = dyadlength(y); 17 | lam = lamlist(j); 18 | x = HardThresh(y,lam); 19 | 20 | % 21 | % Copyright (c) 1993-5. Jonathan Buckheit, David Donoho and Iain Johnstone 22 | % 23 | 24 | 25 | 26 | 27 | % 28 | % Part of Wavelab Version 850 29 | % Built Tue Jan 3 13:20:39 EST 2006 30 | % This is Copyrighted Material 31 | % For Copying permissions see COPYING.m 32 | % Comments? e-mail wavelab@stat.stanford.edu 33 | -------------------------------------------------------------------------------- /Workouts/MatchingPursuit/MPWork43.m: -------------------------------------------------------------------------------- 1 | % MPWork43 -- Matching-Pursuit, WP and CP Tours on Transients Signal 2 | % 3 | qmf = MakeONFilter('Coiflet',3); 4 | % 5 | figure; 6 | % tr = MakeExample('transients'); 7 | tr = ReadSignal('Transients'); 8 | SigName = 'Transients'; 9 | [wpatoms,wpresid] = WPPursuitTour('P',tr,9, qmf,300,SigName); 10 | subplot(2,2,3); axis([0 500 -5 5]) 11 | subplot(2,2,4); brighten(-.5) 12 | ifprint(gcf,'mpfig431.ps'); 13 | % 14 | figure; 15 | [cpatoms,cpresid] = CPPursuitTour('P',tr, 6,'Sine', 300,SigName); 16 | subplot(2,2,3); axis([0 500 -5 5]) 17 | subplot(2,2,4); brighten(-.5) 18 | ifprint(gcf,'mpfig432.ps'); 19 | 20 | 21 | 22 | 23 | % 24 | % Part of Wavelab Version 850 25 | % Built Tue Jan 3 13:20:43 EST 2006 26 | % This is Copyrighted Material 27 | % For Copying permissions see COPYING.m 28 | % Comments? e-mail wavelab@stat.stanford.edu 29 | -------------------------------------------------------------------------------- /Workouts/Toons/toon0811.m: -------------------------------------------------------------------------------- 1 | % toon0811 -- Show some Cosine Packets 2 | % 3 | posarray = [ 1 0 64; 2 1 32; 3 2 16; 4 4 8 ; 5 8 4; 6 16 2; 7 32 1]; 4 | sz = size(posarray); 5 | nr = sz(1); 6 | n = 512; 7 | w = zeros(1,n); 8 | t = (.5:(n-.5)) ./n; 9 | % 10 | clf; subplot(111); 11 | LockAxes([0 1 0 (nr+1)]); 12 | % 13 | title('Some Cosine Packets') 14 | for iter = 1:nr, 15 | d = posarray(iter,1); 16 | b = posarray(iter,2); 17 | k = posarray(iter,3); 18 | w = MakeCosinePacket(d,b,k,'Sine',7,n); 19 | plot(t,(iter)+w) 20 | txt = sprintf('(%1.0f,%2.0f,%2.0f)',d,b,k); 21 | text(.87,(iter)+.275,txt); 22 | end 23 | 24 | 25 | 26 | 27 | 28 | % 29 | % Part of Wavelab Version 850 30 | % Built Tue Jan 3 13:20:43 EST 2006 31 | % This is Copyrighted Material 32 | % For Copying permissions see COPYING.m 33 | % Comments? e-mail wavelab@stat.stanford.edu 34 | --------------------------------------------------------------------------------