0
点赞
收藏
分享

微信扫一扫

爬虫的工作程序

💥1 概述

文献来源:

摘要:本文研究了具有任意谱斜率的幂律彩色数字噪声信号(序列)的生成。首先,简要介绍了一些噪声特征的背景信息。在此基础上,提出了一种基于白噪声信号的产生、频域变换、频谱处理和逆变换回时域的方法。进行了计算机模拟以确认算法的一致性,包括功率谱密度的估计和自相关性,以及与相应的内置Matlab®函数相比其优异性能的示例。

关键词:彩色噪声,粉色噪声,红色噪声,蓝色噪声,紫色噪声,生成

原文摘要:

📚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.

🌈4 Matlab代码及文章讲解

举报

相关推荐

0 条评论