Ehlers FM Demodulator

Deriv = 10 * C - O;

type or paste code here

HL = IIf( Deriv < -1 ,-1 ,IIf( Deriv > 1, 1, Deriv));

Not a programmer but trying to do Ehlers FM Demodulator in May S&C.
This is just returning +1 not -1 or Deriv.

type or paste code here

Jim`Code button (use to enter/paste AFL formula)``Code button (use to enter/paste AFL formula)`

@semaj2, welcome to this Community.

You need to take into account the mathematics' operator precedence rules:


Deriv = 10 * ( C - O );

In your code, you were multiplying C * 10 then subtracting the O value (practically getting always a positive result number - assuming that C is a positive value not far from O).

P.S. When publishing code, you should always use specific tags; I see you've tried using them, but you've probably messed up the editor a bit. Use the preview windows to verify that your post is formatted correctly.
If necessary, shortly after posting, you can edit again (using the pencil icon) to correct any errors or better format the message.

1 Like

ok Thanks
just missed the paren

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.