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 个评论

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().
for loop.
randn() * sqrt(0.49) for the noise
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
i forgut t mention that the value of s(-1)=0and s(-2)=0, and i should use randn
thanks alot. but what about the whole difference equatin. i am new in matlab
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?
Yes it is ..and also mini project ..thanks a lot dear ..hope contact you again soon😁
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
syms n
for n=0:10000
v=randn()*sqrt(0.49);
s(-1) = 0;
s(-2) = 0;
s(n) = s(n-1) - 0.6 * s(n-2) + v(n);
end
can not generate it,look like something wrong
It is never possible to use a symbolic variable as a subscript.
It is never possible to use a negative number as a subscript.
Would you please fix it to me .because I spend time without any results. Thanks
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 个)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by