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!