A system for determining the density of a geological formation, the system comprising: a component disposed about a downhole tool, the component to measure a frequency shift of gamma radiation travelling from a first position of the component to a second position of the component, the frequency shift resulted from a gravitational potential difference between the first position and the second position, which correspond to respective positions of the geological formation, the component including: a source (102, 410, 510) positioned at the first position, the source (102, 410, 510) to emit gamma radiation from the first position to the second position, an absorber (104, 420, 520) positioned at the second position, the absorber (104, 420, 520) to absorb at least a portion of the gamma radiation emitted from the source, a tuning mechanism operatively connected to at least one of the source (102, 410, 510) and the absorber (104, 420, 520), the tuning mechanism to compensate the frequency shift and induce a resonant absorption of the gamma radiation emitted from the source (102, 410, 510) by the absorber (104, 420, 520), and one or more detectors (105, 430, 530) operatively connected to the absorber (104, 420, 520), the detectors (105, 430, 530) to detect the absorption of the gamma radiation with the absorber (104, 420, 520) and to generate at least one signal associated with the frequency shift; and at least one processor (108, 230, 330) operatively connected to the detectors (105, 430, 530), the at least one processor (108, 230, 330) to receive the at least one signal generated, determine the gravitational potential difference from the at least one signal received, and determine the density of the geological formation between the first and second positions based on the gravitational potential difference determined. a component disposed about a downhole tool, the component to measure a frequency shift of gamma radiation travelling from a first position of the component to a second position of the component, the frequency shift resulted from a gravitational potential difference between the first position and the second position, which correspond to respective positions of the geological formation, the component including: a source (102, 410, 510) positioned at the first position, the source (102, 410, 510) to emit gamma radiation from the first position to the second position, an absorber (104, 420, 520) positioned at the second position, the absorber (104, 420, 520) to absorb at least a portion of the gamma radiation emitted from the source, a tuning mechanism operatively connected to at least one of the source (102, 410, 510) and the absorber (104, 420, 520), the tuning mechanism to compensate the frequency shift and induce a resonant absorption of the gamma radiation emitted from the source (102, 410, 510) by the absorber (104, 420, 520), and one or more detectors (105, 430, 530) operatively connected to the absorber (104, 420, 520), the detectors (105, 430, 530) to detect the absorption of the gamma radiation with the absorber (104, 420, 520) and to generate at least one signal associated with the frequency shift; and a source (102, 410, 510) positioned at the first position, the source (102, 410, 510) to emit gamma radiation from the first position to the second position, an absorber (104, 420, 520) positioned at the second position, the absorber (104, 420, 520) to absorb at least a portion of the gamma radiation emitted from the source, a tuning mechanism operatively connected to at least one of the source (102, 410, 510) and the absorber (104, 420, 520), the tuning mechanism to compensate the frequency shift and induce a resonant absorption of the gamma radiation emitted from the source (102, 410, 510) by the absorber (104, 420, 520), and one or more detectors (105, 430, 530) operatively connected to the absorber (104, 420, 520), the detectors (105, 430, 530) to detect the absorption of the gamma radiation with the absorber (104, 420, 520) and to generate at least one signal associated with the frequency shift; and at least one processor (108, 230, 330) operatively connected to the detectors (105, 430, 530), the at least one processor (108, 230, 330) to receive the at least one signal generated, determine the gravitational potential difference from the at least one signal received, and determine the density of the geological formation between the first and second positions based on the gravitational potential difference determined.