Improve detect_change function
authorLukáš Jiřiště <jiriste@icpf.cas.cz>
Wed, 11 Dec 2024 09:55:54 +0000 (10:55 +0100)
committerLukáš Jiřiště <jiriste@icpf.cas.cz>
Wed, 11 Dec 2024 10:27:41 +0000 (11:27 +0100)
commitfed64548bfd6aeb498cf0c7e31b41ad22417406d
tree3a5a31d7e9f8ad89f5f1d16cfa7ff330e4dffa7e
parent79d62d7d22302db8b96bae4b69a6391724c8bcd3
Improve detect_change function

Opening the valve to cell in two stages introduced a problem with
the peak detection (double peaks).
For small pressures during desorption measurement the pressure
differences were also small and the threshold could not be set so that
it recognizes these small peaks without triggering the double peaks.

Both seem to be somewhat solved by what I've done. The differences are
divided by the mean of differences 15 (arbitrary) sample to both sides.
This amplifies the peaks that occur around vacuum much more than others.
In other words the difference function is divided by the convolution of
differences and a rectangular window (of size 30).

The convolution looks like exponentials that roughly follow the
pressure that have smeared peaks. By dividing the differences by this
convolution, the small peaks are divided by small values while the big
peaks are divided by greater values. This maybe worsens the
noise-to-signal ratio, but makes the peaks easier to process.
detect_change.m
get_important_pressure.m
process_experiment.m