Sine waves for dummies

I am fiddling with a little project trying to mathematically isolate variations in a wave pattern.

I have little experience with sine functions and although I have a basic grasp of the angle relationships my question is not how to determine sin(x) but how to vary amplitude of the wave. I have easily enough determined that by using smaller increments I can vary the frequency of the wave.

Would x=sin(y) +/- z be the best way?

Be gentle, geometry was a long time ago and I never took trig. What I do know about trig is from self study/free internet tutorials and is shaky at best.

x = A*sin(y)
where A is the amplitude. If A is a variable then you have amplitude modulation.

It will be a variable…thank you…why multiplying it never occurred to me I will never know.

Let’s be more general, just for fun. Assuming

t is time
A(t) is the amplitude at time t
f(t) is the frequency (number of cycles per second, Hertz) at time t
p(t) is the phase offset in fractions of a cycle at time t

then:

x(t)=A(t)sin(tf(t)2pi + 2pi*p(t))

Of course this can be reformulated in a bunch of different ways. The phase offset is often stated in terms of radians in which case the 2pip(t) becomes just p(t).

Any of A(t), f(t), or p(t) can be constants, or functions that themselves varies over time, though you probably don’t want them varying over time very extremely or the sine wave will become unrecognizably distorted. For a sine wave with no phase offset (starts at 0 and then increases), phase offset is zero, and that part of the sum inside just vanishes.

Also extremely helpful…thank you.

I am actually trying to write a set of criteria to identify and or alert when certain waveform variations occur. For comparison imagine trying to write a computer program to analyze heart activities and isolate certain abnormal rhythms.

As a baseline for the algorithm I need something that will generate a wave function that I can plug in variations to see if the system recognizes them.
Eventually the system will be able to randomly insert variations and the program will alert the user if dangerous conditions arise.

So in a nutshell I am trying to write a formula/set of criteria to perform a type of medical monitoring that could eventually be made into a type of monitoring equipment, sorry I would prefer not to be much more specific for potential patent purposes.

You should probably be aware of autocorrelation functions and fourier transforms and other types of wave transforms too, then, as knowing about them will probably give you guidance in how to do signal analysis, which is what it sounds like you’re doing.

But I’ll leave it at that for now, as discussions on these topics and the implications can get kinda mathematically hairy, I’m not 100% familiar with them, and applying it to heart rhythms would be challenging. But very cool.

Although now I’m starting to see how one could do fourier transform to monitor beat frequencies, and an autocorrelation to verify that the heartbeat matches a known norm…

Hmm…

No, no, must go back to my own projects! :smiley:

just googled fourier transforms and autocorrelation functions…

Oooh look…basics of autocorrelation…

click link…loading…:eek: BLAM

I hate it when I have a brain BLEVE

Looks like advanced math has better tools to achieve what I am trying to do. :smiley:

Still going to try, I’m sure I can teach myself calculus in a few weeks. :smack: :rolleyes: :smack:

While autocorrelation and fourier transforms have their basis in calculus, you can (in the short term) get by without it…

Specifically, study the discrete-time variations on these, which involve summations of products of data points and test signals, rather than the tougher continuous-time calculus. (Integration in the continuous-time domain is roughly analagous to summation in the discrete-time domain).

Basically they can be done with simple for loops and array elements of data points.

Don’t let the calculus mess with you too much.

The task looked like this would do it before I ever heard of correlation or transforms. Deviation from average baseline for over x time index and is the deflection + or - in relation to baseline. Between the web, and MS-Excel I’m sure I can pull it off. The main trick is just finding the formula to plug in the numbers. Excel seems to have fourier analysis functions of some kind…I will dig into the help files more later.