The Workings of Pulse-Height Discrimination Pulse-height discrimination is a common technique to filter out unwanted background signals from the analytical signals. But how exactly does it work?

The analytical signals are not continuously detected, but detected rather in pulses. This is because the detector has a "dead time", and there is a pile-up of ion-pairs (or whatever the principle of detection is) in this dead-time. The intensity of the built up signal - the pulse - is then detected.

Pulse-height discrimination is just that; a discrimination of the detected pulse-heights. However, to be able to discriminate the pulse-heights, surely the system must know what a "desirable" pulse-height is, or, in other words, when a detected pulse deviates from the desirable? How exactly is this done?

In the context of X-ray diffraction, we know the desirable energy of the detected radiation: in theory, this energy should be equal to the K$\alpha_1$ of the X-ray tube's anode material (since diffraction is an elastic interaction, and hence no energy lose occurs). However, the intensity of the signal has nothing to do with the energy. How do we (that is, the ones developing the analytical system) know which pulse-heights are relevant and which are irrelevant to our analysis?

I hope have presented my question clearly, and I appreciate all help. Finding free references online was not very easy, in my experience.
Pule Height Analaysis (PHA) is done on the current pulse from the detector. It only works for detectors which have a current pulse which is proportional to the energy of the x-ray (scintillation counters and gas proportional counters). It does not work for Geiger counters where the current pulse doesn't depend on the x-ray energy.  

Think of dropping the current through a resistor. The current pulse then has a voltage. Basically you set a low and a high voltage (a window) for the detector pulses which you will count. Any detector signals within the window are counted, those outside the window (too low or too high) are rejected. 

Given that the detector current (or voltage really) should be proportional to the energy of the x-ray detected this improves the S/N ratio. So "low" current pulses don't have enough energy to be a Cu K-alpha x-ray, and high energy pulses have too much energy. High pulses could be for example an x-ray with twice the energy.

It is important to note that the rejected pulses are not "background" counts per se. But there is a twist. The rejected pulses do create detector deadtime. So you have to be careful that the overall count rate of the detector is low enough to still be linear, or do a correction for the total count rate.