Sine wave geberation 
Author Message
 Sine wave geberation

;I don't know if anyone has seen this,
;but here's a port to Logo of an
;interesting algorithm for generating
;sine waves - without trig or look-up
;tables! It was written by Chip Gracey
;of Parallax, Inc.(microcontrollers)
;and appeared in a "Core Technologies"
;article in the December, 1994 issue
;of BYTE magazine - and I'm still
;trying to figure out how it works : ).
;Enjoy!

TO SINE
MAKE "AMP  64    ; AMPLITUDE
MAKE "FREQ 1     ; FREQUENCY
MAKE "VELOCITY 0
MAKE "X 1000     ; assumes WINDOW
                 ; ACTIVE AREA X=-/+500
CLEARSCREEN
HIDETURTLE
PENUP
SETXY -500 :AMP  ; go to left edge start
PENDOWN                        
FOR [I 0 :X  :FREQ]                   ~
   [ IFELSE :AMP < 0                  ~
        [MAKE "VELOCITY :VELOCITY+1]  ~
        [MAKE "VELOCITY :VELOCITY-1]  ~
     MAKE "AMP :AMP+:VELOCITY         ~
     SETXY  :I-500  :AMP              ~
    ]
END



Wed, 15 Mar 2000 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Slightly off-topic question about sine waves

2. To trigger a pulse at the natural zeroes of a sine wave

3. new to labview: want vi for sine wave generator

4. Coutinuous sine wave output with a changing frequency

5. Help generating a 50 kilohertz sine wave

6. how to obtain a sine wave polar representation?

7. How to Generate a Swept Sine Wave

8. How to start data acquisition when a sine wave starts or finishes

9. Want to "hear" sine wave

10. Help with offset sine wave generation

11. Decaying Sine Wave Frequency Measurement

12. Help with offset sine wave generation

 

 
Powered by phpBB® Forum Software