Re: matlab problem
N=2^14;
width=16;
in=1024*ones(1,N);
feedback(1)=0;
sum_b(1)=0;
sum_c(1)=0;
sa(1)=in(1);
for t=2:N;
sum_a(1)=sa(1);
sum_b(t)=sum_a(t-1)+sum_b(t-1);
sum_c(t)=sum_b(t)+sum_c(t-1);
sum(t)=bitshift(sum_a(t-1),1)+sum_b(t)+sum_c(t);
half_sum(t)=bitshift(sum(t),-1);
out(t)=bitshift(sum(t),4-width);
out_value(t)=bitshift(out(t),width-4);
feedback(t)=half_sum(t)-out_value(t);
sa(t)=in(t)-feedback(t);
sum_a(t)=sa(t)+sum_a(t-1);
end
This is my matlab program. 4 MSBs are output, the left 12 LSBs are feedback. The result is: when 'in' is smaller than 1024, after some cycles the feedback turn to be the same with 'in', and out will be 0. When 'in' is equal to or bigger than 1024, the out and feedback will get huge! Doesn't it mean when the feedback is 12 bits, then the input range is 10 bits?
And why when the input is in this range, the output turn to be zero for ever? According to the theory of modulator, the output is not this. I don't know what's the problem.