AnsweredAssumed Answered

If then else algorithm, how to?

Question asked by leonxp on Nov 25, 2012
Latest reply on Nov 25, 2012 by leonxp

Hi everybody, I'd need to implement a simple logic comparison algorithm like this:

- Input source Vi is a sine with frequecy at 440Hz and Vi_Max = 1V and Vi_min = -1V

- Output Vo must be ever bounded between Vt_Max = 5V and Vt_min =-5V.

 

if(Vi_Max<=Vt_Max & Vi_min>=Vt_min) // is the same if I use |Vi|<Vt_Max

     Vo = Vi;

else

     Vo = Vi - (Vi_Max - Vt_Max);

 

How can I use a '<' or '>' comparator in a block program?

 

Thanks for your attention,

Regards.

leonxp

Outcomes