1. DIGITAL COMMUNICATION USING MATLAB
Our online Tutors are available 24*7 to provide Help with Digital Communication
Homework/Assignment or a long term Graduate/Undergraduate Digital Communication Project.
Our Tutors being experienced and proficient in Digital Communication ensure to provide high
quality Digital Communication Homework Help. Upload your Digital Communication Assignment
at ‘Submit Your Assignment’ button or email it to info@assignmentpedia.com. You can use our
‘Live Chat’ option to schedule an Online Tutoring session with our Digital Communication
Tutors.
MULTI FEEDBACK SIGMA DELTA MODULATOR
This sample assignment shows A fairly hardware exact simulation of a multi-feedback SDM
MFB_SDM_4.m
%Multi-feedback SDM
%this is a simulation of a multi feedback SDM where we look at the noise
%generated after a lengthy simulation time. The inputs are the fraction we
%are trying to synthesize, and the number of bits for the accumulators.
%this is a case with fixed feedback gains of 1.
%The values in the accumulators are all positive, there is a translation
%from the inputs and outputs so we do not deal with negative values in
%these registers.
%The output is from -4 to +4, for example an accumulator value from 0 to
%(1/9)*2^AccumulatorSize would become -4 and from (8/9)*2^AccumulatorSize to the
%max value would be +4
%Adding dither fixes the issues at fractional amounts such as 0.5 but it
%appears if you simply do 0.50001 the thing works ok, simplest is to program in
%a little offset to any frequency you want, then you don't have to have a
%hardware solution. Should check with Monte Carlo simulation.
%The system is as follows;
% Fraction => Subtract => Accumulate1 => Subtract => Accumulate2 => Subtract => Accumulate3
=> Quantize => Divider
% ^ ^ ^ |
%
|_________________________|___________________________|_________________________|
%In steady state the outputs of the accumulators should equal the fraction
%value. In this simulation the quantizer does not provide feedback until a limit
%is reached, so the error output of the accumulators grows before feedback
%contains it.
%The error from accumulator 1 changes at a roughly linear rate, accumulator
%2 error changes at roughly an error^2 rate, and accumulator 3 is roughly an error^3 rate. The
%large swing this causes in the error out of accumulator 3 causes the
2. %quantizer to cover most of it's output values. The low gain quantized feedback to
%the 3 subtraction points keeps the system constrained.
%The number on the busses that connect the accumulators represents the
%fraction we want. Whatever number we enter for the fraction into the first
%accumulator is the number that should occur on all the busses. This is
%what would happen if there were continuous feedback, but in this case the
%quantizer is a gateway that allows feedback only when specific points are reached.
%The -4 to +4 on the output is mapped into equal regions of the number on
%the bus. For example if we have a bus of 27 bits, then the possible
%values on the bus are 0 to 2^27-1. We break this into 9 equal regions of
%width BinSize, calculated below. 0 to BinSize represents -4, BinSize to
%2*BinSize = -3, and so on. We calculate the desired fraction in terms of 2^27
% as shown for FractionalInternal. This is our desired fraction converted
% to our Bus value.
%My hypothesis is that the 3rd order SDM allows for finer resolution of
%small errors. The larger swings gives more granularity for discerning
%small differences in error. Simulations show no real improvement in close
%in noise sidebands if the order is increased higher than 3rd order.
%
%The accumulators are made 1 bit larger than the bus to ensure no overflow
%occurs, in any case there is a check for overflow.
%1/29/2013 added better plot system and description
%1/29/2013 changed the quantization mapping
clear
BusSize=28; %bits
NumberSamples=2^16;
BinSize=floor(2^BusSize/9);
Fraction=.5501; %usable -2.5 to +2.5
FractionInternal=2^BusSize*4.5/9 + floor(BinSize*Fraction);
AccumulatorBits=BusSize+1 ; %bits
AccumulatorSize=2^AccumulatorBits;
Y1(1:NumberSamples)=0;%feedback internally
U1_1(1:NumberSamples)=0;%First accumulator output
Y2(1:NumberSamples)=0;%feedback internally
U1_2(1:NumberSamples)=0;%First accumulator output
U2_2(1:NumberSamples)=0;%Second accumulator output
Y3(1:NumberSamples)=0;%feedback internally
U1_3(1:NumberSamples)=0;%First accumulator output
U2_3(1:NumberSamples)=0;%Second accumulator output
U3_3(1:NumberSamples)=0;%Third accumulator output
3. Yout1(1:NumberSamples)=0;%output to the divider for 1 stage SDM
Yout2(1:NumberSamples)=0;%output to the divider for 2 stage SDM
Yout3(1:NumberSamples)=0;%output to the divider for 3 stage SDM
for index=2:NumberSamples
if U1_1(index-1)>=8*BinSize
Yout1(index)=4;
elseif U1_1(index-1)>=7*BinSize
Yout1(index)=3;
elseif U1_1(index-1)>=6*BinSize
Yout1(index)=2;
elseif U1_1(index-1)>=5*BinSize
Yout1(index)=1;
elseif U1_1(index-1)>=4*BinSize
Yout1(index)=0;
elseif U1_1(index-1)>=3*BinSize
Yout1(index)=-1;
elseif U1_1(index-1)>=2*BinSize
Yout1(index)=-2;
elseif U1_1(index-1)>=1*BinSize
Yout1(index)=-3;
else
Yout1(index)=-4;
end
Y1(index)=(Yout1(index)+4.5)*BinSize;
U1_1(index)=FractionInternal-Y1(index)+U1_1(index-1);
if U2_2(index-1)>=8*BinSize
Yout2(index)=4;
elseif U2_2(index-1)>=7*BinSize
Yout2(index)=3;
elseif U2_2(index-1)>=6*BinSize
Yout2(index)=2;
elseif U2_2(index-1)>=5*BinSize
Yout2(index)=1;
elseif U2_2(index-1)>=4*BinSize
Yout2(index)=0;
elseif U2_2(index-1)>=3*BinSize
Yout2(index)=-1;
elseif U2_2(index-1)>=2*BinSize
Yout2(index)=-2;
elseif U2_2(index-1)>=1*BinSize
Yout2(index)=-3;
else
Yout2(index)=-4;
end
Y2(index)=(Yout2(index)+4.5)*BinSize;
U1_2(index)=FractionInternal-Y2(index)+U1_2(index-1);
4. U2_2(index)=U1_2(index) -Y2(index)+U2_2(index-1);
if U2_3(index-1)>=8*BinSize
Yout3(index)=4;
elseif U3_3(index-1)>=7*BinSize
Yout3(index)=3;
elseif U3_3(index-1)>=6*BinSize
Yout3(index)=2;
elseif U3_3(index-1)>=5*BinSize
Yout3(index)=1;
elseif U3_3(index-1)>=4*BinSize
Yout3(index)=0;
elseif U3_3(index-1)>=3*BinSize
Yout3(index)=-1;
elseif U3_3(index-1)>=2*BinSize
Yout3(index)=-2;
elseif U3_3(index-1)>=1*BinSize
Yout3(index)=-3;
else
Yout3(index)=-4;
end
Y3(index)=(Yout3(index)+4.5)*BinSize;
U1_3(index)=FractionInternal-Y3(index)+U1_3(index-1);
U2_3(index)=U1_3(index) -Y3(index)+U2_3(index-1);
U3_3(index)=U2_3(index) -Y3(index)+U3_3(index-1);
end
if max(U1_1)>AccumulatorSize
fprintf('nerror in U1_1n')
end
if max(U1_2)>AccumulatorSize
fprintf('nerror in U1_2n')
end
if max(U1_3)>AccumulatorSize
fprintf('nerror in U1_3n')
end
if max(U2_2)>AccumulatorSize
fprintf('nerror in U2_2n')
end
if max(U2_3)>AccumulatorSize
fprintf('nerror in U2_3n')
end
if max(U3_3)>AccumulatorSize
fprintf('nerror in U3_3n')
end
MeanFrac=mean(Yout3);
fprintf('nMeanFracMFB= %1.4fn',MeanFrac)
figure(2)
SignalFreq1=20*log10(abs(fft(Yout1)));
5. plot(fftshift(SignalFreq1)-max(SignalFreq1),'g')
hold on
grid on
axis([0 NumberSamples -150 0]);
SignalFreq2=20*log10(abs(fft(Yout2)));
SignalFreq3=20*log10(abs(fft(Yout3)));
plot(fftshift(SignalFreq2)-max(SignalFreq2),'r')
plot(fftshift(SignalFreq3)-max(SignalFreq3),'b')
legend('1 stage','2 stage','3 stage')
title('MFB SDM Noise')
hold off
visit us at www.assignmentpedia.com or email us at info@assignmentpedia.com or call us at +1 520 8371215