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
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.
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.
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.
View Charts:
Time Domain Chart: Shows the amplitude of the noise signal over time.
Frequency Domain (PSD) Chart: Displays the Power Spectral Density.
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.
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
Generates: Uniform White, Gaussian White, Periodic, Inverse-f (Pink), Brown (1/f²), and Custom
Periodic noise.
Automatic chart updates upon changing noise type, number of samples, or sample rate.
"Re-Generate" button for new instances of the selected noise.
Clear visualization of signals in both Time Domain and Frequency Domain.
Adjustable number of samples (auto-adjusted to power of 2 for FFT) and sample rate.
Interactive controls for PSD chart display:
Switchable X-axis (Frequency): Linear / Logarithmic.
Switchable Y-axis (Power): Linear (dB) / Logarithmic (Power Ratio).
Toggleable Y-axis autoscaling for both charts (ON by default), with state preservation when OFF.
Data export functionality for both time and frequency domain data (PSD always exported in dB) to CSV
files.
Responsive layout for different screen sizes.
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:
Uniform White Noise: Characterized by a flat power spectral density, meaning it has
equal power across all frequencies up to the Nyquist frequency. The amplitudes of the noise samples
are drawn from a uniform statistical distribution.
Gaussian White Noise: Similar to uniform white noise in its flat frequency
spectrum, but its amplitudes follow a Gaussian (normal) distribution. This is a common model for
many natural noise sources.
Periodic Noise: Consists of one or more sinusoidal components at specific
frequencies. The 'Periodic Noise' option here generates a signal with two predefined sine waves (5
Hz and 15 Hz). The 'Custom Periodic' option allows you to define the frequencies and amplitudes of
two sine waves. This can simulate interference like AC hum.
Inverse-f Noise (Pink Noise): Exhibits a power spectral density that is inversely
proportional to frequency (P(f) ~ 1/f). This means its power decreases by approximately
3 dB per octave. Pink noise is found in many natural systems, biological processes, and even in
music.
Brown Noise (1/f² Noise or Brownian Noise): Has a power spectral density that is
inversely proportional to the square of the frequency (P(f) ~ 1/f²). Its power
decreases by approximately 6 dB per octave. The name comes from Brownian motion, as the signal
resembles the random walk pattern of particles. It sounds "softer" or "lower-pitched" than white or
pink noise.
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
More Noise Types: Incorporate other noise models like violet noise (power
proportional to f²) or grey noise (perceptually uniform loudness over frequencies).
Filtering: Add options to apply basic filters (low-pass, high-pass, band-pass) to
the generated noise.
Signal Combination: Allow users to combine generated noise with simple
deterministic signals (e.g., a sine wave) to observe Signal-to-Noise Ratio (SNR) effects.
Windowing Functions for FFT: Implement selectable windowing functions (e.g.,
Hanning, Hamming) before FFT to reduce spectral leakage.
Real-time Audio Output: Add the ability to play the generated noise signals as
audio (requires Web Audio API).
Enhanced PSD Options: Options for different PSD estimation methods or averaging.
Persistence: Save user settings (e.g., selected noise type, sample rate) locally in
the browser.
Interactive Parameter Help: Add tooltips or inline help explaining each parameter
in more detail.
UI/UX Enhancements: Further refine the user interface for even better clarity and
ease of use.
Power Axis Display Consideration: The current "Power Axis: Log" option converts dB
values to power ratios for logarithmic display. While this is technically sound for visualizing wide
dynamic ranges, its practical utility compared to a direct linear dB scale can be evaluated based on
user feedback. If the dB scale is generally preferred and sufficient, simplifying by removing the
log power ratio option could be considered to reduce interface complexity.