🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: rec.games.programmer
1 messages
1 total messages Started by jkchan Fri, 26 Oct 1990 13:19
re: discrete sin function programming (conclusion)
#972
Author: jkchan
Date: Fri, 26 Oct 1990 13:19
46 lines
2031 bytes
A week ago I asked for help for the discrete sin function programming
probelm I met.  Thanks for the responses.  All of you are very helpful
and my problem has been solved.

My original problem was frequency change in a sinusodal sine wave.  
For those who knows calculus, that is easy to understand:

In general:    y = M sin x     with w = dx/dt = 2 PI f

Now, for a constant frequency sine wave, f = f0,
               dx = 2 PI f0 dt
which integrates to
                x = 2 PI f0 t + c          (if we set x=c when t=0)
Hence,          y = M sin (2 PI f0 t + c)   
which is the well-known simple (constant frequency) sinusodal equation.

But, for a linear frequency changing waveform, f = f0 + k t,
where k is a proportionality constant,
we have     
               dx = 2 PI (f0 + k t) dt
which integrates to
                x = 2 PI f0 t + 2 PI k t**2 / 2 + c
where c is the integration constant.
Then            y = M sin (2 PI f0 t + 2 PI k t**2 / 2 + c)
which is the correct model for a linear frequency changing sinusodal waveform.

My mistake was that I just change the frequency of the constant frequency
sinusodal equation from
                y = M sin (2 PI f0 t + c)
to
                y = M sin (2 PI (f0 + k t) t + c)
which expands to
                y = M sin (2 PI f0 t + 2 PI k t**2 + c)
and is incorrect.

You can see the 1/2 factor is missing in the incorrect equation.  Very 
interesting!  Thanks a million to all of you.  I appreciate it.

Jim


-- 
Jim Chan
Hearing Lab
Communication Sciences and Disorders
School of Special Education
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads