strahd_von_zarovich
Full Member level 2

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
But this code gives me something like the picture below, but the real power of the signal should be 0dBm.
Thanks in advance.
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.
Thanks in advance.