📄 noise_gen.m
字号:
function out = noise_gen(u,Ampl,Phases,Fs,N);
% Generates colored noise spectral components (by A. Fornasari, P. Malcovati)
%
% out = noise_gen(u,Ampl,Phases,Fs,N)
%
% u: Frequencies of the spectral component in Hz
% Ampl: Vector containing the powers of the spectral components in V^2
% Phases: Vector containing the initial phases of the spectral components in rad
% Fs: Sampling frequency in Hz
% N: Number of spectral components
%
% out: Spectral components of the colored noise
spectral_component=(sqrt(2*Ampl).*sin(2*pi*[1:N]*Fs/(2*N)*u+Phases(1:N)));
out=sum(spectral_component);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -