Hi Mucong Li,
Thanks for your post, and sorry for the delay in replying. We've all been on holiday for Christmas.
k-Wave solves the acoustic wave equation so will include the near field, but (like any model) it is bandlimited, ie. it only includes frequencies below some maximum frequency. This is because of the grid spacing, as you say. For example, if you put in a time series which contains frequencies higher than can be supported by the grid, they will not propagate, and so, to that extent, the signal will be low-pass filtered and you may see some 'ringing' where the signal changes rapidly. If using a single cycle of a sine wave you may see spurious oscillations at the ends of the cycle where the signal changes sharply to zero. This can be dealt with by removing those frequencies from the source signal by usingfilterTimeSeries
.
There are two ways in which sources can be applied in k-Wave and they are selected by setting source.p_mode
to either 'additive'
, which is the default, or 'dirichlet'
. 'Additive' mode adds each successive value of source.p
to the existing value of the pressure at the source points, whereas 'Dirichlet' mode replaces them, ie. discards the current value and forces the source points to take the value in source.p
. There are two significant differences between these modes. First, waves are reflected by the source points when in 'Dirichlet' mode - effectively the source points behave like a Dirichlet boundary with an imposed time varying pressure (given by source.p
), but waves are not reflected when in 'additive' mode. Second, the amplitude of the source at the source point when in 'Dirichlet' mode will be the same as the amplitude defined in source.p
; they must be as these values are imposed directly on the source points. In 'additive' mode, however, it is a bit more involved.
In 'additive' mode, the value in source.p
is added to the pressure already at the source point, and the resulting pressure at any given point will be the convolution of source.p
with the k-Wave impulse response function. In the case of a homogeneous medium k-Wave's impulse response function will be the convolution of the free space Green's function with the bandlimited interpolant (see the k-Wave manual.) This will have the effect of changing the effective amplitude of the source. k-Wave includes a scaling factor which accounts for this when source.p
is sufficiently long (also described in the Manual).
Hope that helps.
Ben