how to creat sinusoidal single bump for disturbance
6 ビュー (過去 30 日間)
古いコメントを表示
Hi I need a sinusoidal single bump for road disturbance at certain frequency like this picture. but I don't know how to create it.
Thank you.
0 件のコメント
採用された回答
Star Strider
2014 年 5 月 16 日
This is how I would do it:
% L = Length, A = Amplitude,
sinbump = @(L,A) A*(0.5+0.5*(sin(linspace(-pi/2,pi*3/2,25*L))));
B1 = sinbump(1, 1);
B2 = sinbump(5, 0.5);
figure(1)
subplot(2,1,1)
plot(B1)
grid
title('Amplitude = 1. Length = 25')
axis([0 150 0 1.5])
subplot(2,1,2)
plot(B2)
grid
title('Amplitude = 0.5. Length = 125')
axis([0 150 0 1.5])
I used L (relative ‘wavelength’) here. You will have to convert it to frequency, because while I understand about spatial frequency, I don’t know how you intend to define it. Adapt to do what you want.
The only part you need to keep constant is the definition of the function on the interval (-0.5*pi, 1.5*pi). Otherwise it won’t have the shape you want. Varying L simply changes the number of samples linspace generates, so lower frequencies = longer wavelengths = longer lengths of the vectors sinbump returns. You will have to account for this in zero-padding it so vectors with different bump frequencies will all be the same lengths, if that is important. Zero-padding it will also put it in the position you want on your simulated roadway. I chose 25 samples arbitrarily. Change that as you wish.
The plots simply demonstrate what various options of A and L do.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Line Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!