I agree that clipping is bad, bad, bad. Generates all sorts of problems. Better to back down the gain. Clipping will result in the pulses not being properly integrated and sorted into the right bins. We want the highest gain that stays linear and is scaled to the ADC input.
Yes - linearity to Hi-Fi standards and more!
Of course we need pulses that are not clipped. They cannot retain the information to allow discrimination of one to the next.
The energy analogue is the
area under the waveform curve. Take enough samples in vertical stripes, and add them up.
More practically, add them up, and apply a scaling factor to normalize the value when one knows what a maximum for that gain range is, meaning calibration for a known element. Thus, if the gain gets crushed from a non-linearity, the area count is telling lies.
Related to being able discriminate between elements are present, these must include scaling those with energies outside of the 6KeV to 10KeV range, essentially to adjust their counts according to the inverse probability of their diode detection. I mean the inverse of the X-100-7 diode absorption probability curve.
We should not be facing even very small non-linearities. We can do very accurate analogue computing at high speed even to missile navigation accuracy, and it can be done with low cost components.
I am only OK with adding up the low-pass filtered, delayed, "stretched" pulse waveform if we know for sure that the entire waveshape analogue-of-area waveshape is preserved. I have not (yet) done the integration exercise to mathematically prove it. Right now, I am not confident that the output of U1 does that even once, even if we change the opamp for something else. I would be happier if it was a linear TIA amplifier, instead of an strange integrator "pulse stretcher". We then AC couple, and go again with U2, but that one has a response roll-off much higher, near 16KHz, so it only causes a little delay, and hopefully, no distortion.
Then we get to whatever further gain we apply. I suppose the passive high-pass AC coupler can't really hurt an already slow pulse. Mark has already caught up with and fixed the clipping, but going non-linear before getting to 2.5V is a problem. We should be able to compute exactly to within (say) 100mV or less of the rail, with no distortion.
I know I must be sounding like an electronics Devil's advocate here, and please forgive that I express misgivings. It's only because the total design case for the TIA amplifier à la mode de Pocket Geiger has not been made in a way that I can understand, and that may be a problem only for me.