Skip to main content
100%

sine wave Generator

✓ Published1🌍 Public
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

MIT Licensed

Similar vizzes