Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to convert ADC data to dBm

strahd_von_zarovich

Advanced Member level 4
Full Member level 1
Joined
Sep 25, 2015
Messages
112
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,298
Activity points
2,382
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.
R1.PNG



Thanks in advance.
 

kaz1

Full Member level 4
Full Member level 4
Joined
Aug 15, 2019
Messages
222
Helped
14
Reputation
28
Reaction score
32
Trophy points
28
Location
UK
Activity points
1,392
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.
 

LaTeX Commands Quick-Menu:

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top