# Digital Delta-Sigma Modulator

1. ## Digital Delta-Sigma Modulator

Anyone can guide me how to design a Digital Delta-Sigma Modulator ? First order or secomd order will be ok ! I have no idea to build a Matlab model for a multi-bit feedback Delta-Sigma Modulator !

After build a Matlab model , how to program an quantizer by Verilog ? Do i just ignore LSB ?

•

2. ## Re: Digital Delta-Sigma Modulator

Hi,
It depends on the application. If you want to use it for ADC the choice depends on the number of bit of resolution you need in the final ouput and you may ignore the LSBs.
BRM

•

3. Of course not. for example:

function [ds3out, out3, out2, out1, fb] = ds31(rst, insamp, out3, out2, out1, fb)

if (rst == 0)
out1(2) = insamp/16 - fb(1)/16 + out1(1);
out2(2) = out1(1) - fb(1)/4 - out3(1)/128 + out2(1);
out3(2) = out2(1) - fb(1)*(1/2+1/4) + out3(1);
quantized = quantizer(out3(2));
ds3out=quantized;

%update the ds3 state
unquantized = unquantizer(quantized);
out1(1) = out1(2);
out2(1) = out2(2);
out3(1) = out3(2);
fb(1) = unquantized;
else
out1(1:2)=0; ds3out=0; out2(1:2)=0; out3(1:2)=0;
end;

function quantizer_out = quantizer(insamp)

% quantizer for delta-sigma modulator

qlevel0 = 30720;
qlevel1 = 26624;
qlevel2 = 22528;
qlevel3 = 18432;
qlevel4 = 14336;
qlevel5 = 10244;
qlevel6 = 6144;
qlevel7 = 2048;
qlevel8 = -2048;
qlevel9 = -6144;
qlevel10 = -10244;
qlevel11 = -14336;
qlevel12 = -18432;
qlevel13 = -22528;
qlevel14 = -26624;
qlevel15 = -30720;

if(insamp > qlevel0)
quantizer_out=16;
end;

if((qlevel0 >= insamp) & (insamp > qlevel1))
quantizer_out=15;
end;

if((qlevel1 >= insamp) & (insamp > qlevel2))
quantizer_out=14;
end;

if((qlevel2 >= insamp) & (insamp > qlevel3))
quantizer_out=13;
end;

if((qlevel3 >= insamp) & (insamp > qlevel4))
quantizer_out=12;
end;

if((qlevel4 >= insamp) & (insamp > qlevel5))
quantizer_out=11;
end;

if((qlevel5 >= insamp) & (insamp > qlevel6))
quantizer_out=10;
end;

if((qlevel6 >= insamp) & (insamp > qlevel7))
quantizer_out=9;
end;

if((qlevel7 >= insamp) & (insamp > qlevel8))
quantizer_out=8;
end;

if((qlevel8 >= insamp) & (insamp > qlevel9))
quantizer_out=7;
end;

if((qlevel9 >= insamp) & (insamp > qlevel10))
quantizer_out=6;
end;

if((qlevel10 >= insamp) & (insamp > qlevel11))
quantizer_out=5;
end;

if((qlevel11 >= insamp) & (insamp > qlevel12))
quantizer_out=4;
end;

if((qlevel12 >= insamp) & (insamp > qlevel13))
quantizer_out=3;
end;

if((qlevel13 >= insamp) & (insamp > qlevel14))
quantizer_out=2;
end;

if((qlevel14 >= insamp) & (insamp > qlevel15))
quantizer_out=1;
end;

if(qlevel15 >= insamp)
quantizer_out=0;
end;

function unquantizer_out = unquantizer(insamp)

% unquantizer for delta-sigma modulator

qlevel0 = 32768;
qlevel1 = 28672;
qlevel2 = 24576;
qlevel3 = 20480;
qlevel4 = 16384;
qlevel5 = 12288;
qlevel6 = 8192;
qlevel7 = 4096;
qlevel8 = 0;
qlevel9 = -4096;
qlevel10 = -8192;
qlevel11 = -12288;
qlevel12 = -16384;
qlevel13 = -20480;
qlevel14 = -24576;
qlevel15 = -28672;
qlevel16 = -32768;

if(insamp == 16)
unquantizer_out=qlevel0;
end;

if(insamp == 15)
unquantizer_out=qlevel1;
end;

if(insamp == 14)
unquantizer_out=qlevel2;
end;

if(insamp == 13)
unquantizer_out=qlevel3;
end;

if(insamp == 12)
unquantizer_out=qlevel4;
end;

if(insamp == 11)
unquantizer_out=qlevel5;
end;

if(insamp == 10)
unquantizer_out=qlevel6;
end;

if(insamp == 9)
unquantizer_out=qlevel7;
end;

if(insamp == 8)
unquantizer_out=qlevel8;
end;

if(insamp == 7)
unquantizer_out=qlevel9;
end;

if(insamp == 6)
unquantizer_out=qlevel10;
end;

if(insamp == 5)
unquantizer_out=qlevel11;
end;

if(insamp == 4)
unquantizer_out=qlevel12;
end;

if(insamp == 3)
unquantizer_out=qlevel13;
end;

if(insamp == 2)
unquantizer_out=qlevel14;
end;

if(insamp == 1)
unquantizer_out=qlevel15;
end;

if(insamp == 0)
unquantizer_out=qlevel16;
end;

--[[ ]]--