# A New Wavelet Thresholding Function Based on Hyperbolic Tangent Function

Authors: Can He; Jianchun Xing; Juelong Li; Qiliang Yang; Ronghao Wang
Journal: Mathematical Problems in Engineering
 (2015)

---

## Abstract

Thresholding function is an important part of the wavelet threshold denoising method, which can influence the signal denoising effect significantly. However, some defects are present in the existing methods, such as function discontinuity, fixed bias, and parameters determined by trial and error. In order to solve these problems, a new wavelet thresholding function based on hyperbolic tangent function is proposed in this paper. Firstly, the basic properties of hyperbolic tangent function are analyzed. Then, a new thresholding function with a shape parameter is presented based on hyperbolic tangent function. The continuity, monotonicity, and high-order differentiability of the new function are theoretically proven. Finally, in order to determine the final form of the new function, a shape parameter optimization strategy based on artificial fish swarm algorithm is given in this paper. Mean square error is adopted to construct the objective function, and the optimal shape parameter is achieved by iterative search. At the end of the paper, a simulation experiment is provided to verify the effectiveness of the new function. In the experiment, two benchmark signals are used as test signals. Simulation results show that the proposed function can achieve better denoising effect than the classical hard and soft thresholding functions under different signal types and noise intensities.


---

## Body

## 1. Introduction

Signals are often contaminated by noise during their acquisition, processing, and transmission because of the measurement system error and the environment interference. In order to solve this classical problem, a variety of signal denoising methods, such as median filtering [1], particle filtering [2] and H-infinity filtering [3, 4], were proposed. Recently, due to multiresolution and low entropy, wavelet transform has become an effective technology to study signal denoising. Many methods based on wavelet theory were proposed [5–8], such as wavelet coefficients modulus maxima method, wavelet correlation method, and wavelet threshold method. Among these methods, wavelet threshold denoising has been the most widely used, because of its simple calculation and good effect. Wavelet threshold method was proposed by Donoho and Johnstone, whose main idea is to reconstruct signal on the basis of thresholding coefficients. Therefore, thresholding function is one of the factors that affect the denoising effect. Donoho and Johnstone [8] considered that only a small number of wavelet coefficients were necessary to reconstruct the signal and proposed a classical method, namely, hard thresholding function. In this function, coefficients with absolute values smaller than the threshold were set to zero, and the bigger coefficients remained unchanged. Sanam and Shahnaz [9] supposed that forcedly setting the small coefficients to zero was unreasonable and presented an improved hard thresholding function. In order to make thresholding function continuous, Donoho [10] proposed a soft thresholding function that required the wavelet coefficients to minus the threshold to achieve the new coefficients. Phinyomark et al. [11] modified the soft thresholding function and proposed a thresholding function based on hyperbolic function. By combining the advantages of hard and soft thresholding functions, Sanam and Shahnaz [12] presented a semisoft thresholding function. From the view of fuzzy theory, Shark and Yu [13] used the fuzzy membership function to process the wavelet coefficients between the fixed form threshold and the Stein unbiased risk estimate (SURE) threshold. Jia et al. [14] divided the threshold interval into several subintervals and adopted different thresholding functions in different subintervals. On the basis of analyzing the properties of the sigmoid function, Yi et al. [15] proposed an improved wavelet thresholding function based on sigmoid function. Tang et al. [16] considered that the reconstructed signal would be smoother, if the thresholding function had high-order derivatives. According to this idea, a new function having high-order derivatives was constructed as the thresholding function in [16].Although the research of wavelet thresholding functions made great development, a few deficiencies still exist. In the classical hard and soft thresholding functions, hard thresholding function is discontinuous and the reconstructed signal may give rise to ringing and pseudo-Gibbs phenomenon. Fixed bias exists between original and estimated wavelet coefficients in soft thresholding function, and it may lead to a big error in the reconstructed signal. The methods provided by [13–16] can improve the classical methods to some extent, but these new functions introduce new parameters, and there are few references on how to set these parameters.The goal of this paper is to propose a new thresholding function and solve the problem of new parameters determination. Firstly, a new thresholding function is presented on the basis of hyperbolic tangent function, and the continuity, monotonicity, and high-order differentiability of the new function are proved in theory. Then, artificial fish swarm algorithm (AFSA), which uses mean square error (MSE) as the objective function, is adopted to achieve the optimal shape parameter. At last, the final form of the new function is determined on the basis of the two abovementioned steps.The remaining parts of the paper are organized as follows. Section2 proposes the new thresholding function and proves the continuity, monotonicity, and high-order differentiability of the function. A parameter optimization strategy based on AFSA is presented in Section 3. Section 4 provides a simulated experiment using two benchmark signals to verify the effectiveness of the new thresholding function. The conclusion is given in Section 5.


## 2. Description of the New Thresholding Function

### 2.1. Introduction of Hyperbolic Tangent Function

Hyperbolic tangent function (t
a
n
h) is defined as (see Figure 1):(1)
t
a
n
h
=
e
x
-
e
-
x
e
x
+
e
-
x
.Figure 1
Curve of hyperbolic tangent function.The properties of hyperbolic tangent function are as follows.(
1
)
Domain and range: the domain of the function is (-
∞, +
∞), and its range is (
-
1,1
).
(
2
)
Continuity:t
a
n
h is a continuous function in its domain.
(
3
)
Monotonicity:t
a
n
h is a monotone increasing function in its domain.
(
4
)
Parity:t
a
n
h is an odd function in its domain.
(
5
)
Asymptote:t
a
n
h has two horizontal asymptotes, namely, y
=
1 and y
=
-
1.
(
6
)
Differentiability:t
a
n
h is differentiable in its domain, and its derivative is deduced as follows: (2)
t
a
n
h
′
=
4
e
x
+
e
-
x
2
,
wheret
a
n
h
′ is an even function in its domain and obtains its maximum at x
=
0.


### 2.2. A New Thresholding Function and Its Properties

On the basis of analyzing the hyperbolic tangent function, a new thresholding function is proposed in this paper:(3)
w
~
=
f
w
=
w
-
T
+
T
e
α
w
-
T
/
T
-
e
-
α
w
-
T
/
T
e
α
w
-
T
/
T
+
e
-
α
w
-
T
/
T
,
w
>
T
0
,
w
≤
T
w
+
T
+
T
e
α
w
+
T
/
T
-
e
-
α
w
+
T
/
T
e
α
w
+
T
/
T
+
e
-
α
w
+
T
/
T
,
w
<
-
T
,where α
∈
0
,
+
∞ is the shape parameter of the thresholding function, T
=
σ
2
l
n
(
N
) is universal threshold, σ is the average variance of the noise, andN is the signal length.The new thresholding function can be flexibly adjusted by changing the shape parameterα. When α
→
0, this function approximately transfers into soft thresholding function. If α
→
+
∞, the new function corresponds to hard thresholding function. Figure 2 illustrates the comparison between soft, hard, and proposed thresholding functions.Figure 2
Comparison of soft, hard, and proposed thresholding functions withT
=
20.The new thresholding functionf
(
w
) has the following properties.Theorem 1.
f
(
w
) is a continuous function in the domain of -
∞
,
+
∞.Proof.
When(4)
w
>
T
,
f
w
=
w
-
T
+
T
e
α
w
-
T
/
T
-
e
-
α
w
-
T
/
T
e
α
w
-
T
/
T
+
e
-
α
w
-
T
/
T
.So,(5)
l
i
m
w
→
T
+
f
w
=
l
i
m
w
→
T
+
w
-
T
+
T
e
a
w
-
T
/
T
-
e
-
a
w
-
T
/
T
e
a
w
-
T
/
T
+
e
-
a
w
-
T
/
T
=
T
-
T
+
T
e
0
-
e
0
e
0
+
e
0
=
0
.
When(6)
w
≤
T
,
f
w
=
0
.Thus,(7)
l
i
m
w
→
T
-
f
w
=
0
,
f
T
=
0
.
Considering (5) and (7), we obtain lim
w
→
T
-
⁡
f
(
w
)
=
lim
w
→
T
+
⁡
f
(
w
)
=
f
(
T
).
Therefore,f
(
w
) is a continuous function at w
=
T.
Following above proof line, we can obtain thatf
(
w
) is also continuous at w
=
-
T.
That is,f
(
w
) is a continuous function in the domain of -
∞
,
+
∞.
Proof is completed.Remark 2.
According to Theorem1, f
(
w
) is a continuous function in its domain. In signal denoising, this property helps avoid pseudo-Gibbs phenomenon caused by function discontinuity.Theorem 3.
f
(
w
) is a monotonous function in the domain of -
∞
,
+
∞.Proof.
When(8)
w
>
T
,
f
w
=
w
-
T
+
T
e
α
w
-
T
/
T
-
e
-
α
w
-
T
/
T
e
α
w
-
T
/
T
+
e
-
α
w
-
T
/
T
.So,(9)
f
w
′
=
1
+
4
α
e
x
+
e
-
x
2
.
Consideringα
∈
0
,
+
∞, we can obtain f
w
′
>
0
.
That is,f
(
w
) is a monotonous function in the domain of T
,
+
∞.
Following above proof line, we can obtain thatf
(
w
) is also a monotonous function in the domain of -
∞
,
-
T.
When(10)
w
≤
T
,
f
w
≡
0
,
Considerf
(
w
) is a continuous function in the domain of -
∞
,
+
∞.
Thus,f
(
w
) is a monotonic nondecreasing function in the domain of -
∞
,
+
∞.
Proof is completed.Remark 4.
According to Theorem3, f
(
w
) is a monotonic nondecreasing function in its domain, which ensures that f
(
w
) has the same variation trend of hard and soft thresholding functions.Theorem 5.
f
(
w
) is a high-order differentiable function in the domain of -
∞
,
-
T and T
,
+
∞, respectively.Proof.
When(11)
w
>
T
,
f
w
=
w
-
T
+
T
e
α
w
-
T
/
T
-
e
-
α
w
-
T
/
T
e
α
w
-
T
/
T
+
e
-
α
w
-
T
/
T
.Thus, f
(
w
) is an elementary function.
According to the property of elementary function, we can obtain thatf
(
w
) is a high-order differentiable function in the domain of T
,
+
∞.
Following above proof line, we can obtain thatf
(
w
) is also high-order differentiable in the domain of -
∞
,
-
T.
That is,f
(
w
) is a high-order differentiable function in the domain of -
∞
,
-
T and T
,
+
∞, respectively.
Proof is completed.Remark 6.
According to Theorem5, f
(
w
) is the high-order differentiable function in the domain of -
∞
,
-
T and T
,
+
∞ respectively. This advantage can make the reconstructed signal smooth.


## 2.1. Introduction of Hyperbolic Tangent Function

Hyperbolic tangent function (t
a
n
h) is defined as (see Figure 1):(1)
t
a
n
h
=
e
x
-
e
-
x
e
x
+
e
-
x
.Figure 1
Curve of hyperbolic tangent function.The properties of hyperbolic tangent function are as follows.(
1
)
Domain and range: the domain of the function is (-
∞, +
∞), and its range is (
-
1,1
).
(
2
)
Continuity:t
a
n
h is a continuous function in its domain.
(
3
)
Monotonicity:t
a
n
h is a monotone increasing function in its domain.
(
4
)
Parity:t
a
n
h is an odd function in its domain.
(
5
)
Asymptote:t
a
n
h has two horizontal asymptotes, namely, y
=
1 and y
=
-
1.
(
6
)
Differentiability:t
a
n
h is differentiable in its domain, and its derivative is deduced as follows: (2)
t
a
n
h
′
=
4
e
x
+
e
-
x
2
,
wheret
a
n
h
′ is an even function in its domain and obtains its maximum at x
=
0.


## 2.2. A New Thresholding Function and Its Properties

On the basis of analyzing the hyperbolic tangent function, a new thresholding function is proposed in this paper:(3)
w
~
=
f
w
=
w
-
T
+
T
e
α
w
-
T
/
T
-
e
-
α
w
-
T
/
T
e
α
w
-
T
/
T
+
e
-
α
w
-
T
/
T
,
w
>
T
0
,
w
≤
T
w
+
T
+
T
e
α
w
+
T
/
T
-
e
-
α
w
+
T
/
T
e
α
w
+
T
/
T
+
e
-
α
w
+
T
/
T
,
w
<
-
T
,where α
∈
0
,
+
∞ is the shape parameter of the thresholding function, T
=
σ
2
l
n
(
N
) is universal threshold, σ is the average variance of the noise, andN is the signal length.The new thresholding function can be flexibly adjusted by changing the shape parameterα. When α
→
0, this function approximately transfers into soft thresholding function. If α
→
+
∞, the new function corresponds to hard thresholding function. Figure 2 illustrates the comparison between soft, hard, and proposed thresholding functions.Figure 2
Comparison of soft, hard, and proposed thresholding functions withT
=
20.The new thresholding functionf
(
w
) has the following properties.Theorem 1.
f
(
w
) is a continuous function in the domain of -
∞
,
+
∞.Proof.
When(4)
w
>
T
,
f
w
=
w
-
T
+
T
e
α
w
-
T
/
T
-
e
-
α
w
-
T
/
T
e
α
w
-
T
/
T
+
e
-
α
w
-
T
/
T
.So,(5)
l
i
m
w
→
T
+
f
w
=
l
i
m
w
→
T
+
w
-
T
+
T
e
a
w
-
T
/
T
-
e
-
a
w
-
T
/
T
e
a
w
-
T
/
T
+
e
-
a
w
-
T
/
T
=
T
-
T
+
T
e
0
-
e
0
e
0
+
e
0
=
0
.
When(6)
w
≤
T
,
f
w
=
0
.Thus,(7)
l
i
m
w
→
T
-
f
w
=
0
,
f
T
=
0
.
Considering (5) and (7), we obtain lim
w
→
T
-
⁡
f
(
w
)
=
lim
w
→
T
+
⁡
f
(
w
)
=
f
(
T
).
Therefore,f
(
w
) is a continuous function at w
=
T.
Following above proof line, we can obtain thatf
(
w
) is also continuous at w
=
-
T.
That is,f
(
w
) is a continuous function in the domain of -
∞
,
+
∞.
Proof is completed.Remark 2.
According to Theorem1, f
(
w
) is a continuous function in its domain. In signal denoising, this property helps avoid pseudo-Gibbs phenomenon caused by function discontinuity.Theorem 3.
f
(
w
) is a monotonous function in the domain of -
∞
,
+
∞.Proof.
When(8)
w
>
T
,
f
w
=
w
-
T
+
T
e
α
w
-
T
/
T
-
e
-
α
w
-
T
/
T
e
α
w
-
T
/
T
+
e
-
α
w
-
T
/
T
.So,(9)
f
w
′
=
1
+
4
α
e
x
+
e
-
x
2
.
Consideringα
∈
0
,
+
∞, we can obtain f
w
′
>
0
.
That is,f
(
w
) is a monotonous function in the domain of T
,
+
∞.
Following above proof line, we can obtain thatf
(
w
) is also a monotonous function in the domain of -
∞
,
-
T.
When(10)
w
≤
T
,
f
w
≡
0
,
Considerf
(
w
) is a continuous function in the domain of -
∞
,
+
∞.
Thus,f
(
w
) is a monotonic nondecreasing function in the domain of -
∞
,
+
∞.
Proof is completed.Remark 4.
According to Theorem3, f
(
w
) is a monotonic nondecreasing function in its domain, which ensures that f
(
w
) has the same variation trend of hard and soft thresholding functions.Theorem 5.
f
(
w
) is a high-order differentiable function in the domain of -
∞
,
-
T and T
,
+
∞, respectively.Proof.
When(11)
w
>
T
,
f
w
=
w
-
T
+
T
e
α
w
-
T
/
T
-
e
-
α
w
-
T
/
T
e
α
w
-
T
/
T
+
e
-
α
w
-
T
/
T
.Thus, f
(
w
) is an elementary function.
According to the property of elementary function, we can obtain thatf
(
w
) is a high-order differentiable function in the domain of T
,
+
∞.
Following above proof line, we can obtain thatf
(
w
) is also high-order differentiable in the domain of -
∞
,
-
T.
That is,f
(
w
) is a high-order differentiable function in the domain of -
∞
,
-
T and T
,
+
∞, respectively.
Proof is completed.Remark 6.
According to Theorem5, f
(
w
) is the high-order differentiable function in the domain of -
∞
,
-
T and T
,
+
∞ respectively. This advantage can make the reconstructed signal smooth.


## 3. A Shape Parameter Optimization Strategy Based on AFSA

### 3.1. Introduction of AFSA

Shape parameterα helps improve the flexibility of the new thresholding function. However, it also brings a problem on setting α. In the existed method, the shape parameter is determined by trial and error, which is subjective and lacks theoretical guidance. In order to solve this problem, AFSA is adopted to achieve the optimal shape parameter. AFSA is proposed by Li et al. [17] in 2002. It is considered as an effective global optimization algorithm that mainly simulates fish schooling behaviors of preying, swarming, and following. Compared with other optimization algorithms [18, 19], AFSA has the following advantages.(1)
Swarming behavior can make the algorithm get rid out of the local extremum and obtain global optimal value.
(2)
Following behavior helps an individual move fast to the optimal value. Therefore, it can improve the optimization speed.
(3)
After evaluating three behaviors, AFSA automatically selects the optimal behavior. This step assists the algorithm to obtain optimization results efficiently and rapidly.


### 3.2. Objective Function

The aim of shape parameter optimization is to improve the signal denoising effect. Several indicators are employed to measure the denoising effect, such as MSE, signal-to-noise-ratio (SNR), and smoothness. Given that MSE can accurately reflect the deviation between the reconstructed signal and the original signal, therefore, it is used most widely:(12)
M
S
E
=
∑
k
=
1
N
X
k
-
S
k
2
N
,where X
(
k
) is the noisy signal, S
(
k
) is the original signal, and N is the length of signal.When the MSE index is small, it is close between the reconstructed signal and the original signal. In this case, the denoising effect is good. If MSE index is big, the deviation between reconstructed signal and the original signal deviation is large. Here, the denoising effect is poor.In AFSA, the actual meaning of objective function is food concentration, and it is usually a maximum function. Therefore, the objective function based on MSE is constructed as follows:(13)
F
x
=
1
M
S
E
x
,where M
S
E
(
x
) represents the MSE between reconstructed signal and the original signal deviation with shape parameter equal to x.If MSE between the reconstructed signal and the original signal is small, the denoising effect is good. Here, the object function value is big. If MSE is big, the denoising effect is poor, and the object function value is small in this case.


### 3.3. Algorithm Initialization

Suppose thatX is the current position of an artificial fish (AF), fish swarm including P AFes (P is the number of the artificial fish) is randomly generated as (X
1
⋯
X
p). Y
=
F
(
X
) is the objective function of X, which represents food concentration of position X. The AF realizes external perception by its vision. Visual represents the visual distance of an AF. Step is the length of moving step, M is the maximum of preying try number, and W is the crowd factor (
0
<
W
<
1
).


### 3.4. Description of AF Behavior

#### 3.4.1. Preying Behavior

Suppose that an AF’s current state isX
i. A new state X
j is selected randomly in its visual field according to the following equation:(14)
X
j
=
X
i
+
R
a
n
d
·
∗
V
i
s
u
a
l
,where R
a
n
d
· is a random function in the range [
0,1
].IfY
X
j
>
Y
X
i, the AF satisfies the condition of moving forward and it moves towards X
j as follows:(15)
X
i
t
+
1
=
X
i
t
+
R
a
n
d
·
∗
S
t
e
p
∗
X
j
-
X
i
t
X
j
-
X
i
t
,where X
i
t
+
1 represents the next state of the AF with the current state X
i
t and d
i
,
j
=
X
j
-
X
i
t is the Euclidean distance between X
i and X
j.By contrast, ifY
X
j
≤
Y
X
i, a new state X
j is selected according to (14), and then whether the new X
j satisfies the forward condition or not is judged. If after trying M times, it still did not achieve the condition of moving forward, AF is forced to move one step according to the following equation:(16)
X
i
t
+
1
=
X
i
+
R
a
n
d
·
∗
V
i
s
u
a
l
.


#### 3.4.2. Swarming Behavior

The current state of the AF isX
i, and n
f is the number of individual within its visual distance. The centre position of neighborhood individual can be calculated as follows:(17)
X
c
=
∑
j
=
1
n
f
X
j
n
f
,where X
j represents the individual within AF’s visual distance.IfY
X
c
>
Y
X
i and n
f
/
p
<
W (where P is the total number of AF and W is the crowd factor), this means that the centre X
c has the higher food concentration and its surrounding is not crowded. Thereafter, the AF’s state at the next iteration is calculated as follows: (18)
X
i
t
+
1
=
X
i
t
+
R
a
n
d
·
∗
S
t
e
p
∗
X
c
-
X
i
t
X
c
-
X
i
t
.


#### 3.4.3. Following Behavior

The current state of the AF isX
i, and X
b is the individual with the biggest food concentration within AF’s visual distance. If Y
X
b
>
Y
X
i and n
f
/
p
<
W, then the next state of AF can be computed as follows:(19)
X
i
t
+
1
=
X
i
t
+
R
a
n
d
·
∗
S
t
e
p
∗
X
b
-
X
i
t
X
b
-
X
i
t
.


### 3.5. Behavior Selection

In this paper, three biological behaviors of AF are analyzed, namely, preying behavior, swarming behavior, and following behavior. Trial method has been frequently employed to simulate the three behaviors of AF, and the behavior which can obtain the biggest food concentration is selected to be implemented.


### 3.6. Bulletin

Bulletin is used to record the optimal state of the AF and the optimal value of objective function. Every AF compares its own state with the bulletin after making movements. If the current state of AF is better, then the value on the bulletin will be replaced.


### 3.7. Termination Condition

There are two different termination methods of AFSA. One method is to set an object function value. When the value is obtained, AFSA finishes. The other method is to set a maximum of iteration number. When this number is reached, the algorithm ends. According to the characteristics of our problem, the second method should be selected. That is because the first method requires a fixed object function value. However, how to determine the suitable value is a difficult problem.


### 3.8. Steps of Shape Parameter Optimization Strategy Based on AFSA

The steps of shape parameter optimization strategy based on AFSA are provided as follows.(1)
A fish swarm is randomly generated, and algorithm parameters are set including population sizeP, maximum iteration number N, visual distanceVisual, the moving lengthStep, the largest try number of preying M, and crowding factor W.
(2)
Preying behavior, swarming behavior, and following behavior are simulated by AF, and the behavior which can obtain the biggest food concentration is implemented.
(3)
Objective function value of every AF is calculated as (13). Each AF compares its own state with the bulletin after making movements. If the current state of AF is better, then the value on the bulletin will be replaced.
(4)
Iteration numbern
u
m
=
n
u
m
+
1.
(5)
Judge whether the maximum iteration numberN is reached. If reached, output the bulletin and the corresponding AF. Otherwise, go to step (
2
).Flowchart of shape parameter optimization strategy based on AFSA is shown in Figure3.Figure 3
Flowchart of shape parameter optimization strategy based on AFSA.


## 3.1. Introduction of AFSA

Shape parameterα helps improve the flexibility of the new thresholding function. However, it also brings a problem on setting α. In the existed method, the shape parameter is determined by trial and error, which is subjective and lacks theoretical guidance. In order to solve this problem, AFSA is adopted to achieve the optimal shape parameter. AFSA is proposed by Li et al. [17] in 2002. It is considered as an effective global optimization algorithm that mainly simulates fish schooling behaviors of preying, swarming, and following. Compared with other optimization algorithms [18, 19], AFSA has the following advantages.(1)
Swarming behavior can make the algorithm get rid out of the local extremum and obtain global optimal value.
(2)
Following behavior helps an individual move fast to the optimal value. Therefore, it can improve the optimization speed.
(3)
After evaluating three behaviors, AFSA automatically selects the optimal behavior. This step assists the algorithm to obtain optimization results efficiently and rapidly.


## 3.2. Objective Function

The aim of shape parameter optimization is to improve the signal denoising effect. Several indicators are employed to measure the denoising effect, such as MSE, signal-to-noise-ratio (SNR), and smoothness. Given that MSE can accurately reflect the deviation between the reconstructed signal and the original signal, therefore, it is used most widely:(12)
M
S
E
=
∑
k
=
1
N
X
k
-
S
k
2
N
,where X
(
k
) is the noisy signal, S
(
k
) is the original signal, and N is the length of signal.When the MSE index is small, it is close between the reconstructed signal and the original signal. In this case, the denoising effect is good. If MSE index is big, the deviation between reconstructed signal and the original signal deviation is large. Here, the denoising effect is poor.In AFSA, the actual meaning of objective function is food concentration, and it is usually a maximum function. Therefore, the objective function based on MSE is constructed as follows:(13)
F
x
=
1
M
S
E
x
,where M
S
E
(
x
) represents the MSE between reconstructed signal and the original signal deviation with shape parameter equal to x.If MSE between the reconstructed signal and the original signal is small, the denoising effect is good. Here, the object function value is big. If MSE is big, the denoising effect is poor, and the object function value is small in this case.


## 3.3. Algorithm Initialization

Suppose thatX is the current position of an artificial fish (AF), fish swarm including P AFes (P is the number of the artificial fish) is randomly generated as (X
1
⋯
X
p). Y
=
F
(
X
) is the objective function of X, which represents food concentration of position X. The AF realizes external perception by its vision. Visual represents the visual distance of an AF. Step is the length of moving step, M is the maximum of preying try number, and W is the crowd factor (
0
<
W
<
1
).


## 3.4. Description of AF Behavior

### 3.4.1. Preying Behavior

Suppose that an AF’s current state isX
i. A new state X
j is selected randomly in its visual field according to the following equation:(14)
X
j
=
X
i
+
R
a
n
d
·
∗
V
i
s
u
a
l
,where R
a
n
d
· is a random function in the range [
0,1
].IfY
X
j
>
Y
X
i, the AF satisfies the condition of moving forward and it moves towards X
j as follows:(15)
X
i
t
+
1
=
X
i
t
+
R
a
n
d
·
∗
S
t
e
p
∗
X
j
-
X
i
t
X
j
-
X
i
t
,where X
i
t
+
1 represents the next state of the AF with the current state X
i
t and d
i
,
j
=
X
j
-
X
i
t is the Euclidean distance between X
i and X
j.By contrast, ifY
X
j
≤
Y
X
i, a new state X
j is selected according to (14), and then whether the new X
j satisfies the forward condition or not is judged. If after trying M times, it still did not achieve the condition of moving forward, AF is forced to move one step according to the following equation:(16)
X
i
t
+
1
=
X
i
+
R
a
n
d
·
∗
V
i
s
u
a
l
.


### 3.4.2. Swarming Behavior

The current state of the AF isX
i, and n
f is the number of individual within its visual distance. The centre position of neighborhood individual can be calculated as follows:(17)
X
c
=
∑
j
=
1
n
f
X
j
n
f
,where X
j represents the individual within AF’s visual distance.IfY
X
c
>
Y
X
i and n
f
/
p
<
W (where P is the total number of AF and W is the crowd factor), this means that the centre X
c has the higher food concentration and its surrounding is not crowded. Thereafter, the AF’s state at the next iteration is calculated as follows: (18)
X
i
t
+
1
=
X
i
t
+
R
a
n
d
·
∗
S
t
e
p
∗
X
c
-
X
i
t
X
c
-
X
i
t
.


### 3.4.3. Following Behavior

The current state of the AF isX
i, and X
b is the individual with the biggest food concentration within AF’s visual distance. If Y
X
b
>
Y
X
i and n
f
/
p
<
W, then the next state of AF can be computed as follows:(19)
X
i
t
+
1
=
X
i
t
+
R
a
n
d
·
∗
S
t
e
p
∗
X
b
-
X
i
t
X
b
-
X
i
t
.


## 3.4.1. Preying Behavior

Suppose that an AF’s current state isX
i. A new state X
j is selected randomly in its visual field according to the following equation:(14)
X
j
=
X
i
+
R
a
n
d
·
∗
V
i
s
u
a
l
,where R
a
n
d
· is a random function in the range [
0,1
].IfY
X
j
>
Y
X
i, the AF satisfies the condition of moving forward and it moves towards X
j as follows:(15)
X
i
t
+
1
=
X
i
t
+
R
a
n
d
·
∗
S
t
e
p
∗
X
j
-
X
i
t
X
j
-
X
i
t
,where X
i
t
+
1 represents the next state of the AF with the current state X
i
t and d
i
,
j
=
X
j
-
X
i
t is the Euclidean distance between X
i and X
j.By contrast, ifY
X
j
≤
Y
X
i, a new state X
j is selected according to (14), and then whether the new X
j satisfies the forward condition or not is judged. If after trying M times, it still did not achieve the condition of moving forward, AF is forced to move one step according to the following equation:(16)
X
i
t
+
1
=
X
i
+
R
a
n
d
·
∗
V
i
s
u
a
l
.


## 3.4.2. Swarming Behavior

The current state of the AF isX
i, and n
f is the number of individual within its visual distance. The centre position of neighborhood individual can be calculated as follows:(17)
X
c
=
∑
j
=
1
n
f
X
j
n
f
,where X
j represents the individual within AF’s visual distance.IfY
X
c
>
Y
X
i and n
f
/
p
<
W (where P is the total number of AF and W is the crowd factor), this means that the centre X
c has the higher food concentration and its surrounding is not crowded. Thereafter, the AF’s state at the next iteration is calculated as follows: (18)
X
i
t
+
1
=
X
i
t
+
R
a
n
d
·
∗
S
t
e
p
∗
X
c
-
X
i
t
X
c
-
X
i
t
.


## 3.4.3. Following Behavior

The current state of the AF isX
i, and X
b is the individual with the biggest food concentration within AF’s visual distance. If Y
X
b
>
Y
X
i and n
f
/
p
<
W, then the next state of AF can be computed as follows:(19)
X
i
t
+
1
=
X
i
t
+
R
a
n
d
·
∗
S
t
e
p
∗
X
b
-
X
i
t
X
b
-
X
i
t
.


## 3.5. Behavior Selection

In this paper, three biological behaviors of AF are analyzed, namely, preying behavior, swarming behavior, and following behavior. Trial method has been frequently employed to simulate the three behaviors of AF, and the behavior which can obtain the biggest food concentration is selected to be implemented.


## 3.6. Bulletin

Bulletin is used to record the optimal state of the AF and the optimal value of objective function. Every AF compares its own state with the bulletin after making movements. If the current state of AF is better, then the value on the bulletin will be replaced.


## 3.7. Termination Condition

There are two different termination methods of AFSA. One method is to set an object function value. When the value is obtained, AFSA finishes. The other method is to set a maximum of iteration number. When this number is reached, the algorithm ends. According to the characteristics of our problem, the second method should be selected. That is because the first method requires a fixed object function value. However, how to determine the suitable value is a difficult problem.


## 3.8. Steps of Shape Parameter Optimization Strategy Based on AFSA

The steps of shape parameter optimization strategy based on AFSA are provided as follows.(1)
A fish swarm is randomly generated, and algorithm parameters are set including population sizeP, maximum iteration number N, visual distanceVisual, the moving lengthStep, the largest try number of preying M, and crowding factor W.
(2)
Preying behavior, swarming behavior, and following behavior are simulated by AF, and the behavior which can obtain the biggest food concentration is implemented.
(3)
Objective function value of every AF is calculated as (13). Each AF compares its own state with the bulletin after making movements. If the current state of AF is better, then the value on the bulletin will be replaced.
(4)
Iteration numbern
u
m
=
n
u
m
+
1.
(5)
Judge whether the maximum iteration numberN is reached. If reached, output the bulletin and the corresponding AF. Otherwise, go to step (
2
).Flowchart of shape parameter optimization strategy based on AFSA is shown in Figure3.Figure 3
Flowchart of shape parameter optimization strategy based on AFSA.


## 4. Simulation Experiment

### 4.1. Shape Parameter Determination

To verify the denoising effect of the new thresholding function, we must firstly determine the shape parameter. AFSA is adopted to search the optimal shape parameter. The analysis of main parameters in AFSA is given as follows.


#### 4.1.1. Visual Distance (Visual) and Moving Length (Step)

LargeVisual is of benefit to quick global optimization. But ifVisual is set too large, the optimization process may be premature convergence. SmallStep is better for local optimization, while it may decrease the velocity of evolution.


#### 4.1.2. Crowd Factor (W)

IfW is set too large, the velocity of evolution will increase, but AFSA has a risk of premature convergence in this case.


#### 4.1.3. Number of AF (P)

When the number of AF is large, the capacity of getting out of local extremum is strong, but computational amount of every iteration will increase.Based on the analysis above, the parameters in AFSA are set as in Table1.Table 1
Parameters setting.
P
N
M
Visual
W
Step
100
50
100
1
0.618
0.05Two classic benchmark signals, namely, Bumps signal and Doppler signal, are used as test signals. Two strengths of white Gaussian noise, that is,σ
=
3 and σ
=
5, are added to the test signals in the experiments. The steps of shape parameter optimization strategy are provided in Figure 3. The optimization algorithm is run 100 times. The optimal shape parameters of different signals are obtained as in Table 2. Their iteration curves are shown in Figure 4.Table 2
Optimal shape parameters.
Bumps,σ
=
3
Bumps,σ
=
5
Doppler,σ
=
3
Doppler,σ
=
5
α
0.95
2.85
0.70
1.35Figure 4
Curves of different signals.
(a)
Bumps,σ
=
3
(b)
Bumps,σ
=
5
(c)
Doppler,σ
=
3
(d)
Doppler,σ
=
5


### 4.2. Denoising Effect Verification of the New Thresholding Function

In this experiment, the test signals are selected the same as in Section4.1. Stationary wavelet transform is adopted in this paper [20], wavelet basis adopts sym6 wavelet [21], and wavelet decomposition scale is set to be 3. Universal threshold is selected as the standard threshold. The proposed function is used as thresholding function in the experiment of wavelet threshold denoising. In order to verify the superiority of the proposed function, the classical hard and soft thresholding functions are chosen as comparative functions. The detailed steps of wavelet threshold denoising experiment were given by [8]. All the experiments were calculated on the same computer with the CPU frequency of 2 GHz, and Matlab 7.0 is used as the computation software.In order to measure the denoising effects of different thresholding functions, MSE (equation (12)) and SNR are selected as comparative index:(20)
S
N
R
=
10
l
n
∑
k
=
1
N
S
k
2
∑
k
=
1
N
X
k
-
S
k
2
.Whenσ
=
3, the denoising effect of two test signals is shown in Figures 5 and 6. In the figures, NS expresses the noisy signals, OS represents the original signals, DS is the denoising signals using the new thresholding function,New represents the effect index of the new thresholding function,Hard is the effect index of hard thresholding function, andSoft expresses the effect index of soft thresholding function.Figure 5
Denoising effect of different signals whenσ
=
3.
(a)
(b)Figure 6
Effect index of different signals whenσ
=
3.
(a)
(b)In order to exclude the effect of noise intensity, experiment is retested withσ
=
5 white Gaussian noise (see Figures 7 and 8).Figure 7
Denoising effect of different signals whenσ
=
5.
(a)
(b)Figure 8
Effect index of different signals whenσ
=
5.
(a)
(b)In order to prove the superiority of the optimal shape parameter, a comparative experiment between thresholding function with optimal shape parameter and thresholding function with nonoptimal shape parameter (α
=
1) is provided under σ
=
5 white Gaussian noise. The denoising effect of nonoptimal shape parameter is shown in Figure 9. The denoising index of two methods is provided in Figure 10. NSP represents denoising index of thresholding function with nonoptimal shape parameter and OSP represents denoising index of thresholding function with optimal shape parameter.Figure 9
Denoising effect of nonoptimal shape parameter whenσ
=
5.
(a)
(b)Figure 10
Denoising index of two methods whenσ
=
5.
(a)
(b)


### 4.3. Results Analysis

As shown in Figure4, the parameter optimization method based on AFSA can quickly converge to the optimal objective function value. As it is shown in Figure 5, when σ
=
3, denoising signal obtained by the proposed method is closer to the original signal than hard and soft thresholding functions for both signals. From Figure 6, we can see that the proposed method can achieve smaller MSE and larger SNR than traditional methods. To avoid the interference of noise intensity, experiment is retested with σ
=
5 white Gaussian noise. The experiment results are provided in Figures 7 and 8. Comparing Figure 6 with Figure 8, it can be seen that the denoising effect and index of our method are better than hard and soft thresholding functions with both heavy noise and light noise. The results in Figures 9 and 10 show that thresholding function with optimal shape parameter has a better denoising effect than nonoptimal shape parameter.


## 4.1. Shape Parameter Determination

To verify the denoising effect of the new thresholding function, we must firstly determine the shape parameter. AFSA is adopted to search the optimal shape parameter. The analysis of main parameters in AFSA is given as follows.


### 4.1.1. Visual Distance (Visual) and Moving Length (Step)

LargeVisual is of benefit to quick global optimization. But ifVisual is set too large, the optimization process may be premature convergence. SmallStep is better for local optimization, while it may decrease the velocity of evolution.


### 4.1.2. Crowd Factor (W)

IfW is set too large, the velocity of evolution will increase, but AFSA has a risk of premature convergence in this case.


### 4.1.3. Number of AF (P)

When the number of AF is large, the capacity of getting out of local extremum is strong, but computational amount of every iteration will increase.Based on the analysis above, the parameters in AFSA are set as in Table1.Table 1
Parameters setting.
P
N
M
Visual
W
Step
100
50
100
1
0.618
0.05Two classic benchmark signals, namely, Bumps signal and Doppler signal, are used as test signals. Two strengths of white Gaussian noise, that is,σ
=
3 and σ
=
5, are added to the test signals in the experiments. The steps of shape parameter optimization strategy are provided in Figure 3. The optimization algorithm is run 100 times. The optimal shape parameters of different signals are obtained as in Table 2. Their iteration curves are shown in Figure 4.Table 2
Optimal shape parameters.
Bumps,σ
=
3
Bumps,σ
=
5
Doppler,σ
=
3
Doppler,σ
=
5
α
0.95
2.85
0.70
1.35Figure 4
Curves of different signals.
(a)
Bumps,σ
=
3
(b)
Bumps,σ
=
5
(c)
Doppler,σ
=
3
(d)
Doppler,σ
=
5


## 4.1.1. Visual Distance (Visual) and Moving Length (Step)

LargeVisual is of benefit to quick global optimization. But ifVisual is set too large, the optimization process may be premature convergence. SmallStep is better for local optimization, while it may decrease the velocity of evolution.


## 4.1.2. Crowd Factor (W)

IfW is set too large, the velocity of evolution will increase, but AFSA has a risk of premature convergence in this case.


## 4.1.3. Number of AF (P)

When the number of AF is large, the capacity of getting out of local extremum is strong, but computational amount of every iteration will increase.Based on the analysis above, the parameters in AFSA are set as in Table1.Table 1
Parameters setting.
P
N
M
Visual
W
Step
100
50
100
1
0.618
0.05Two classic benchmark signals, namely, Bumps signal and Doppler signal, are used as test signals. Two strengths of white Gaussian noise, that is,σ
=
3 and σ
=
5, are added to the test signals in the experiments. The steps of shape parameter optimization strategy are provided in Figure 3. The optimization algorithm is run 100 times. The optimal shape parameters of different signals are obtained as in Table 2. Their iteration curves are shown in Figure 4.Table 2
Optimal shape parameters.
Bumps,σ
=
3
Bumps,σ
=
5
Doppler,σ
=
3
Doppler,σ
=
5
α
0.95
2.85
0.70
1.35Figure 4
Curves of different signals.
(a)
Bumps,σ
=
3
(b)
Bumps,σ
=
5
(c)
Doppler,σ
=
3
(d)
Doppler,σ
=
5


## 4.2. Denoising Effect Verification of the New Thresholding Function

In this experiment, the test signals are selected the same as in Section4.1. Stationary wavelet transform is adopted in this paper [20], wavelet basis adopts sym6 wavelet [21], and wavelet decomposition scale is set to be 3. Universal threshold is selected as the standard threshold. The proposed function is used as thresholding function in the experiment of wavelet threshold denoising. In order to verify the superiority of the proposed function, the classical hard and soft thresholding functions are chosen as comparative functions. The detailed steps of wavelet threshold denoising experiment were given by [8]. All the experiments were calculated on the same computer with the CPU frequency of 2 GHz, and Matlab 7.0 is used as the computation software.In order to measure the denoising effects of different thresholding functions, MSE (equation (12)) and SNR are selected as comparative index:(20)
S
N
R
=
10
l
n
∑
k
=
1
N
S
k
2
∑
k
=
1
N
X
k
-
S
k
2
.Whenσ
=
3, the denoising effect of two test signals is shown in Figures 5 and 6. In the figures, NS expresses the noisy signals, OS represents the original signals, DS is the denoising signals using the new thresholding function,New represents the effect index of the new thresholding function,Hard is the effect index of hard thresholding function, andSoft expresses the effect index of soft thresholding function.Figure 5
Denoising effect of different signals whenσ
=
3.
(a)
(b)Figure 6
Effect index of different signals whenσ
=
3.
(a)
(b)In order to exclude the effect of noise intensity, experiment is retested withσ
=
5 white Gaussian noise (see Figures 7 and 8).Figure 7
Denoising effect of different signals whenσ
=
5.
(a)
(b)Figure 8
Effect index of different signals whenσ
=
5.
(a)
(b)In order to prove the superiority of the optimal shape parameter, a comparative experiment between thresholding function with optimal shape parameter and thresholding function with nonoptimal shape parameter (α
=
1) is provided under σ
=
5 white Gaussian noise. The denoising effect of nonoptimal shape parameter is shown in Figure 9. The denoising index of two methods is provided in Figure 10. NSP represents denoising index of thresholding function with nonoptimal shape parameter and OSP represents denoising index of thresholding function with optimal shape parameter.Figure 9
Denoising effect of nonoptimal shape parameter whenσ
=
5.
(a)
(b)Figure 10
Denoising index of two methods whenσ
=
5.
(a)
(b)


## 4.3. Results Analysis

As shown in Figure4, the parameter optimization method based on AFSA can quickly converge to the optimal objective function value. As it is shown in Figure 5, when σ
=
3, denoising signal obtained by the proposed method is closer to the original signal than hard and soft thresholding functions for both signals. From Figure 6, we can see that the proposed method can achieve smaller MSE and larger SNR than traditional methods. To avoid the interference of noise intensity, experiment is retested with σ
=
5 white Gaussian noise. The experiment results are provided in Figures 7 and 8. Comparing Figure 6 with Figure 8, it can be seen that the denoising effect and index of our method are better than hard and soft thresholding functions with both heavy noise and light noise. The results in Figures 9 and 10 show that thresholding function with optimal shape parameter has a better denoising effect than nonoptimal shape parameter.


## 5. Conclusion

In order to make up for the deficiency of the existing wavelet thresholding functions, a new thresholding function with a shape parameter based on hyperbolic tangent function is presented. Then, a shape parameter optimization method based on AFSA is proposed on the basis of analyzing the advantage of the AFSA. With the case analysis, some conclusions are summarized as follows.(1)
By improving the hyperbolic tangent function, a new thresholding function is presented in this paper. The new function has continuity, monotonicity, and high-order differentiability, which assist the new function to improve the denoising effect. The experiment results show that the proposed function can obtain better denoising effect than the classical hard and soft thresholding functions.
(2)
Traditionally, trial and error method is adopted to determine shape parameter. This method depends on expert experience and lacks theoretical guidance. In order to solve this problem, AFSA is presented to search the optimal shape parameter. The experiment results show that AFSA can rapidly obtain the optimal shape parameter. It helps achieve the effective and quick signal denoising.



---

*Source: 528656-2015-09-16.xml*