<commit_before>## Delay Correction in ReSampler

A natural consequence of using a linear-phase Finite Impulse Response (FIR) lowpass filter for antialiasing during the resampling process is that a time delay is introduced due to the filter's constant group delay across all frequencies.

The actual delay (in samples) is given by the following formula:

![Group Delay Formula](./DelayFormula-LinPhaseResampSm.PNG)

where: 



	D = Delay (in samples)

	N = length of FIR

	L = decimation factor (denominator in conversion ratio)


To correct the timing due to the delay, ReSampler discards (ie does not write to the ouptut file) samples prior to the **D<sup>th</sup>** output sample.

This behavior appears to be the accepted practice for sample rate converters, but can nevertheless be disabled using the **--noDelayTrim** option.  

The **--noDelayTrim** option has no effect when used in conjunction with Minimum Phase.

In practice, this delay is small (of the order of 1 or 2 milliseconds).<commit_msg>re-vamped documenatation on delay-correction<commit_after>## Delay Correction in ReSampler

A natural consequence of using a linear-phase Finite Impulse Response (FIR) lowpass filter for antialiasing during the resampling process is that a time delay is introduced due to the filter's constant group delay across all frequencies.

In practice, this delay is small (of the order of 1 or 2 milliseconds).

The actual delay (in samples) is given by the following formula:

![Group Delay Formula](./DelayFormula-LinPhaseResampSm.PNG)

where: 



	D = Delay (in samples)

	N = length of FIR

	L = decimation factor (denominator in conversion ratio)


To correct the timing due to the delay, ReSampler discards (ie does not write to the ouptut file) samples prior to the **D<sup>th</sup>** output sample.

This behavior appears to be the accepted practice for sample rate converters, but can nevertheless be disabled using the **--noDelayTrim** option.  

The **--noDelayTrim** option has no effect when used in conjunction with Minimum Phase, since a minimum-phase FIR, by its very nature, should not introduce delay.
{'fraction_non_alphanumeric': 0.061378659112370164, 'fraction_numerical': 0.0018885741265344666, 'mean_word_length': 4.561679790026247, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '236029', 'n_tokens_mistral': 585, 'n_tokens_neox': 550, 'n_words': 302}