Resample operator algorithms

The Resample operators resample pings in both the range and the along-track directions using one of the available operations. Resampling works by creating cells, based on the settings specified on the Resample page of the Variable properties dialog box, identifying which samples fall within each cell and applying statistical operation to those samples - very typically a mean operation. Sample Sv, TS and unspecified dB are converted to the linear domain for intermediate calculations with output values reconverted to the dB domain.

The diagram below shows an original sample in a grid of such samples (black) and a resampled sample (red).

general diagram for resampling

Where:

i is the index for pings in the operand
I is the index for pings in the output variable
j is the index for samples in an operand ping := {0 ... n-1}
J is the index for resampled samples in an output ping := {0 ... m-1}
n is the number of samples in an operand ping
m is the number of samples in the output ping. Entered as Output Number of Datapoints on the Resample page of the Variable properties dialog box
' denotes a value associated with the output variable (as distinct from the operand variable)
ri, j is the range of sample j in ping i of the operand variable
r'I, J is the range of sample J in ping I of the output variable
Ri, j is the near range boundary of sample j in ping i of the operand variable.
    for j = 1 to n-1

Ri, 0 is the start range of ping i in the operand (m).

Ri, n is the stop range of ping i in the operand (m).

R'I, J is the near range boundary of sample J in ping I of the output variable

R'I, 0 is the start range of the output ping (m).
Specified in the Output section of the Resample page of the Variable properties dialog box
Entered as Output Start Range when Custom ranges is selected
Is the start range from operand 1 when Use ranges from operand 1 is selected

R'I, m is the stop range of the output ping (m).
Specified in the Output section of the Resample page of the Variable properties dialog box
Entered as Output Start Range when Custom ranges is selected
Is the stop range from operand 1 when Use ranges from operand 1 is selected

Custom ranges > Start range specifies the start range of the output ping.

Custom ranges > Stop range specifies the Stop range of the output ping.

Custom ranges > Number of datpoints specifies the sample resolution of the output ping.

When Custom ranges are specified, the range resampling can look like a zoom.

di, j is the distance of ping i for sample j in the operand variable (from ping 0 in the same variable).

note: this may be measured in meters (if the resample by distance interval operator is used) or seconds (if the resample by time interval operator is used) or in pings (if the resample by number of pings operator is used). When measured in pings, only integral values are used (whole ping numbers).
d'I, J is the distance of ping I for sample J in the output variable (from ping 0 in the same variable).
Di, j is the near boundary distance of ping i for sample j in the operand variable (from ping 0 in the same variable).
    for i = 1 to m-1

D0, j = 0

Dm, j = dm-1, j + (dm-1, jDm-1, j)

D'I, J is the near boundary distance of ping I for sample J in the output variable (from ping 0 in the same variable).

Operations

The operations available can be divided into two groups, mean statistics and sampled statistics . They are described individually below:

Mean statistics

The mean statistics are used when you choose Mean for the Resampling operation on the Resample page of the Variable properties dialog box. The mean is taken either with or without weighting or by linear interpolation with respect to the selected settings.

Unwieghted and weighted means

An unweighted mean is a mean with no weighting (alternately a mean with uniform weighting). A weighted mean takes into account the area of overlap between operand samples and output samples and weights contributions accordingly.

Note: An Echoview 5.2 change to the unwieghted mean algorithm - samples are included if their midpoints are within the range of the output bin and empty bins are filled with the weighted mean. This change is intended to give a better result for the Mean resampling

Unwieghted and weighted means are calculated as:

Equation 1

Where:

yI, J =

the value of sample J in the output ping I

xi, j =

the value of sample j in the operand ping i

wi, j = w1 x w2

where:

w1 is the sample weighting for the range direction, calculated as follows:
  w1 = 1 for an Unweighted mean calculation (or the second step of Interpolated mean calculation as described below)
m(Ri, j+1, R'I, J+1 )M(Ri, j, R'I, J ) for a Weighted mean calculation.
       
w2 is the sample weighting for the along-track direction, calculated as follows:
  w2 = 1 for an Unweighted mean calculation.
m(Di, j+1 , D'I, J+1 )M(Di, j , D'I, J ) for a Weighted mean calculation.
m(a,b) is the minimum of a and b
M(a,b) is the maximum of a and b
X = the set of all samples in the operand ping
Y = the set of all samples in the operand ping which contribute to the resulting sample J, defined as:

for unweighted means,

Y := { i,j Î X: R' I, J < ri, j R'I, J+1 Ù
    D' I, J < di, j D'I, J+1}

for weighted means,

Y := { i,j Î X: [R'I, J ≤ Ri, j ≤ R'I, J+1 Ú 
    R'I, J ≤ Ri, j+1 ≤ R'I, J+1 Ú 
  (Ri, j ≥ R'I, J Ù Ri, j+1 ≤ R'I, J+1)]Ù
    [D' I, J < Di, j < D'I, J+1 Ú
    D'I, J ≤ Di, j+1 ≤ D'I, J+1 Ú
    (Di, j ≥ D'I, J  Ù  Di, j+1 ≤ D'I, J+1)]}

See the introductory diagram above for definitions of any remaining symbols.

Interpolated mean

A linear interpolated mean is available only in the range direction. In the along-track driection an unweighted or weighted mean is always used.

The operand is first resampled to a temporary intermediate echogram with a interpolation as follows:

Equation 2

Where:

yI, J = the value of sample J in the output ping I,if Weighting/interpolation in the range direction is selected and the sample thickness is decreased.
I = i   that is, the temporary intermediate echogram has one ping for every operand ping, interpolation is applied in the range direction only.
xi, j = the value of sample j in the operand ping i

See the introductory diagram above for definitions of any remaining symbols.

The temporary intermediate echogram is then resampled using the unweighted or weighted mean as described above where xi, j (in equation 1) = yI, J (in equation 2) and J = j (that is, the output echogram has one sample row for every sample row in the termporary intermediate variable, resampling is applied only in the distance direction).

Sampled statistics

Minimum

The minimum calculates yI, J (the value of sample J in the output ping I) as:

yI, J = W0

Where:

yI, J = the value of sample J in the output ping I
W0 = the value of sample 0 (the first sample) in the list W — (defined below)
X = the set of all samples in the operand
Y =

the set of all samples in the operand which contribute to the resulting sample I, J — defined as:

 

Y := {i,j Î X: R' I, J < ri, j R'I, J+1 Ù D' I, J < di, j D'I, J+1}

W =

the ordered list of sample values xi, j for all i,j in set Y, being (W0, W1, W2, .... WN-1) such that Wi ≤ Wi+1

N = the number of samples in the list W

See the introductory diagram above for definitions of any remaining symbols.

Maximum

The maximum calculates yI, J (the value of sample J in the output ping I) as:

yI, J = W0

Where:

yI, J = the value of sample J in the output ping I
W0 = the value of sample 0 (the first sample) in the list W — (defined below)
X = the set of all samples in the operand ping
Y =

the set of all samples in the operand which contribute to the resulting sample I, J — defined as:

 

Y := {i,j Î X: R' I, J < ri, j R'I, J+1 Ù D' I, J < di, j D'I, J+1}

W =

the ordered list of sample values xi, j for all i,j in set Y, being (W0, W1, W2, .... WN-1) such that Wi ≥ Wi+1 

N = the number of samples in the list W

See the introductory diagram above for definitions of any remaining symbols.

Median

The median calculates yI, J (the value of sample J in the output ping I) as:

yI, J =   Wk       if N is odd
(W k+Wk+1)/2   if N is even

Where:

yI, J = the value of sample J in the output ping I
Wk = the value of sample k in the list W — (defined below)
k = ëN/2û *
N = the number of samples in the list W
X = the set of all samples in the operand
Y =

the set of all samples in the operand which contribute to the resulting sample I, J — defined as:

 

Y := {i,j Î X: R' I, J < ri, j R'I, J+1 Ù D' I, J < di, j D'I, J+1}

W =

the ordered list of sample values xi, j for all i,j in set Y, being (W0, W1, W2, .... WN-1) such that Wi ≤ Wi+1

See the introductory diagram above for definitions of any remaining symbols.

Percentile

The percentile calculates yI, J (the value of sample J in the output ping I) as:

yI, J = Wk + (Wk+1 - Wk) (k' - k)

Where:

yI, J = the value of sample J in the output ping I
Wk = the value of sample k in the list W — (defined below)
k = ëk'û *
k' = N x P/100
N = the number of samples in the list W
P = the Percentile entered on the Resample page of the Variable properties dialog box
X = the set of all samples in the operand
Y =

the set of all samples in the operand which contribute to the resulting sample I, J — defined as:

 

Y := {i,j Î X: R' I, J < ri, j R'I, J+1 Ù D' I, J < di, j D'I, J+1}

W = the ordered list of sample values xi, j for all i,j in set Y, being (W0, W1, W2, .... WN-1) such that Wi ≤ Wi+1

See the introductory diagram above for definitions of any remaining symbols.

See also

About virtual variables
Resample operators

Footnote:

*Floor function ëxû, gives the largest integer less than or equal to x.