classFFT of sine waves
This visualization demonstrates the Fast Fourier Transform by combining three sine waves (at 5, 8, and 15 Hz) into a single signal and computing its frequency spectrum. The code generates the composite waveform using `sineGenerator`, then applies the `FFT` class from `@drbagwell/dft_fft_classes` to transform 1024 sampled points, logging the resulting spectrum to the console. Built with D3.js and `observeResize` for responsive axes, the example focuses on the algorithmic FFT computation rather than rendering a visual plot.
AI-generated descriptionOverview 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