MATLAB Answers

0

please help me with this question i couldn't understand it at all

Asked by anteneh tadesse on 29 Dec 2018
Latest activity Commented on by anteneh tadesse on 29 Dec 2018
·Create Step function f with a size of 2000 (1000 samples of zeros and 1000 samples of ones).
Hint: (use zeros and ones functions in matlab)
·Add a noise using randn
·Create a smoothing kernel h of [1, 1, 1, 1, 1]
Filter f with h and plot smoothed function g

  0 Comments

Sign in to comment.

1 Answer

Answer by Image Analyst
on 29 Dec 2018
 Accepted Answer

By size I think it means amplitude. So it would be something like
f = [zeros(............ , 200 * ones(.........
f = f + randn(.....................)
h = ......
g = conv(.......)
plot(g, 'b-', 'LineWidth', 2)
grid on;
Since this is your homework, finish it yourself. It's really trivial.
If you still need help, see this link

  3 Comments

thanks but i couldn't understand it at all, maybe you can teach me how i can solve it. please
I'll do a little more but you really need to make an effort. I mean they literally tell you what h is in the question itself. Did you even look at the help for randn() and conv() or not?
f = [zeros(1, 1000), 200 * ones(...., .....)];
f = f + amplitude * randn(1, length(f));
h = [1, 1, 1, 1, 1];
g = conv(f, h, '....')
plot(g, 'b-', 'LineWidth', 2)
grid on;
amplitude is basically how much noise you want to add to f. Try different numbers from 1 to 100 or so.
There are literally only 9 characters left for you to type in, plus one line of code to assign amplitude. I've done the bulk of it for you (against forum guidelines).
If I do the last few characters, then you would be turning in my homework as your own and that would likely get you into ethical problems with your university. What I've done so far might even be too much. Be very wary of asking for homework solutions and turning them in since I've heard some professors use plagiarism detection software.

Sign in to comment.