Skip to main content
Public

Share visualization

Loading preview…

sine wave Generator

vizhub.com

Shared links may look like this on X, LinkedIn, Slack, and Discord.

Before sharing, review the publishing checklist.

Choose how to deliver this visualization

LinkedIn caption

LinkedIn may not keep text supplied by the share sheet. Copy the caption and paste it into the post if needed. You can tag the VizHub company page when posting.

More options

Embed on a websiteCopy iframe embed code
Download & exportPNG, HTML, source ZIP

sine wave Generator

1
DDonald Bagwell
Last edited Jul 1, 2024
Created on Jun 28, 2024
Forked from sine wave for FFT

This visualization demonstrates the summation of three independently generated sine waves, combining them into a single composite signal. The line chart plots signal amplitude against sequential data points, with the combined waveform rendered as a continuous black line over a gray background. Built with D3.js, the example uses `scaleLinear` for both axes, a D3 `line` generator for the path, and custom `sineGenerator` functions that compute waveforms using the formula sin(2π·frequency·t). The code also leverages `observeResize` from `@drbagwell/responsive-viz-axes` for responsive sizing and displays axis labels for data points and amplitude.

AI-generated description

Overview Time to dabble with the infamous FFT in javascript. Starting with a simple script to generate sine waves for testing.

export const sineGenerator = (freq, dInSeconds, sRate) => { // Parameters for the sine wave const frequency = freq; const durationInSeconds = dInSeconds; const sampleRate = sRate;

Discrete Fourier Transform - Simple Step by Step https://www.youtube.com/watch?v=mkGsMWi_j4Q

Understanding the Discrete Fourier Transform and the FFT https://www.youtube.com/watch?v=QmgJmh2I3Fw&t=3s

Comments

Sign in to join the discussion.

MIT Licensed