- function o= ls_inv_filter(w,wavelet,mu)
- %LS_INV_FILTER: Spiking deconvolution
- %
- % This program computes an inverse filter (Spiking filter)
- % from an estimate of a seismic wavelet. The actual
- % output (convolution of the filter with the wavelet) is
- % also computed.
- %
- % [f,o] = LS_INV_FILTER(w,NF,Lag,mu)
- %
- % IN w: the wavelet
- % NF: lenght if the inverse filter
- % Lag: the position of the spike in the desired output
- % mu: Prewhitening in %
- %
- % OUT f: the filter
- % o: the ouput or convolution of the filter with
- % the wavelet
- %
- % Example:
- %
- % w = [2,1]; % the wavelet
- % [f,o] = ls_inv_filter(w,20,1,2); % the filter and the output
- % figure(1); plot(f);title('Filter')
- % figure(2); plot(o);title('Wavelet \otimes Filter')
- NW = max(size(w)); % lenght of the wavelet
- NF=max(size(wavelet));
- [mc,mr]=size(wavelet);
- if mc <= mr; wavelet = wavelet'; end;
- [mc,mr]=size(w);
- if mc <= mr; w = w'; end;
- b=conv(wavelet,w);
- C = convmtx(w,NF); % Convolution matrix
- R = C'*C+mu*eye(NF)/100.; % Toeplitz Matrix
- rhs = C'*b; % Right hand side vector
- f = inv(R)*rhs; % Filter
- o = conv(f,w); % Actual output
- % o=o(NF:NW+(NF-1),:);
- % o=o(1:NW,:);
- n=floor(NF/2);
- o=o(n:NW+(n-1),:);
复制代码 |