discrete sin fuction programming (conclusion)

jkchan at rodan.acs.syr.edu jkchan at rodan.acs.syr.edu
Fri Oct 26 23:21:00 AEST 1990


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



More information about the Comp.unix.programmer mailing list