The_Colors_of_Noise.svg


Summary

Description
English: The colors noise as generated by the colorednoise Python package. The figure shows the color coded relative power spectral density (PSD) for Brown, pink, white, blue, and violet noise normalized at 1kHz. Note the slopes of the PSD are -20, -10, 0, 10, 20 (dB/dec) for each noise spectum respectively.
Date
Source Own work
Author AkanoToE
Other versions

Own work based on: The Colors of Noise.png

Source Code

import colorednoise as cn
import matplotlib.pyplot as plt
from matplotlib import mlab

betas = [-2, -1, 0, 1, 2]
colors = ['violet', 'blue', 'gray', 'pink', 'darkred']
samples = 100*44100

plt.style.use('default')
plt.rc('font', family='serif', size=14)
plt.rc('text', usetex=True)

fig = plt.figure(dpi=300)
plt.annotate(r'\textit{The Colors of Noise}', (1300, 42), fontsize=16)
nfft=2**21

for beta, color in zip(betas, colors):
    y = cn.powerlaw_psd_gaussian(beta, samples)
    s, f = mlab.psd(y, NFFT=nfft)
    plt.semilogx(2e5*f, 4 + 10*np.log10(s/s[4100:4200].mean())
        , color=color, lw=0.5)
    plt.xlabel('Frequency (Hz)')
    plt.ylabel('Power Spectral Density (dB)')
    plt.xlim([1e3, 2e5])
    plt.ylim([-70, 56])
plt.tight_layout()

if fig.dpi >= 300:
    plt.savefig('../fig/The_Colors_of_Noise.svg')

Licensing

I, the copyright holder of this work, hereby publish it under the following license:
w:en:Creative Commons
attribution share alike
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.

Captions

Power Spectral Density plot for different colors of noises

Items portrayed in this file

depicts

26 July 2022