image thumbnail

Sigma Delta Test Bench

by

 

A test bench to simulate and analyse Sigma Delta modulators

tool_box_trial.m
clear
order = 3
OSR = 64;
H = synthesizeNTF(order,OSR,1)
nLev = 2
NFFT = 2^13
tone_bin = 35
t = [0:NFFT-1];
u = 0.5 * (nLev - 1)*sin(2*pi*tone_bin/NFFT*t);
V = simulateDSM(u,H,nLev);
% n = 1:150;
% stairs(t(n),u(n),'g');
% hold on;
% stairs(t(n),V(n),'g');
spec = fft(V.*hann(NFFT))/(NFFT*(nLev-1)/4);
snr = calculateSNR(spec(1:ceil(NFFT/(2*OSR))+1),tone_bin);
NBW = 1.5/NFFT;
f = linspace(0,0.5,NFFT/2+1);
Sqq = 4*(evalTF(H,exp(2i*pi*f))/(nLev-1)).^2/3;
plot(f,dbv(spec(1:NFFT/2+1)),'b')
hold on
plot(f,dbp(Sqq*NBW),'m','Linewidth',1);

Contact us