## Hard & soft thresholding

In usual Fourier transform (FT), the filter is cut-off certain frequency.

This trick is also suitable for wavelet transform (WT). However, there could be some “features” located in high frequency scale (or octave) , a simply cut-off would remove these features.

If the signal to noise level is large, that means the noise has smaller amplitude than that the signal, we can use hard or soft thresholding, which zero any coefficient, which is after the FT or WT,  less then a threshold.

Lets $X$ be the coefficient. The hard thresholding is

$Y=\begin{cases} 0, & |X| <\sigma \\ X, & \mbox{else} \end{cases}$

The soft thresholding is

$Y = \begin{cases} 0, & |X| < \sigma \\ sign(X) f(|X|, \sigma), & \mbox{else} \end{cases}$

A popular function

$\displaystyle f(x, \sigma) = \frac{x - \sigma}{ X_{max} - \sigma } X_{max}$

or

$\displaystyle f(x, \sigma) = x - \sigma$

## [ Be-12(p,n)B-12 ] the detector circuit

i joined a scattering experiment for $^{12}Be(p,n)^12B$. today the Beam-Line-Detector team was finished the BLD, and SHARAQ group is trimming the beam to the SHARAQ detector. i was worked on the neutron detector array, but i was absented for all preparation job due to a polarized proton target.

here is the detector circuit:

when the neutron hits on the plastics scintillator, it create s proton and further release photons. these photons is result of photoelectric effect and Compton scattering. the photons have different time on reaching the 2 ends of the scintillator due to the position. Thus, by analysis the timing, we can identify the position.

The Photo-Multipler Tube convert photon into electric signal. This signal go to a Splitter, the splitter simply copy the signal. one output is go to a Discriminator, which create a digitized signal. the PMT at the 2 ends will give different timing, and the Discriminator signals will be combined after the AND gate. If the neutron hit the scintrillator near either ends, the AND gate make sure that the later signal will be the trigger signal.

the trigger signal will enable the Charge-Digital-Converter (QDC) start integrate the delayed signal for 300ns. Since from the raw signal to the AND gate takes time, thus a delay will ensure a correct detection of the total energy for each signal. However, the signal will have exponential decay when traveling alone the PMT. the signal decay is:

$S = S_0 e^{- k x}$

For signal created at position r from the mid-point of the scintrillator , the 2 signals are:

$S_1 = S_0 e^{- k (L-r)}$

$S_2 =S_0 e^{-k ( L+r)}$

where L is the half length from the mid-point of the scintrillator. thus, if we use a geometric mean, we can get the original signal strength.

$S_0 = \sqrt{S_1 S_2} e^{k L}$

the trigger signal also combined with the discriminator signal for determination of the time. the trigger signal will define the t=0. by this, we can calculate back the location of the neutron. If we define the mid-point of the scintrillator be x=0. a neutron hits on position r will take different path and the time different for the scintrillator is:

$\Delta t_s = 2 r / c$

where c is the speed of light. we also have to add the time different due to the cable, thus, the total time different is:

$\Delta t = t_1 - t_2 = \frac{2r}{c} + t_0$

by fitting the statistic, the average of the position should be zero, thus the mean of Δt is the offset by the cable.

However, as we mention before, the signal will decay. since we are using Threshold Discriminator, different signal strength will give different time even for same start time. This is called Walk effect. For lower signal strength, the effect is stronger. and give larger Walk time. since the Walk time is always additional, the statistics of the QDC-TDC graph will has a tail at one side only.

In fact , there is a technique the tackle the Walk effect, which is by a Constant Fraction Discriminator. the principle is that, if we copy the signal and apply a negative fraction on 1 of them and summing up. the point of zero is always the same no matter the amplitude or the signal strength.

the Walk effect can be calculated by assuming the falling of the signal is just like a line with slope -m. with threshold -θ, and a decay ratio k. the time are:

$t_1 = \frac{\theta}{m}$

$t_2 = \frac{\theta}{k m} = \frac{1}{k} t_1$

$\Delta t = t_1-t_2 = \frac{k - 1}{k} \frac{\theta} {m}$

if we plot the signal strength versus time different, we have a curve in the form

$y = \frac{k-1}{k} \theta \frac{1}{x}$

From the equation, a smaller decay ratio, which corresponding to the location closer to the mid-point of the  scintrillator, the bigger the $1- \frac{1}{k}$ and give a border curve.