Matrix Generator
Shippingmatrix_generatorSynthetic 2-D matrix source: gaussian, product, ripple, checkerboard
Signature
Outputs
matrixMatrix
Parameters
| Key | Type | Default | Notes |
|---|---|---|---|
rows | int | 50 | |
cols | int | 50 | |
pattern | enum | gaussian | one of: gaussian, product, ripple, checkerboard |
amplitude | float | 1.0 | |
sigma | float | 0.3 |
Description
Matrix Generator is a pure source node that synthesizes a 2-D Matrix of shape rows x cols filled with one of four deterministic surface patterns: gaussian, product, ripple, or checkerboard. It takes no inputs and emits a single matrix output. It is stateless — the same parameters produce the identical matrix on every evaluation, with no dependence on time, prior runs, or upstream data.
The patterns are evaluated over a normalized coordinate grid. Let and range across the columns and rows respectively (conventionally normalized to or ). The gaussian pattern places a centered radial bump whose spread is set by sigma; the product pattern is a separable saddle; ripple is a radially oscillating modulated by sigma; and checkerboard alternates sign per cell. All patterns are scaled by amplitude.
The output carries no physical unit (dimensionless) and zero uncertainty (): values are exact analytic samples, not measurements. Downstream nodes that expect units or uncertainty will treat the matrix as an exact dimensionless field. sigma here is the geometric spread of the surface, not a measurement standard deviation, and is clamped to a minimum of 0.001 to avoid a degenerate zero-width bump.
Use it as a controlled, reproducible 2-D field for testing image/array pipelines, calibrating surface operators, and seeding N-D processing chains without needing external data.
Mathematics
Examples
Centered Gaussian test surface
Generate a Gaussian bump for testing a 2-D smoothing or FFT stage.
rows = 128
cols = 128
pattern = gaussian
amplitude = 1.0
sigma = 0.25The output is a smooth radial peak of height at the grid center, decaying to near zero at the edges. Feed matrix into an fft node to inspect its (also Gaussian) 2-D spectrum.
Checkerboard for edge/aliasing checks
Set pattern = checkerboard with amplitude = 1.0 to emit a alternating grid. This maximal-frequency pattern is ideal for probing resampling artifacts, interpolation kernels, and edge-detection responses since every adjacent cell flips sign: .
Applications
- Deterministic test fixtures for validating 2-D array pipelines (smoothing, FFT, thresholding) without external image data.
- Generating synthetic point-spread-function-like Gaussian surfaces for calibrating deconvolution or peak-localization operators.
- Producing checkerboard targets to characterize aliasing, interpolation, and modulation-transfer-function behavior of resampling stages.
- Seeding N-D simulation and visualization demos with reproducible analytic fields for teaching and benchmarking.
Neat
Because output is fully determined by parameters, the node is trivially cacheable and bit-for-bit reproducible across runs and machines — unlike stochastic sources such as `noise_generator`.
The `product` pattern $A\,x\,y$ is a rank-1 separable saddle, so its 2-D singular value decomposition has exactly one nonzero singular value — a handy analytic check for SVD-based tooling.
Known issues
`sigma` is clamped at `0.001`; extremely small values still concentrate the Gaussian into a single central cell, so on coarse grids the bump may span only one pixel and undersample the intended surface.
The coordinate grid is defined implicitly by `rows` and `cols`; with `rows != cols` the normalized aspect ratio is non-square, so radially symmetric patterns (`gaussian`, `ripple`) appear elliptically stretched in cell space.