advanced digital signal processing
이전 댓글 표시
i have been asked to generate a random process s(n)=s(n-1)-0.6s(n-2)+v(n)
where v(n) is a white noise with zero mean and varience a^2= 0.49
and for n=0:10000
i need a matlab code for that
댓글 수: 12
Image Analyst
2020년 11월 29일
Who asked you to do that? A professor?
What is the value of the first s? s(1)?
The noise is white with respect to n, but is it uniform distributed, or normally distributed? That tells you whether to use rand() or randn().
Walter Roberson
2020년 11월 29일
for loop.
randn() * sqrt(0.49) for the noise
Image Analyst
2020년 11월 29일
r = rand(1, 10000000) * 0.49 / 0.2887; % Uniform distribution
sUniform = std(r) % Will be 0.49
r = randn(1, 10000000) * 0.49; % Normal distribution
sNormal = std(r) % Will also be 0.49
Snds Audah
2020년 11월 29일
Snds Audah
2020년 11월 29일
Image Analyst
2020년 11월 29일
Have you completed the 2 hour training yet? After that you should know how to do a simple for loop.
v = ran................
s(1) = 0;
s(2) = 0;
for n = 3 : 1000
s(n) = s(n-1) - 0.6 * s(n-2) + v(n) % Your existing formula
end
Is this homework?
Snds Audah
2020년 11월 29일
Walter Roberson
2020년 11월 29일
r = randn(1, 10000000) * 0.49; % Normal distribution
The question asks for a specific variance, and variance is the square of the standard deviation, so you need to take the square root of the variance to get the standard deviation.
r = randn(1, 10000000) * sqrt(0.49); % Normal distribution
The question asks for a specific variance, and variance is the square of the s
Snds Audah
2020년 11월 30일
Walter Roberson
2020년 11월 30일
It is never possible to use a symbolic variable as a subscript.
It is never possible to use a negative number as a subscript.
Image Analyst already posted code for you, https://www.mathworks.com/matlabcentral/answers/668088-advanced-digital-signal-processing#comment_1169663
Snds Audah
2020년 12월 2일
Walter Roberson
2020년 12월 2일
The code is 6 lines. Image Analyst posted 5 of the 6 lines and I posted the exact form of the sixth https://www.mathworks.com/matlabcentral/answers/668088-advanced-digital-signal-processing#comment_1169918 except I used variable name r
You have been given all of the parts needed for the assignment, with only at most 5 characters to change.
If we were to post the complete code then you would have to ask your professor to assign you 0 for the assignment as otherwise you would be in danger of it being claimed that you might have committed academic misconduct.
Re-read what Image Analyst posted.
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Univariate Discrete Distributions에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!