pavel-demin / red-pitaya-notes

Notes on the Red Pitaya Open Source Instrument
http://pavel-demin.github.io/red-pitaya-notes/
MIT License
338 stars 209 forks source link

mcpha baseline characteristics #850

Closed Hamam-S closed 5 years ago

Hamam-S commented 5 years ago

Description of the setup:

Description of the problem:

Dear Pavel, Really impressed by the quality of your work.
I was wandering what is the difference between manual and auto baseline. I tried both and I see huge spectra differences ( Sorry for not being able to put any pictures, I'll do it as soon as possible).

But what is the difference in a more abstract way, when I read the pha verilog program https://github.com/pavel-demin/red-pitaya-notes/blob/master/cores/axis_pulse_height_analyzer_v1_0/axis_pulse_height_analyzer.v , my hypothesis about the difference is this : 1- In non-auto baseline, the program takes the maximum of an impulse and substracts the value of the baseline. 2- In auto baseline, the program looks for the minimum value before any rising edge, and puts it as a baseline.

Note : I put the min threshold and max threshold to 0 and 16384 respectively. Here is a picture representing my assumptions.

Sans titre

I supposed that 0 baseline value represents 0 volts, Is it correct ?

pavel-demin commented 5 years ago

Your description of the two baseline modes is correct. Earlier today, I've updated the notes about the MCPHA application with this commit and added a description of the baseline modes that is similar to yours.

If I'm not mistaken, there is some voltage offset at the Red Pitaya inputs. So, 0 V at the board's input corresponds to a non-zero value at the ADC output.

I think that for the pulse height analyzer to work properly, the pulses should be non-overlapping. In its current state, the MPCHA application doesn't have any pulse shaping module. However, it should be relatively easy to add a simple pulse shaping module that would delay, scale and subtract the delayed signal from the non-delayed signal as it's for example described in Digital signal processing for BGO detectors and in Digital gamma-ray spectroscopy based on FPGA technology.

Hamam-S commented 5 years ago

Thank you for this huge clarification.

If I'm not mistaken, there is some voltage offset at the Red Pitaya inputs. So, 0 V at the board's input corresponds to a non-zero value at the ADC output.

This may explain the spectrum with manual baseline = 0 below, since 0 v gives non-zero digital value, we may never read 0 digital input, so we end up with the huge peak of 10000000 counts at channel 230 when we set a manual baseline with value 0, and which also explains why there is not count at channel inferior to approximately 85 (The orange curve).

rp_bln

The second hypothesis is that there is noise, so the perturbations that prevent the voltage to go to zero when there is no gamma source adjacent to the detector. So there is constant lecture of non-zero digital inputs that appear on the histograms.

pavel-demin commented 5 years ago

With the baseline set to 0 and with the long exponentially decaying tails of the pulses, there should be a lot of noise over all the spectrum.

Here is a screenshot showing the noise on the exponentially decaying edge of a pulse:

mcpha-noise

All the small peaks are counted if the baseline is set to 0.

So, ideally, the pulses should be shaped before analyzing them with the MCPHA application. Otherwise, only the automatic baseline subtraction should be used.