I want results plot of PSD in (m/s2)2/Hz
2 views (last 30 days)
Show older comments
% 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:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/156759/image.jpeg)
% 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:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/156761/image.jpeg)
% I want this Y-Axis in (m/s2)2/Hz
could you please help me what to do next??
0 Comments
Answers (0)
See Also
Categories
Find more on Sources in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!