<p>I guess to are referring to PamGuard</p>
<p>The answers to this question may be in the answers to</p>
<p><a href="https://bioacoustics.stackexchange.com/questions/1316/click-length-parameter-of-click-detector-module-in-pamguard">Click length parameter of click detector module in PAMGuard</a></p>
<p><a href="https://bioacoustics.stackexchange.com/questions/1324/maximum-click-length-parameter-in-pamguard">Maximum click length parameter in PAMGuard</a></p>
<p>If not please detail better your question</p>
<p>Edit: to address the comment: Max click length is the second bullet of  Jennifer's answer and also addressed by Doug. IMHO, the meaning of pre and post click samples is intuitive and included in Jennifer's answer. If your wanted to know how to determine the values then that is as always a question of trial and answer (experience in using PamGuard) and the context. (see both answers for examples).</p>

CC BY-SA 4.0
2024-12-05T17:36:02.053Z
Hi, Yes, I am referring to Pamguard.

These 2 topics are helpful, but they don't answer my questions.
I am asking what is the meaning of max click length, pre sample and post sample on Pamguard Click Detector Parameters --> section click length
Nara
CC BY-SA 4.0
2024-12-05T16:39:03.183Z
2024-12-05T18:20:24.640Z
2024-12-05T18:20:24.640Z
WMXZ
<p>It's been a while since I've reviewed the functionality of PAMGuard's click  detector, but I'll attempt a brief explanation from a cold-start.</p>
<p>Within PAMGuard's click detector is a detection function/&quot;Trigger&quot; that is calculated and updated by applying the click detection algorithm for each new digital sample (as described in the documentation). When the detection function exceeds the threshold PAMGuard creates a new detection. Typically, the start of that click is the sample that exceeds that threshold, and the end of that click is the last sample above that threshold. But the parameters <em>Max click Length</em>, <em>pre sample</em>, and <em>post samples</em> can modify and influence the duration of that detection.</p>
<p>The <em>Max click Length</em> determines the total number of digital samples that PAMGuard will allow to be considered part of a click. If the detection function remains above threshold for more than this number of samples, the click will be truncated to this number. So if Max click Length is 1024 samples, but the detection function is above threshold for 1234 samples, PAMguard will force the duration to be 1024 samples (I suspect it would take the first 1024, but would need to look at the code to confirm).</p>
<p>The <em>pre</em> and <em>post samples</em> come into play when the click detection function remains above threshold for less than the Max click Length. <em>Pre</em> sample of X will shift the start of the click by X sample prior to the first sample that exceeded the detection threshold. <em>Post samples</em> of Y increase the duration of the click Y samples beyond the last sample. This behaviour allows one to ensure that every click will have at least a minimum number of samples (X+Y).</p>
<p>Again, not sure exactly what happens when there is a conflict between pre, post and max samples, guess one would have to check the source code. But guessing from memory, I think the addition of pre and post-samples are subordinate to max click length. That is to say, I think PAMguard will only add samples before and after the click up to the max length.</p>
<p>Hope this additional explanation answers your question.</p>

CC BY-SA 4.0
2024-12-08T23:41:26.430Z
2024-12-08T23:41:26.430Z
Brian Miller
<p>When using the Click Detector in Pamguard, I know that the min click length should show the minimum samples so that the Click detector would be able to keep a single click detected on multiple nearby hydrophones together. So, for example, I have one cable with 4 hydrophones, separated into 2 pairs. Each pair is separated by 100 meters and between the hydrophones of the same pair, there is 1 meter of separation. So in my calculations, for a sample rate of 96000 Hz, the min click separation would be 64 (1/1500 = 0,00066 then 0,00066 x 96000 = 64 samples).</p>
<p>What I don't understand is the meaning of the max click length, pre and post samples. What would their values have to be and why?</p>

<pamguard><echolocation-clicks><signal-detection><maximum-click-length>
Max click length, pre and post samples
# Max click length, pre and post samples

(Asked by: username_0 on 2024-12-05)

When using the Click Detector in Pamguard, I know that the min click length should show the minimum samples so that the Click detector would be able to keep a single click detected on multiple nearby hydrophones together. So, for example, I have one cable with 4 hydrophones, separated into 2 pairs. Each pair is separated by 100 meters and between the hydrophones of the same pair, there is 1 meter of separation. So in my calculations, for a sample rate of 96000 Hz, the min click separation would be 64 (1/1500 = 0,00066 then 0,00066 x 96000 = 64 samples).

What I don't understand is the meaning of the max click length, pre and post samples. What would their values have to be and why?

**Tags:** pamguard, echolocation-clicks, signal-detection, maximum-click-length


---

## 2 answers

### Answer by username_1 on 2024-12-05. Score: 0

I guess to are referring to PamGuard

The answers to this question may be in the answers to

[Click length parameter of click detector module in PAMGuard](https://bioacoustics.stackexchange.com/questions/1316/click-length-parameter-of-click-detector-module-in-pamguard)

[Maximum click length parameter in PAMGuard](https://bioacoustics.stackexchange.com/questions/1324/maximum-click-length-parameter-in-pamguard)

If not please detail better your question

Edit: to address the comment: Max click length is the second bullet of Jennifer's answer and also addressed by Doug. IMHO, the meaning of pre and post click samples is intuitive and included in Jennifer's answer. If your wanted to know how to determine the values then that is as always a question of trial and answer (experience in using PamGuard) and the context. (see both answers for examples).

> **Comments:**
> **username_0**: Hi, Yes, I am referring to Pamguard.  These 2 topics are helpful, but they don't answer my questions. I am asking what is the meaning of max click length, pre sample and post sample on Pamguard Click Detector Parameters --> section click length  

---

### Answer by username_2 on 2024-12-08. Score: 0

It's been a while since I've reviewed the functionality of PAMGuard's click detector, but I'll attempt a brief explanation from a cold-start.

Within PAMGuard's click detector is a detection function/"Trigger" that is calculated and updated by applying the click detection algorithm for each new digital sample (as described in the documentation). When the detection function exceeds the threshold PAMGuard creates a new detection. Typically, the start of that click is the sample that exceeds that threshold, and the end of that click is the last sample above that threshold. But the parameters *Max click Length*, *pre sample*, and *post samples* can modify and influence the duration of that detection.

The *Max click Length* determines the total number of digital samples that PAMGuard will allow to be considered part of a click. If the detection function remains above threshold for more than this number of samples, the click will be truncated to this number. So if Max click Length is 1024 samples, but the detection function is above threshold for 1234 samples, PAMguard will force the duration to be 1024 samples (I suspect it would take the first 1024, but would need to look at the code to confirm).

The *pre* and *post samples* come into play when the click detection function remains above threshold for less than the Max click Length. *Pre* sample of X will shift the start of the click by X sample prior to the first sample that exceeded the detection threshold. *Post samples* of Y increase the duration of the click Y samples beyond the last sample. This behaviour allows one to ensure that every click will have at least a minimum number of samples (X+Y).

Again, not sure exactly what happens when there is a conflict between pre, post and max samples, guess one would have to check the source code. But guessing from memory, I think the addition of pre and post-samples are subordinate to max click length. That is to say, I think PAMguard will only add samples before and after the click up to the max length.

Hope this additional explanation answers your question.


---

