advanced digital signal processing
Show older comments
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 Comments
Image Analyst
on 29 Nov 2020
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
on 29 Nov 2020
for loop.
randn() * sqrt(0.49) for the noise
Image Analyst
on 29 Nov 2020
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
on 29 Nov 2020
Snds Audah
on 29 Nov 2020
Image Analyst
on 29 Nov 2020
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
on 29 Nov 2020
Walter Roberson
on 29 Nov 2020
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
on 30 Nov 2020
Walter Roberson
on 30 Nov 2020
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
on 2 Dec 2020
Walter Roberson
on 2 Dec 2020
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.
Answers (0)
Categories
Find more on Univariate Discrete Distributions in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!