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!