Code covered by the BSD License  

Highlights from
SDToolbox 2

image thumbnail
from SDToolbox 2 by Piero Malcovati
Simulation of sigma-delta modulators

ADconv(Vin,Vthreshold)
function com = ADconv(Vin,Vthreshold)
% Implements the ADC (by A. Fornasari, P. Malcovati)
%
% com = ADconv(Vin,Vthreshold)
%
% Vin:			Input signal
% Vthreshold:	Threshold voltage array
%
% com:			Quantized output voltage (decimal representation)

termometric=((Vin-Vthreshold)>0);

com=sum(termometric)+1;

Contact us at files@mathworks.com