👨🎓个人主页:研学社的博客
💥💥💞💞欢迎来到本博客❤️❤️💥💥
🏆博主优势:🌞🌞🌞博客内容尽量做到思维缜密,逻辑清晰,为了方便读者。
⛳️座右铭:行百里者,半于九十。
📋📋📋本文目录如下:🎁🎁🎁
目录
💥1 概述
文献来源:
摘要:本文研究了具有任意谱斜率的幂律彩色数字噪声信号(序列)的生成。首先,简要介绍了一些噪声特征的背景信息。在此基础上,提出了一种基于白噪声信号的产生、频域变换、频谱处理和逆变换回时域的方法。进行了计算机模拟以确认算法的一致性,包括功率谱密度的估计和自相关性,以及与相应的内置Matlab®函数相比其优异性能的示例。
关键词:彩色噪声,粉色噪声,红色噪声,蓝色噪声,紫色噪声,生成
原文摘要:
Abstract: - The present paper addresses the generation of power-law, colored digital noise signals (sequences) with arbitrary spectral slope. In the beginning, brief background information is given about some noise features. Further, a newly proposed method is described, based on generation of a white noise signal, its transformation into the frequency domain, spectral processing and inverse transform back into the time domain. Computer simulations are performed to confirm the consistency of the algorithm, including estimation of the power spectral density and the autocorrelation, along with example of its outperformance in comparison with the corresponding in-built Matlab® function.
Keywords: - colored noise, pink noise, red noise, blue noise, violet noise, generation
本代码是一个 Matlab 函数,可提供具有任意功率谱密度 (PSD) 斜率 f^a 的噪声信号生成。例如:
1)白噪声:a = 0;
2)粉红噪声:a = −1;
3)红噪声:a = −2;
4)蓝噪声:a = +1;
5)紫罗兰噪声:a = +2。
为了阐明函数的用法,给出了两个示例。为方便起见,输入和输出参数在函数的开头给出。产生的噪声信号具有单位标准差和零平均值。
📚2 运行结果
部分代码:
% function: x = arbssnoise(N, alpha)
%
% Input:
% N - number of samples to be returned in the noise column vector
% alpha - PSD spectral slope
%
% Output:
% x - column vector of noise samples with unity
% standard deviation and zero mean value
%
% For instance:
% black noise -> alpha < -2, PSD slope < -20 dB/dec;
% red noise -> alpha = -2, PSD slope = -20 dB/dec;
% pink noise -> alpha = -1, PSD slope = -10 dB/dec;
% white noise -> alpha = 0, PSD slope = 0 dB/dec;
% blue noise -> alpha = +1, PSD slope = 10 dB/dec;
% violet noise -> alpha = +2, PSD slope = 20 dB/dec;
function x = arbssnoise(N, alpha)
% input validation
validateattributes(N, {'double'}, ...
{'scalar', 'integer', 'nonnan', 'finite'}, ...
'', 'N', 1)
validateattributes(alpha, {'double'}, ...
{'scalar', 'real', 'nonnan', 'finite'}, ...
'', 'alpha', 2)
% convert from PSD (power specral density) slope
% to ASD (amplitude spectral density) slope
alpha = alpha/2;
% generate AWGN signal
x = randn(1, N);
% calculate the number of unique fft points
NumUniquePts = ceil((N+1)/2);
% take fft of x
X = fft(x);
% fft is symmetric, throw away the second half
X = X(1:NumUniquePts);
% prepare a vector with frequency indexes
n = 1:NumUniquePts;
% manipulate the left half of the spectrum so the spectral
% amplitudes are proportional to the frequency by factor f^alpha
X = X.*(n.^alpha);
% perform ifft
if rem(N, 2) % odd N excludes Nyquist point
% reconstruct the whole spectrum
X = [X conj(X(end:-1:2))];
% take ifft of X
x = real(ifft(X));
else % even N includes Nyquist point
% reconstruct the whole spectrum
X = [X conj(X(end-1:-1:2))];
% take ifft of X
x = real(ifft(X));
🎉3 参考文献
部分理论来源于网络,如有侵权请联系删除。
[1] H. Zhivomirov. A Method for Colored Noise Generation. Romanian Journal of Acoustics and Vibration, ISSN: 1584-7284, Vol. XV, No. 1, pp. 14-19, 2018.