## Gain Control

Started by 6 years ago13 replieslatest reply 6 years ago181 views

Hi,

I'm working on RADAR systems and I have a question about gain control.
In our system we have LNA and IF amplifier controlled by RX gain register.
I put a single target and took two records :
1. RX Gain =24 dB
2. RX Gain =30 dB

What I expected to see is that the target signal peak after FFT will increase by 6 dB between the two records, but actually I get only 3.5 dB at the peak.
When I looked at the RMS of the signal in the time domain I got the expected 6 dB difference
my conclusion is that  the noise part of the signal "take" more gain than the signal part...am I right?

Thanks!

[ - ]

doubling amplitude leads to 6dB mean power increase

peak is amplitude unless you mean peak power.

fft has its funny gain (user defined).

so you got to see what is valid in your case

[ - ]

Thanks kaz

The gain is 6 dB of amplitude, the FFT peak is amplitude peak 10*log10(abs(peak)), and the RMS I measured is amplitude also mean(abs(x)).

regarding the FFT gain, it should be the same for both cases, isn't it?
Am I missing something here?

[ - ]

dB is meant for power ratio, not amplitude.

pwr(db) = 10*log10(pwr1/pwr2)

but can be referred to amplitude as:

pwr(db) = 20*log10(A1/A2)

i.e.pwr(db) = 10*log10(A1^2/A2^2)

[ - ]

Whoa Imoshe, wait a minute! Let's use the proper terminology here. A single complex-valued FFT result sample has a real (imaginary) part that has an amplitude which can be positive of negative. But a complex-valued FFT sample does *NOT* itself have an amplitude value, it has a magnitude value which is ALWAYS a non-negative number (a zero value or a positive value).

As such, an FFT-generated spectrum will have a peak magnitude value, NOT an peak amplitude value. And to convert a spectral peak magnitude value to decibels you should use 20*log10(peak magnitude), and NOT use 10*log10(peak magnitude).

If you square your spectral magnitude values to compute spectral power samples, then you can use 10*log10(peak power value) to convert to decibels.

Imoshe, if "abs(x)" notation represents the absolute value (the positive-only magnitude) of an x(n) sequence, then I fear your RMS computations will not be correct.

Regarding your last sentence, I believe what you call "FFT gain" will indeed be the same for both sequences so long as the two sequences have the same number of samples (ie. the FFT size is the same for both sequences).

[ - ]

Hi Rick,
Sorry for the mess in the terminology...
I think i had a mistake that take 10*log10(peak magnitude) instead of 20*log10(peak magnitude)

Thanks for clarifying this point.
Regarding the FFT gain, I'm using same length sequence in both cases

What if I want to measure it in the time domain? how can I measure it correctly?

[ - ]
Hi Imoshe.

You wrote, "how can I measure it correctly?". My question is, "Measure what?"

Also, I wonder if you are using abs(x) to compute RMS values.

[ - ]

Hi Rick,

I want to measure the gain difference between the two signals.

To compute RMS I'm using MATLAB "rms" function or alternatively
RMS = sqrt(mean(abs(x).^2))

[ - ]

Hi Imoshe.

In the time domain it seems to me that the gain difference will be equal to the difference in the time-domain RMS values of the two signals.

Also, just so you know, you don't need the abs() operation in your RMS computation. You can use: RMS = sqrt(mean(x.^2))

[ - ]

Hi Rick

You wrote: "you don't need the abs() operation in your RMS computation", is it true even if my signal is complex?

[ - ]

Hi Imoshe.

Ah, I think you're trying to teach me a lesson. And you have succeeded.

RMS = sqrt(mean(x.^2)) is only correct for real-valued signals. Your original RMS = sqrt(mean(abs(x).^2)) works for both real- and complex-valued signals. My last statement is true because for a complex-valued x:

RMS = sqrt(mean(abs(x).^2)) = sqrt(mean(x.*conj(x)))

and we know that the power of a single complex-valued sample is the sample value times its conjugate.

[ - ]

Thanks Rick!

[ - ]

Hi Imoshe.

If we use the variable x(n) to represent your 'Gain = 24 dB' signal, then your 'Gain = 30 dB' signal would be represented by 2x(n). The RMS of the signal (or noise-only) part of 2x(n) should be twice the RMS of the signal (or noise-only) part of x(n).

The FFT spectral magnitudes of 2x(n) should be twice the FFT spectral magnitudes of x(n)

* Are your 2x(n) time-domain sequence values equal to twice the x(n) time-domain sequence values?

* Is the amplitude your 2x(n) sequence "clipping", by any chance?

* How are you computing RMS values?

* Do the x(n) and 2x(n) sequences have the same number of samples.

[ - ]