Skip to content

Production-ready animations, transitions, backgrounds, and scenes for Remotion

2.7 KB
Raw Blame
---
title: Fourier Sum
description: "Sine harmonics are drawn one by one, merge into a square wave and a serif caption lands below"
component: fourier-sum
vibe: data
length: 142
useWhen:
  - "Explaining how many simple parts combine into one result (\"Many parts. One signal.\")."
  - "A technical or education beat that needs a clean mathematical visual."
  - "A product story about composing small components into a whole."
avoidWhen:
  - "You want to show a real data series over time — use `animated-line-chart`."
  - "The idea is rhythm or phase between many moving items — use `pendulum-wave`."
  - "You need parts adding up to a total with labels — use `core-sum`."
askedAs:
  - "sine waves combine into square wave"
  - "many parts one signal"
  - "I want to explain that simple waves add up to one result"
  - "technical explainer showing harmonics merging with a serif caption"
  - "signal processing math visual for a developer audience"
  - "fourier series animation"
---

<ComponentPreview name="fourier-sum" />

<InstallBlock name="fourier-sum" />

## Usage

```tsx
// src/Root.tsx
import { Composition } from "remotion";
import { FourierSum } from "@/components/remocn/fourier-sum";

const FourierSumScene = () => (
  <FourierSum harmonics={[1, 3, 5, 7, 9]} title="Many parts. One signal." />
);

export const RemotionRoot = () => (
  <Composition
    id="FourierSum"
    component={FourierSumScene}
    durationInFrames={175}
    fps={30}
    width={1280}
    height={720}
  />
);
```

Rows of sine waves draw in one by one. They then merge in order into a summed wave while a running "1× + 3× + 5×" caption builds, and the `title` fades in below. Pass `harmonics` (odd numbers give a square wave), `title` and `periods`. Ships dark and light via `theme`.

<PropsTable title="Props"
  rows={[
    {
      name: "harmonics",
      type: "number[]",
      default: "[1, 3, 5, 7, 9]",
      description: "Harmonic numbers to draw, one wave each. Odd numbers build a square wave.",
    },
    {
      name: "title",
      type: "string",
      default: "\"Many parts. One signal.\"",
      description: "Caption shown after the waves merge.",
    },
    {
      name: "periods",
      type: "number",
      default: "2",
      description: "How many wave periods fit across the width.",
    },
    {
      name: "accent",
      type: "string",
      default: "\"#3B5BFD\"",
      description: "Color of the row labels.",
    },
    {
      name: "speed",
      type: "number",
      default: "1",
      description: "Playback speed multiplier for the whole timeline.",
    },
    {
      name: "theme",
      type: "\"dark\" | \"light\"",
      default: "\"dark\"",
      description: "Color scheme. Ships dark and light.",
    },
  ]}
/>