Introduction - If you have any usage issues, please Google them yourself
v1=v1';
code=v1(:,2);
code_count=zeros(1,2^numbit); %Code count
for i=1:size(code),
code_count(code(i)+1)=code_count(code(i)+1) + 1;
end
%Routine to detect whether the ADC's input is clipping or not
if code_count(1) == 0 | code_count(2^numbit) == 0 | ...
(code_count(1) < code_count(2)) | (code_count(2^numbit-1) > code_count(2^numbit))
disp('Increase Sine-Wave Amplitude to Slightly Clip the ADC!!!');
break;
end