# Increasing range of a DC-offset signal (software)

I am trying to read a signal with a DC offset of 511 (as seen by the ADC). The signal's tiny with regards to the offset, and I'm feeding it to a library that does a Fourier transform on it. It comes from a 3.5mm audio jack with AC coupling and the offset so I can see the full signal.

How may I increase the range of the signal? I am thinking something like the input signal is (490-530) and I want an output of (400-630) or something (numbers solely for example). The issue is that I still need the resulting signal to be centered around 511 AND I don't know the exact amplitude of the input (since it varies based on volume and particular audio going in at the moment).

I can assume that the volume of the audio input is relatively fixed (I need to be able to adjust this gain later, but I'm assuming the volume will be constant at some value per time I'm running the project), so I don't need envelope-following or something, but I'm not sure how to do this even so.

• You need to add an op-amp to increase the signal gain before you feed it into the ADC. Aug 10, 2019 at 18:31
• This sounds like an XY problem to me. Why do you want to increase the signal range? What problem do you think you will solve by doing this? Aug 10, 2019 at 19:04
• I can't feasibly modify the hardware for this project. I need the FFT to register sounds without the audio source being turned to eardrum-rupturing levels, so it needs to be in software. I'm looking for some sort of filter that I can run on the array of samples that, say, doubles the offset each value has from the center. I would actually need it to do a smoother mapping (an example in a non-offset design would be values 0-30 become 0-100, so 15 is now 50. I could handle that, but not with the offset, though the same general idea applies). Would this do anything too weird to the FFT result?
– user47164
Aug 10, 2019 at 23:18

## 1 Answer

You can't magic more resolution out of thin air (well, you can, but it slows down your sampling - you would "oversample" and average a number of sequential samples).

Instead you need to boost your signal before it gets to the ADC using an op-amp. The simplest circuit (which also inverts the signal, but you don't really care about that I suspect) is:

simulate this circuit – Schematic created using CircuitLab

That circuit will both invert the signal (if you care, just do a little bit of maths in your program to flip the signal, but for FFT you don't really care) and double the amplitude around the mid-point. The doubling is controlled by the ratio of R1 to R2 (20000:10000 = 2:1 = doubled). The mid-point offset is created by R3/R4 - you don't need to manually add your own offset.

• This was my first idea, but I'm trying to fix up a project I've already built that does not have room to add more components. I also have no op-amps on hand. As a result, I'm looking for a way to fudge the input into a larger numeric range via some sort of mapping.
– user47164
Aug 10, 2019 at 23:13