Schmitt trigger in software
Hello all!
I have to implement a Schmitt trigger in software on a DSP. I was thinkin
a while about a good implantation, but I just came to the simple solutio
with has nested if conditions (See Pseudo code below). Does anyone has
faster code??
-Thomas
for n = 1:length(x)
if flag
if x(n) > th
do something
flag = 0;
end
else
if x(n) < -th
do soming else
flag = 1;
end
end
end
|