MATLAB D-S Toolbox
MATLAB D-S Toolbox
MATLAB D-S Toolbox
Installation
• Unzip file to ~/delsig
• In non-existent, create directory ~/matlab
• Copy file mexopts.sh into ~/matlab
• Edit file ~/matlab/startup.m to include:
path(path,’<full-path-to-home>/delsig’);
1
Noise Transfer Function
Inband
noise
Even better
• Less in-band noise (optimized zeros)
• Meets stability requirements (Lee’s rule)
Lee’s
rule
6 dB
fB 0.5
f/fCLK
Zeros Poles
2
Design Flow
3
Key Functions (2)
• Modulator Realization:
realizeNTF Compute coefficients for a particular modulator
topology.
4
Design Example
• Delta-sigma ADC for digital audio applications:
– SNR > 98 dB (16-bit resolution)
– Output data rate: 44.1 KS/s
– Use 1-bit quantizer
– Second-order noise transfer function (NTF)
NUM =
1.0000 -1.9999 1.0000
DEN =
1.0000 -0.7639 0.2361
10
5
Modulator Simulation
N=8192; f=N/(2*OSR); u=0.5*sin(2*pi*f*[0:N-1]/N);
[v,xn,xmax,y]=simulateDSM(u,ntf,nlev);
fB = 1/(8*OSR); Au = [-100:5:-10 -9:1:0];
[snr,Au] = simulateSNR(ntf,OSR,Au,0,nlev,fB,14);
11
Calculate Coefficients
>> form = ’CRFB’; [a,g,b,c] = realizeNTF(ntf,form,1)
a = 0.4721 0.7639
Other forms:
g = 5.0199e-05
b = 0.4721 0.7639 1.0000 CRFF
c = 1 1 CIFB
CIFF, etc
12
6
Scaling
• Scale coefficients for optimum dynamic range:
ABCD = stuffABCD(a,g,b,c,form)
threshold for
[ABCDs,umax]=scaleABCD(ABCD,nlev,0,1,7) judging stability
umax = 0.9000
ABCDs = 1.0000 -0.0003 0.7286 -0.7286
0.1530 0.9999 0.2919 -0.2919 signal limit
0 4.2349 1.0000 0
[a,g,b,c] = mapABCD(ABCDs,form)
a = 0.7286 0.1804
g = 3.2808e-04
b = 0.7286 0.1804 1.0000
c = 0.1530 4.2349
13
14