Skip to content

Triangle Waves FFT Analysis

Interactive visualization of triangle waves at multiple frequencies. Triangle waves feature linear ramps and contain odd harmonics with faster decay than square waves.

📐 Triangle Waves
4Hz11Hz28Hz
Time domain: linear ramps at 4, 11, 28 Hz

About Triangle Waves

Characteristics

  • Linear ramps: Smooth linear transitions between peaks
  • Continuous: No abrupt jumps (unlike square waves)
  • Odd harmonics: Same harmonic structure as square waves but with different amplitudes

Frequencies

This demo shows 3 different frequencies:

  • 4 Hz - Low frequency (cyan)
  • 11 Hz - Mid frequency (purple)
  • 28 Hz - Higher frequency (pink)

Harmonic Content

The FFT spectrum of a triangle wave shows peaks at:

  • Fundamental (f): The base frequency
  • 3rd harmonic (3f): 1/9 amplitude (1/3²)
  • 5th harmonic (5f): 1/25 amplitude (1/5²)
  • 7th harmonic (7f): 1/49 amplitude (1/7²)

The amplitude decreases as 1/n² - much faster than square waves!

Triangle vs Square Waves

PropertySquare WaveTriangle Wave
TransitionsInstantLinear
Harmonic decay1/n1/n²
SmoothnessSharpSmooth
BandwidthWideNarrower

Filter Effects

FilterEffect on Triangle WaveVisual Result
Low PassRounds peaks slightlyEven smoother
High PassSharpens transitionsMore angular
Band PassIsolates fundamentalsSine-like

Mathematical Definition

Triangle wave using Fourier series:

y(t) = (8/π²) × [sin(ωt) - sin(3ωt)/9 + sin(5ωt)/25 - ...]

Note the alternating signs and 1/n² decay pattern.

Why 1/n² Decay?

The faster harmonic decay is because triangle waves are continuous - they don't have the sharp discontinuities of square waves. Sharp edges require more high-frequency content to reproduce, hence square waves have stronger harmonics.

Released under the MIT License.