Continue to Site

# How to convert ADC data to dBm

#### strahd_von_zarovich

Hi Everyone,
I collect data from ADCs on my board. I couldn't figure out how to convert them to dBm on frequency spectrum. I wrote a Matlab code but it doesn't give me the correct results.
Sampling Rate : 250MS , ADC Resolution: 16bit, Input Impedance: 50ohm

Code:
FsChan = 250e6;  % sampling frequnecy
DataLsb = 2^-15; % Least significant bit for 16-bit ADC

dataInt16 = fscanf(inFile, '%f');   % reading data from file
data = double(dataInt16) * DataLsb; % multiply data with LSB to get real voltage
L=size(data,1);
[pxx,f] = periodogram(data,[], L, FsChan ,'psd');
pxx_dB=10*log10(1000*pxx/100); % dBm/Hz 50 Ohm Load

But this code gives me something like the picture below, but the real power of the signal should be 0dBm.

#### kaz1

##### Full Member level 4
Digital values can only show dB not dBm unless you have some ADC reference for that.
To get dB your periodogram is ok but use 10*log10(pxx). You also need to offset effect of FFT resolution on power level (I think it is -10*log10(N)) since more resolution lowers noise floor.