Synthetic Noise Generator Dashboard

Noise Generator Controls

512 200

Time Domain

Frequency Domain (PSD)

Audio Overview

Immerse yourself in the audio overview of this web application, where we explain its features, functionality, and scientific significance in an engaging format.

This interactive dashboard allows you to generate, visualize, and analyze various types of synthetic noise signals. You can explore their characteristics in both the time domain (how the signal behaves over time) and the frequency domain (the distribution of power across different frequencies via Power Spectral Density - PSD). The tool is designed for educational purposes, offering insights into common noise types encountered in signal processing, electronics, and natural phenomena.

How to Use

  1. Select Noise Type: Choose a noise type (e.g., White, Pink, Brown) from the dropdown menu in the "Noise Generator Controls" section. The charts will update automatically to reflect your selection.
    • For "Custom Periodic" noise, additional input fields for frequencies and amplitudes of two sine waves will appear.
  2. Adjust Parameters: Use the sliders to set the desired number of "Samples" and the "Sample Rate (Hz)". The charts will update automatically. Note that the number of samples will be adjusted to the nearest lower power of 2 for optimal Fast Fourier Transform (FFT) performance.
  3. Re-Generate Noise: Click the "Re-Generate" button to create a new random instance of the currently selected noise type with the current settings. This is useful for observing different realizations of stochastic noise.
  4. View Charts:
    • Time Domain Chart: Shows the amplitude of the noise signal over time.
    • Frequency Domain (PSD) Chart: Displays the Power Spectral Density.
  5. Control Chart Display (in "Noise Generator Controls"):
    • Freq Axis (Log/Lin): Toggles the X-axis of the PSD chart between a linear and a logarithmic scale.
    • Power Axis (Log/Lin): Toggles the Y-axis of the PSD chart.
      • Lin: Displays power in decibels (dB) on a linear scale. The Y-axis label will be "Power (dB)".
      • Log: Converts dB values to linear power ratios (calculated as 10^(dB/10)) and displays these positive ratios on a logarithmic scale. This mode is useful for visualizing a wide dynamic range of power values. The Y-axis label will change to "Power Ratio (Log Scale)".
    • Autoscale Y (ON/OFF): Toggles Y-axis autoscaling for both charts. Autoscale is ON by default. When turned OFF, the Y-axis limits active at that moment are preserved for subsequent parameter changes or display updates, until Autoscale is turned ON again.
    Note: These display controls update the current view without regenerating the underlying noise data.
  6. Export Data: Click the "Export CSV" button to download two CSV files: one for the current time domain data (time vs. amplitude) and one for the frequency domain data (frequency vs. power in dB). The frequency domain data is always exported in dB for consistency, regardless of the current "Power Axis" display setting.

Features

Scientific Explanation

Noise: In signal processing, noise refers to unwanted or random disturbances that can obscure or interfere with a desired signal. It can arise from various sources, including thermal agitation of electrons, atmospheric disturbances, or imperfections in electronic components.

Types of Noise Signals:

Inverse-f Noise and its Relation to Baseline EEG

Inverse-f noise (pink noise) is particularly interesting in neuroscience. Baseline Electroencephalography (EEG) recordings, which measure the brain's electrical activity in a resting state, often exhibit a power spectrum that approximates a 1/f distribution. This means lower frequencies (like delta and theta waves) typically have higher power, which then tapers off for higher frequencies (beta, gamma). This similarity suggests that the brain's spontaneous activity might share fundamental organizational principles with other complex systems that produce 1/f noise, possibly reflecting scale-free dynamics or a balance of excitatory and inhibitory processes.

Technical Details

This tool is built using HTML, CSS, and vanilla JavaScript. Charting is powered by Chart.js. All noise generation, Fast Fourier Transform (FFT), and Power Spectral Density (PSD) calculations are performed client-side in your browser.

FFT Implementation: A basic recursive Cooley-Tukey Fast Fourier Transform algorithm is used. For optimal FFT performance and correctness of this algorithm, the number of samples is automatically adjusted to the largest power of 2 that is less than or equal to the user's selection.

PSD Calculation: The PSD is calculated from the squared magnitude of the FFT components, scaled appropriately, and converted to decibels (dB) for display (10 * log10(Power)). When the "Power Axis" is set to "Log", these dB values are converted back to linear power ratios (10^(dB/10)) before being plotted on a logarithmic scale.

Limitations of JavaScript vs. Python: While JavaScript is highly capable for web-based signal processing demonstrations like this, dedicated scientific computing environments such as Python (with libraries like NumPy and SciPy) offer more highly optimized numerical routines, potentially higher precision for certain operations, and generally better performance for very large datasets or computationally intensive algorithms. This tool is primarily for educational and illustrative purposes.

Future Directions & Potential Improvements