[Ktechlab-devel] Understanding signals...

Alan Grimes agrimes at speakeasy.net
Fri Jun 16 06:35:44 UTC 2006


I stumbled on "elementsignal.h" and -- ouch...


Any signal can be expressed as:

	X = f(t);

Okay... what does f(t) look like?


Answer:

f(t) = k * sum( k_1 * sin(L_1 * t + M_1) + K_2 * sin(L_2 * t + M_2 )...);

We are only concerned with a single waveform...

Common waves in electronics are, of course, sin(), square(), triangle(),
and noise(), which is some random sequence of voltages.

The standard library gives us sin(), We therefore need to know three
things, the frequency, the voltage, and the _PHASE ANGLE_  -- where we
are in the wave at this specific instant. -- time is an external variable.

To compute a voltage for a given instant we need to know any specific
time-phase-angle pair and the current time.


Okay, we have our equation:

V_T = V * sin(freqency * t);

What happens when we try:

V_T = V * sqare(freqency * t);

Okay, it takes the phase angle as the prameter... So:

trunc(phaseAngle/pi) is either even or odd... If it's odd we return +1,
if even, we return -1, in fact square is actually the sum of a base
frequency and all of its odd harmonics... -- we don't have time to add
an infinite string of sine waves...

I'm not sure exactly how a triangle wave is derived but we can hack
together a function, lets see if this works:


	phaseAngle/pi = X

The triangle wave is better treated as a cos() wave.

The integer portion is either even or odd as above,

If it is even we compute triangle() as:

triangle = 2 * (X + 0.5).

otherwise:

triangle = 2 * (0.5 - X).




RMS voltage: Dorks such as myself are more used to RMS voltages...

VRMS for a sin wave, I think, = X /sqrt(2),
For a square wave = X /2.

For a triangle wave, -- I don't know off the top of my head, hafto
figure it out...

-- 
Don't let your schoolwork get in the way of your learning.

### NEW E-MAIL: agrimes at speakeasy.net ###




More information about the Ktechlab-devel mailing list