1 view (last 30 days)
anteneh tadesse on 29 Dec 2018
Commented: 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)
·Create a smoothing kernel h of [1, 1, 1, 1, 1]
Filter f with h and plot smoothed function g

Image Analyst on 29 Dec 2018
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 CommentsShow 1 older commentHide 1 older comment
Image Analyst on 29 Dec 2018
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.
anteneh tadesse on 29 Dec 2018
am really thankfull. thank you