How can I find the Power spectral density of a filtered Noise?
3 views (last 30 days)
Show older comments
I have this following code of generating noise and filtering it.. However I ailrd to plot its PSD of filtered Noise, as mentioned in coments?
N=2^10;
time=1:1:N;
time=time*1e-3;
time=time/N;
size(time)
bandwidth=100e3;
irn=10e-9;
plotting=1;
noisebw=(1/(max(time)/length(time)) )/2;
%%% SENSOR DATA
ws=(noisebw)/bandwidth;
Wn=1/ws;
[b,a] = butter(2,Wn,'low');
VN1=irn*sqrt(bandwidth);
VN2=sqrt(ws);
noise1=VN1*randn(size(time));
noise2=filter(b,a,noise1);
noise3=VN2*noise2; % filtered Noise
if plotting
figure(100);
plot(time,noise1,'-k','Linewidth',2);
hold on;
plot(time,noise2,'-y','Linewidth',2);
plot(time,noise3,'-m','Linewidth',2);
grid on;
legend('noise high bw','filtered','noise low bw');
title('noise source function outputs');
end
0 Comments
Answers (1)
Ameer Hamza
on 6 Jun 2020
Edited: Ameer Hamza
on 6 Jun 2020
This example show how to plot PSD using FFT: https://www.mathworks.com/help/signal/ug/power-spectral-density-estimates-using-fft.html
0 Comments
See Also
Categories
Find more on Parametric Spectral Estimation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!