📘 CodingMarble Learn

Various Waveforms: Sine, Square, Triangle and Transients

A waveform is a graph of voltage or current against time. Mains AC is a sine wave, but circuits also carry square, triangle and saw waves (non-sinusoidal AC). Any such wave is a sum of sine waves. After a switch is closed, voltage in an RC circuit rises along a curve with time constant τ = RC; this short settling stage is the transient.

🎬 Step-by-step story

  1. A waveform is a picture of voltage as time passes. This is a sine wave. The yellow ball shows the voltage now.
  2. Blue means the push goes one way. Orange means it goes the other way. A sine wave swings smoothly between them.
  3. A square wave does not swing smoothly. It jumps up, waits, then jumps down. Switches make this shape.
  4. A triangle wave goes up and down in straight lines. The saw wave climbs slowly and drops at once.
  5. Now add sine waves one by one. Slowly the sum turns into a square wave. So any odd wave is a team of sines.
  6. Close a switch on a capacitor and the voltage does not jump. It climbs slowly. Move the τ slider and try every wave yourself.

Tip: drag the 3D scene to turn it. Use two fingers to zoom.

🤔 Common doubts, cleared

What do blue and orange mean?

Blue means the voltage pushes one way (positive). Orange means it pushes the other way (negative).

Why does a square wave have no slope?

It switches at once between two levels, like a light switch.

Is a triangle wave the same as a sine wave?

No. The triangle has straight sides and a pointed top; the sine is curved all the way.

How can a square wave be made of curvy sines?

Add the 3rd, 5th, 7th ... sines in smaller amounts. Each one cuts the round top flatter. Watch the slider in the 3D.

Why does the capacitor not charge at once?

Current must carry charge in through the resistor, and the resistor limits it. As the capacitor fills, the push gets weaker, so it slows down.

What changes the speed of the rise?

A bigger R or bigger C makes τ bigger and the rise slower. Drag the τ slider to see.

What is a waveform?

A waveform is a graph. Time goes along the bottom. Voltage (or current) goes up the side. When the line is above the middle, the push is in one direction. When it is below, the push is reversed.

The time for one full pattern is the period (T). How many patterns fit in one second is the frequency (f). They are linked: f = 1 / T. India's mains: 50 Hz, so T = 0.02 s.

The highest point is the peak (Vm). The RMS value is the steady DC voltage that would heat a lamp equally. For a sine wave, Vrms = Vm / √2 (about 0.707 Vm).

Sine, square, triangle and saw waves

Sine wave: smooth. It is what a spinning generator coil makes, so mains power is a sine wave. A plain sine wave is called sinusoidal.

Any wave that is not a sine is non-sinusoidal. Common ones:

A sine wave is "clean". The others carry extra faster wiggles, and these can heat motors and disturb radios.

Non-sinusoidal waves are a sum of sines

A French scientist, Fourier, showed that any repeating wave is a sum of sine waves. The first sine is the fundamental. The others are harmonics, with 2, 3, 4 ... times the frequency.

A square wave needs only odd harmonics: fundamental + 1/3 of the 3rd + 1/5 of the 5th + ... The more you add, the sharper the corners. A triangle wave also uses only odd harmonics, but they shrink much faster, so it stays smooth.

Harmonics matter in real life: an inverter, a charger or a dimmer pushes harmonic currents back into the wiring.

Transient: what happens just after a switch

Close a switch on a resistor R in series with a capacitor C. The capacitor voltage does not jump. It climbs in a curve and then settles. This short settling stage is the transient. After it, the steady state begins.

The speed is set by the time constant τ = R × C (in seconds, with R in ohms and C in farads).

Charging: v = V (1 − e−t/τ). Discharging: v = V e−t/τ. An R-L circuit does the same with τ = L / R.

Try it: build a wave yourself

In the 3D scene press Build. Slide the "sine waves" slider from 1 to 9. Predict first: will the top become flatter or rounder? Then check. Next press Switch-on. Move τ to 3. Predict: does the curve rise faster or slower? Check where the green bar meets the curve: it is always at 63%.

At home: watch a small LED with a big capacitor and resistor in a kit. A larger R or C makes the LED fade more slowly.

Key formulas and definitions

Worked examples

1. A supply has frequency 50 Hz. Find its period.

T = 1 / f = 1 / 50 = 0.02 s = 20 ms.

2. The peak of a sine wave is 325 V. Find the RMS value.

V_rms = 325 / √2 = 325 / 1.414 ≈ 230 V.

3. R = 10 kΩ and C = 100 µF. Find τ.

τ = R C = 10 000 × 0.0001 = 1 s.

4. A 10 V source charges the capacitor in Example 3. What is the voltage after 1 s? After 5 s?

After 1 τ: 0.632 × 10 = 6.32 V. After 5 τ: about 0.993 × 10 = 9.93 V, almost full.

5. A square wave swings between +12 V and −12 V. What is its RMS value?

For a square wave V_rms = V_m = 12 V, because the voltage is always 12 V in size.

6. A wave repeats every 4 ms. What is its frequency?

f = 1 / T = 1 / 0.004 = 250 Hz.

Common mistakes

Practice quiz

1. Which wave has sharp corners and flat tops?
2. Mains AC is closest to a:
3. The time constant of an RC circuit is:
4. After one time constant the capacitor reaches about:
5. A square wave is made from:

Practice: answer these yourself

Type or choose your answer, then press Check. Use a hint if you are stuck; the full solution appears after you answer.

Frequently asked questions

What is a non-sinusoidal waveform?

It is any repeating wave that is not a pure sine, such as a square, triangle or saw wave. Mathematically it is a sum of a fundamental sine and harmonics.

What is a transient in an electric circuit?

It is the short time just after a switch is closed or opened, when voltages and currents are still settling to their steady values.

Why is five time constants taken as "fully charged"?

After 5 τ the capacitor has reached about 99.3% of the supply voltage, which is close enough to full for practical work.

Where this is taught

Japan高校(専門学科)1〜3年Electric Circuits

Learn first

Learn next

Related lessons

All Physics lessons