File:Blue-noise-trace.svg

Original file(SVG file, nominally 520 × 340 pixels, file size: 27 KB)

Captions

Captions

Blue noise trace

Summary edit

Description
English: Sampled trace of blue noise, that is random noise with a power spectral density proportional to the frequency f. The plot was sampled from discrete Gaussian white noise, that was then spectrally filtered.
Date
Source Own work
Author Geek3
SVG development
InfoField
W3C grn 
The SVG code is valid.
Created with Matplotlib-logo 
This plot was created with Matplotlib.
Source code
InfoField

Matplotlib source code

The plot was generated with Matplotlib
#! /usr/bin/env python3
# -*- coding:utf8 -*-

import matplotlib.pyplot as plt
import numpy as np
from math import *

plt.rcParams['font.sans-serif'] = 'DejaVu Sans'
np.random.seed(1)

"""
Note: Blue noise is actually not so well depictable. As more higher frequency
componentes are added, the amplitude goes to infinity and will be dominated
by high-frequency noise. Thus, the image changes a lot with the cutoff sampling
density. We choose roughtly half a linewidth for sampling for a decent
appearance.
"""

nsamples = 501
t0 = 1.
t = np.linspace(0, t0, nsamples)

dt = t[1:] - t[:-1]
white_noise = np.random.normal(0, 1, nsamples)
fourier_amplitudes = np.fft.rfft(white_noise)
frequencies = np.fft.rfftfreq(nsamples, d=t[1] - t[0])

fourier_amplitudes *= np.sqrt(frequencies) # sqrt(f) amplitude spectrum
X = np.fft.irfft(fourier_amplitudes, n=nsamples, norm='ortho')
X /= np.std(X)

fig = plt.figure(figsize=(520 / 90.0, 340 / 90.0), dpi=72)
plt.plot(t, X)
plt.grid(True)
plt.xlim(t[0], t[-1])
plt.ylim(-3.1, 3.1)
plt.xlabel('t')
plt.ylabel('X')
plt.tight_layout()
plt.savefig('Blue-noise-trace.svg')

Licensing edit

I, the copyright holder of this work, hereby publish it under the following license:
w:en:Creative Commons
attribution share alike
This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International license.
You are free:
  • to share – to copy, distribute and transmit the work
  • to remix – to adapt the work
Under the following conditions:
  • attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
  • share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current23:58, 5 December 2022Thumbnail for version as of 23:58, 5 December 2022520 × 340 (27 KB)Geek3 (talk | contribs)Uploaded own work with UploadWizard

There are no pages that use this file.

Metadata