amr.maghraby
Junior Member level 2
i am trying to calculate the SNR for the Ideal ADC model in cadence ahdllib , i know that it should be equal to or around 6.02N+1.76
i have implemeted a code to calculate the FFT of the output of ADC using matlab and i will attach the code
my problem is that i dont know how to calculate the SNR from the FFT of the output signal
i have implemeted a code to calculate the FFT of the output of ADC using matlab and i will attach the code
my problem is that i dont know how to calculate the SNR from the FFT of the output signal
Code:
Afs = 5;
fs = 1e6;
N = 2048;
cycles = 5;
fx = fs*cycles/N;
t = linspace(0, (N-1)/fs, N);
%signal frequency
y = table2array(bitsinfullscale);
y = y';
s = (abs(fft(y)/N/Afs*2));
% drop redundant half
s = s(1:N/2);
f = (0:length(s)-1) / N*fs;
figure
plot(t,y)
hold on;
figure
plot(f,s)