Is it possible to adjust dsp.ColoredNoise to limit the filter length?
2 次查看(过去 30 天)
显示 更早的评论
I'm trying to simulate a range of approximately pink noise (with variations in the slope of the 1/f power-frequency distribution), but without multiple oscillatory cycles in the signal.
Using dsp.ColoredNoise to create the ~pink noise results in 3+ cycles in the data at a range of frequencies, which I think could be resolved by reducing the filter length that dsp.ColoredNoise uses to the create the noise. However, I can't find a setting to reduce the filter length.
Does anyone know how to reduce the filter length used by dsp.ColoredNoise, or an alternative method to create pink noise that doesn't result in cycles of longer than 1 cycle in the data?
0 个评论
回答(1 个)
Pratyush
2023-8-2
I understand that you want to reduce the filter length used by "dsp.ColoredNoise" generate pink noise without multiple oscillatory cycles in signal. There is no direct way to reduce the filter length used to create the noise. However, you can use the 'pinknoise' function from the Signal Processing Toolbox, which generates pink noise with a 1/f power spectrum. This function allows you to specify the length of the generated noise directly, which can help avoid the issue of longer cycles. Here's an example of how you can use it:
fs = 1000; % Sampling rate
t = 0:1/fs:10; % Time vector
L = length(t); % Length of the signal
noise = pinknoise(L); % Generate pink noise
% Plot the generated noise
plot(t, noise);
xlabel('Time (s)');
ylabel('Amplitude');
title('Pink Noise');
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Digital Filtering 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!