I want results plot of PSD in (m/s2)2/Hz

2 Ansichten (letzte 30 Tage)
Ajay Kumar
Ajay Kumar am 30 Sep. 2016
% code
% Firstly, I generated a random road profile in Matlab using this code.
t=0:0.0121:10;
x=zeros(size(t));
z=zeros(2500,length(t));
freq=linspace(0.02*pi,6*pi,2500);
b0=7.8*10^(-8)*((freq).^(-2.1));
a0=sqrt(b0);
p=2*pi*rand(1,2500);
for n=1:2500
x=a0(n).*sin((n*0.628*t)-p(n));
z(n,:)=x;
end
tt=zeros(length(t),2);
tt(:,2)=sum(z);
tt(:,1)=t;
o1=0.1:0.01:3;
p1=4.5e-6*(o1.^(-2.1));
[pp ww]=pwelch(tt(:,2),45,43,[],(1/0.0121));
loglog((ww/(12.5)),(pp*(12.5)),'r',o1,p1,'g')
end
% secondly, I got this plot:
% Next, I run my vehicle model in Simulink and I got graph in scope which is given "to workspace" block.
% Finally, I run Pwelch command in which i gave this scope result as input signal, I got this graph of PSD:
% I want this Y-Axis in (m/s2)2/Hz
could you please help me what to do next??

Antworten (0)

Kategorien

Mehr zu General Applications finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by