00001 """/*! 00002 @page ExampleSet1 Example Set 1 00003 00004 This examples is for the SLIMpy beginer. 00005 We will build up to solving the l1 minimization problem. 00006 We denote @b y a seismic trace corrupted by swell noise. A 00007 possible approach to denoising takes advantage of the sparsity of 00008 swell noise in the DCT domain and of seismic signal in the wavelet 00009 domain. The forward problem is as follows: 00010 00011 \f[ 00012 \textbf{y} 00013 = \left[ 00014 \begin{array}{ccc} 00015 \textbf{PC} & \vline & \textbf{W} 00016 \end{array}\right] 00017 \left[ 00018 \begin{array}{c} 00019 x_1 \\ 00020 \vdots \\ 00021 x_N \\ 00022 \hline 00023 x_{N+1} \\ 00024 \vdots \\ 00025 x_{2N} 00026 \end{array}\right] 00027 \f] 00028 00029 In this equation, \f$\left[ 00030 \begin{array}{ccc} 00031 x_1 & \ldots & x_N 00032 \end{array}\right]^T 00033 \f$ represents the DCT contribution in the total data and \f$\left[ 00034 \begin{array}{ccc} 00035 x_{N+1} & \ldots & x_{2N} 00036 \end{array}\right]^T 00037 \f$ the wavelet contribution. The operators @f$\textbf{P}@f$, @f$\textbf{C}@f$, 00038 and @f$\textbf{W}@f$ are a frequency weighting, the DCT, and the wavelet 00039 transforms, respectively. The inverse problem is as follows: 00040 00041 \f[ 00042 \tilde{\textbf{x}} = \arg\min \|\textbf{x}\|_1\quad\mbox{s.t.}\quad\left[ 00043 \begin{array}{ccc} 00044 \textbf{PC} & \vline & \textbf{W} 00045 \end{array}\right]\textbf{x}=\textbf{y} 00046 00047 \f] 00048 and the denoise signal, @b s , is given by 00049 00050 \f[ 00051 \textbf{s} = \textbf{W} 00052 \left[ 00053 \begin{array}{c} 00054 \tilde{x}_{N+1} \\ 00055 \vdots \\ 00056 \tilde{x}_{2N} 00057 \end{array}\right]. 00058 \f] 00059 00060 \par Learing objectives: 00061 - To start a simple slimpy script. 00062 - Learn about SLIMpy. 00063 - Create a black box package to solve a general problem 00064 00065 \par Inputs: 00066 - \a swellnoise.rsf the synthetic model of the swell noise 00067 - \a sig.rsf the synthetic model of the data 00068 - \a data.rsf the synthetic model produced from sfsigmoid 00069 \par Outputs: 00070 - \a esig.rsf the esimated signal 00071 - \a enoise.rsf the esimated noise 00072 - \a residual.rsf the diffrence between the data, esimated signal and esimated noise 00073 \par Prerequisite: 00074 - SLIMpy and ContribSLIMpy 00075 - Madagascar 00076 - SCons 00077 - All steps require `scons' to be run from the Set1 directory to create inputs. 00078 00079 @section s1 Step 1 00080 Link: @subpage es1step1 00081 @copydoc es1step1 00082 00083 @section s2 Step 2 00084 Link: @subpage es1step2 00085 @copydoc es1step2 00086 00087 @section s3 Step 3 00088 Link: @subpage es1step3 00089 @copydoc es1step3 00090 00091 @section s4 Step 4 00092 Link: @subpage es1step4 00093 @copydoc es1step4 00094 00095 @section s5 Step 5 00096 Link: @subpage es1step5 00097 @copydoc es1step5 00098 00099 @section s6 Step 6 00100 Link: @subpage es1step6 00101 @copydoc es1step6 00102 00103 @section s7 Step 7 00104 Link: @subpage es1step7 00105 @copydoc es1step7 00106 00107 */""" 00108 00109 00110 from rsfproj import * 00111 00112 00113 Flow( 'swellnoise',None, 'math n1=512 output="0.05*cos(x1*6*3.145)" ' ) 00114 Flow( 'sig', None, 00115 ''' 00116 spike n1=512 nsp=5 k1=12,123,214,435 mag=1,-.85,-.71,.5 | 00117 ricker1 00118 ''' ) 00119 00120 Flow( 'data', ['sig','swellnoise'], 00121 'math sig=${SOURCES[1]} output="input+sig" ' ) 00122 00123 Result('swellnoise', 'graph' ) 00124 Result('sig', 'graph' ) 00125 Result('data', 'graph' ) 00126 00127 End() 00128 00129 00130