DECLARE FUNCTION radiansof! (radians!) DECLARE FUNCTION degreesof! (radians!) SCREEN 12 red = 1 blue = 1 green = 1 white = 1 runfirst = 1 DO IF runfirst = 0 THEN DO: a$ = INKEY$: LOOP WHILE a$ = "" runfirst = 0 IF a$ = CHR$(27) THEN END CLS '12,9,10 COLOR 12: PRINT "Press A to enable/disable plain 180 phase shift" COLOR 9: PRINT "Press B to enable/disable simple stretched 180 shift" COLOR 10: PRINT "Press C to enable/disable complex stretched 180 shift (Smooth)" COLOR 7: PRINT "Press D to enable/disable Zero-Line" COLOR 1: PRINT "Escape to exit" COLOR 7: PRINT "Horizontal gray line is zero crossing point." PRINT "Vertical gray lines are the active points of the wave, where sampling" PRINT "determines the phase. (Where our data bits are recovered.)" a$ = UCASE$(a$) IF a$ = "A" THEN IF red = 1 THEN red = 0 ELSE red = 1 IF a$ = "B" THEN IF blue = 1 THEN blue = 0 ELSE blue = 1 IF a$ = "C" THEN IF green = 1 THEN green = 0 ELSE green = 1 IF a$ = "D" THEN IF white = 1 THEN white = 0 ELSE white = 1 xs = 2 'xstep ys = 100 'yscale (size, pixels) IF white = 1 THEN COLOR 7 LINE (0, 240)-(650, 240) FOR n = 0 TO 640 STEP 143.5 LINE (n, 240 - 100)-(n, 240 + 100) 'LINE (n + 143 / 2, 240 - 100)-(n + 143 / 2, 240 + 100), 5 NEXT END IF IF red = 1 THEN COLOR 12 PSET (0, 240) yy = 0: xx = 0 fancy = 0 x = 0 deg = 0 DO IF fancy = 1 THEN deg = deg + 5 ELSE deg = deg + 5 END IF WHILE deg > 360 deg = deg - 360 WEND yy = y y = SIN(radiansof(deg)) * ys LINE (xx, 240 - yy)-(x, 240 - y) IF deg = 180 AND fancy = 1 THEN fancy = 3: deg = deg + 180 IF deg = 360 AND fancy = 0 THEN fancy = 1 xx = x x = x + xs LOOP WHILE x < 640 END IF IF blue = 1 THEN COLOR 9 xx = 0: yy = 240 PSET (0, 240) fancy = 0 x = 0 deg = 0 DO IF fancy = 1 THEN deg = deg + 2.5 ELSE deg = deg + 5 END IF WHILE deg > 360 deg = deg - 360 WEND yy = y y = SIN(radiansof(deg)) * ys LINE (xx, 240 - yy)-(x, 240 - y) IF deg = 180 AND fancy = 1 THEN fancy = 3 IF deg = 360 AND fancy = 0 THEN fancy = 1 xx = x x = x + xs LOOP WHILE x < 640 END IF IF green = 1 THEN COLOR 10 xx = 0: yy = 240 PSET (0, 240) fancy = 0 x = 0 deg = 0 DO IF fancy = 1 THEN deg = deg + 5 - (3.38 * SIN(radiansof(deg))) ELSE deg = deg + 5 END IF WHILE deg > 360 deg = deg - 360 WEND yy = y y = SIN(radiansof(deg)) * ys LINE (xx, 240 - yy)-(x, 240 - y) IF deg > 180 AND fancy = 1 THEN fancy = 3 IF deg = 360 AND fancy = 0 THEN fancy = 1 xx = x x = x + xs LOOP WHILE x < 640 END IF COLOR 7 LOOP WHILE a$ <> CHR$(27) END FUNCTION radiansof (radians) radiansof = radians * (3.141592654# / 180) END FUNCTION