noise_gen: Generate Synthetic Noise

View source: R/utils_data.R

noise_genR Documentation

Generate Synthetic Noise

Description

Generate Synthetic Noise

Usage

noise_gen(n = 500, type = "gaussian", level = 0.01, seed = NULL)

Arguments

n

Integer. Number samples to generate. Default is 500.

type

Character string specifying the type of noise to generate. Supported types:

  • "gaussian": Standard normal distribution.

  • "uniform": Uniform distribution between -level and +level.

  • "lognormal": Log-normal distribution.

  • "t_distributed": Heavy-tailed t-distribution with 3 degrees of freedom.

  • "cauchy": Extremely heavy-tailed Cauchy distribution.

  • "beta_noise": Beta distribution shifted and scaled to ⁠[-level, level]⁠.

  • "exponential": Positive-only exponential distribution.

  • "microstructure": Oscillatory sinusoidal pattern with additive Gaussian noise.

level

Numeric. Controls the scale (standard deviation, range, or spread) of the noise. Default is 0.01.

seed

Optional integer. Sets a random seed for reproducibility.

Value

A tibble with two columns:

  • value: Numeric vector of generated noise samples.

  • type: Character string indicating the type of noise.

Examples

# Gaussian noise with small scale
noise_gen(500, type = "gaussian", level = 0.05)

# Heavy-tailed noise
noise_gen(500, type = "t_distributed", level = 0.1)


spinebil documentation built on Nov. 5, 2025, 7:35 p.m.