Impact-Site-Verification: dbe48ff9-4514-40fe-8cc0-70131430799e

Search This Blog

Moving Average Filter in MATLAB | DSP

Prerequisite:
Random sequence Generation in MATLAB | Part 1


Code:

clc
clear all
close all
t=0:0.11:20;
x=sin(t);
n=randn(1,length(t));
x=x+n;
a=input('Enter the no.:');
t2=ones(1,a);
num=(1/a)*t2;
den=[1];
y=filter(num,den,x);
plot(x,'b');
hold on;
plot(y,'r','linewidth',2);
legend('Noisy signal','Filtered signal');



No comments

Popular Posts

Followers