sfderiv applies the first derivative filter.

The algorithm implemented in this program is described in the paper

Pei, S.-C., and P.-H. Wang, 2001, *Closed-form design of maximally flat FIR Hilbert transformers, differentiators, and fractional delayers by power series expansion*: IEEE Trans. on Circuits and Systems, v. 48, No. 4, 389-398.

It is based on the Taylor expansion of the inverse sine function

$$\arcsin{x} = \displaystyle \sum_{n=0}^{\infty} \frac{(2n)!}{4^n\,(n!)^2\,(2n+1)}\,x^{2n+1}$$

which turns into an expansion of the ideal derivative filter into a chain of digital filters. The **order=** parameter controls the order of the expansion and the accuracy-efficiency trade-off. The following example from rsf/rsf/sfderiv shows the frequency responses and the impulse responses for differentiators of different orders

An alternative is sfigrad, which implements a simple first-order derivative. igrad is more efficient and adequate when computing derivatives of smooth functions.

### Previous programs of the month

Madagascar development blog8 years agosfdip estimates a local slope (dip) using the plane-wave destruction algorithm.

The dip is measured in time samples. If α is the dip angle, then the output of sfdip corresponds to the dimensionless quantity p=tanα.

The following example

Madagascar development blog8 years agosffft3 implements a complex-to-complex Fast Fourier Transform (FFT) along an arbitrary axis.

The FFT library that Madagascar uses is KISS FFT, created by Mark Borgerding. KISS stands for Keep it simple, Stupid! KISS FFT may not be as fast as FFTW but i

Madagascar development blog8 years agoPrevious programs of the month:sffft3sfdipsfderivsfgrey3sfspectrasfnoisesfgraphsfclipsfagcsfenvelopesfcontoursfsmooth

Madagascar development blog8 years agosfpick performs automatic picking from semblance-like panels.

The underlying algorithm is described in Appendix B of the paper Velocity analysis using AB semblance and is inspired by the method of virtual endoscopy in medical imaging.

The following

Madagascar development blog8 years agosfiwarp performs mapping between different coordinates. If you have sampled functions f(x) and y(x), sfiwarp with inv=y (the default) finds sampled f(y). If inv=n, sfiwarp takes f(y) and y(x) and finds f(x). In both cases, the sampled y(x) function is sup

Madagascar development blog8 years agosfpick performs automatic picking from semblance-like panels.

The underlying algorithm is described in Appendix B of the paper Velocity analysis using AB semblance and is inspired by the method of virtual endoscopy in medical imaging.

The following

Madagascar development blog8 years agosfkirmod is a program for modeling seismic reflection data using the Kirchhoff method. According to this method, the reflection response is computed by integrating over the reflector surface. For a theoretical derivation, see, for example,

Haddon, R. A

Madagascar development blog8 years agosfbandpass implements bandpass filtering using the Butterworth algorithm.

The desired bandwidth is specified by low and high frequencies (in Hertz) flo= and fhi=.

A continuous low-pass Butterworth filter is given by

The actual filtering is imp

Madagascar development blog8 years agosfhalfint implements half-order integration or differentiation, a filtering operation common in 2-D imaging operators such as as slant stacking or Kirchhoff migration.

By default, sfhalfint performs half-order integration. To apply half-order different

Madagascar development blog7 years agosfricker1 implements 1-D convolution with the Ricker wavelet.

The following example from rsf/rsf/wedge shows convolution modeling with a wedge model using sfricker1.

The convolution is implemented in the frequency domain, where the Ricker wavele

Madagascar development blog7 years agosfpwd implements plane-wave destruction, a filter that attenuates locally plane-wave events, as described in the paper Applications of plane-wave destruction filters.

The following example from jsg/diffr/gom shows a seismic section before and after an

Madagascar development blog7 years agosfpow multiplies the input data by a gain function of the form Gx1x2 ,xn=x1p1x2p2⋯xnpn The powers p1,p2, ,pn are given by pow1=, pow2=, etc. parameters.

For backward compatibility, sftpow tpow= is an alias for sfpow pow1=.

The following examp

Esteban7 years agoI have been looking into this paper for a class in numerical solutions to PDEs to get optimized coefficients. d2fdt2.rsf).

This paper gives good approximation to first order differentiators. What about second to n order derivatives?

To get around this I use Fornberg, 1988 paper which gives similar results for first order derivatives, and optimized ones for higher order ones (which is much better than doing

After I am done with classes, I will put something under my user.

Cheers,

Esteban

Esteban7 years agoI just added a new example (book/rsf/rsf/sfnderiv) comparing sfderiv with sfnderiv, a new

program based on Fornberg, 1988 paper.

I demonstrate that both programs have equal impulse response for first derivatives.

For higher order derivatives sfnderiv is better that piping several passes of sfderiv.