SNR in Sigma-Delta Modulator

Thread Starter

RezaKabiri

Joined Apr 9, 2017
1
As you know, Sigma-Delta Modulator as the core of sigma-delta ADCs defines the total SNR. I am simulating a very simple code for first order delta-sigma modulator. According to text books, the SNR of the first order modulator is calculated from:

predictedSNR = 10*log10(sig_power) + 9.03*r - 10*log10((A^2)/12) - 10*log10((pi^2)/3).

r is the OSR ratio (r = log2(fs/(2*fb))) and A is the amplitude of sinusoidal input.

This is my MATLAB code:
%delta modulator FFT
clear
clc
fs = 1280;
fb = 10;
A = 1;
r = log2(fs/(2*fb));
t = 0:1/fs:1 - 1/fs;
y(1) = 0;
y(2) = 0;
x = A*sin(2*pi*fb*t);
for N=2:1:fs
x1(N) = x(N) - y(N-1);
x2(N) = sum(x1);
if x2(N) >= 0
y(N) = 1;
else
y(N) = -1;
end
end
plot(abs(fft(y))/1280);
y_fft = abs(fft(y))/1280;
sig_power = 2*(y_fft(11)^2);
noise_power = 2*sum(y_fft(1:10).^2);
SNR = 10*log10(sig_power/noise_power)
predictedSNR = 10*log10(sig_power) + 9.03*r - 10*log10((A^2)/12) - 10*log10((pi^2)/3)
----------------------------
But the results are:
SNR = 45.9814
predictedSNR =56.7738
what's wrong with my code?
 
Top