Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

can someone show me how todo this. I\'m using Matlab 39. The following MATLAB co

ID: 2081700 • Letter: C

Question

can someone show me how todo this. I'm using Matlab


39. The following MATLAB commands create a sine-shaped signal y() that signal contains random noise: t o: 05:10 i y sin (t) 0 1+0.2*rand (1, length (t)) Write a MATLAB program that uses these commands to create a noisy sine-shaped signal. Then the program smooths the signal by using the three- points moving-average method. In this method the value of every point i, except the first and last, is replaced by the average of the value of three adja cent points (i-1, i, and it 1). Make a plot that display the noisy and smoothed signals

Explanation / Answer

clc;
close all;
clear all;

t = 0:0.05:10;
y = sin(t) -0.1 + 0.2*rand(1,length(t));

%CODE to generate smoothened signal
smooth_y(1) = y(1);
smooth_y(length(t)) = y(length(t));

for i = 2:1:length(t)-1;
    smooth_y(i) = (y(i-1) + y(i) + y(i+1))/3;
end

figure
subplot(2,1,1);
stem(t,y);

subplot(2,1,2);
stem(t,smooth_y);

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote