How to plot this signal?
信息
此问题已关闭。 请重新打开它进行编辑或回答。
显示 更早的评论
Hi there,
For this problem, I need to plot the function below. Its main idea to generate a random road profile by adding together sine waves of different frequencies and amplitudes in a chosen frequency range.
What I'm facing trouble with is the following:
1- How to express the sum of series in this equation
2- How to randomly generate the phase angle and how to implement it in the equation
3- What does "(K) the number of time samples" means and how to use it in substituting (tk) in the sin function.
Excuse me, I'm still a beginner in MATLAB so, I would be grateful for any help. Thanks in advance.
:
The reference:
Chapter 3
:

3 个评论
KSSV
2017-7-26
What you have attempted?
Ennio Condoleo
2017-7-27
I am supposing this is a homework, so I would not like to provide you the answer directly. Here you have only some hints: - define t as a vector by using "linspace" function (help linspace) - assign the constants as : "X = value"; - use "randn" or "rand" to generate a random number see the help)
I want to propose an example, if it is useful:
df = 0.5; & step freq Hz
fmin = 0.5; % min freq Hz
fmax = 10; % max freq HZ
f = fmin:df:fmax; % freq vect
ph = rand(length(f),1);
B = ...
U = ...
n1 = ...
c = 2*B*U^(n1-1);
% define all the variables required
Y = @(t,fj,pj) sqrt(c*df/fj^n1).*sin(2*pi*fj.*t+pj);
t = linspace(0,6,3042);
Yvalue = 0;
for j = 1:length(f)
Yvalue = Yvalue + Y(t,f(j),ph(j));
end
Try the code and edit it. I have written fastly!!!
mahmoud
2017-7-28
回答(0 个)
此问题已关闭。
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!