How would you create a Finite Impulse Reponse of the followi

How would you create a Finite Impulse Reponse of the following equation in MATLAB?

You must use the conv() function.

e.g.

n = 0:999; %Discrete time indices
x = cos(0.25*pi*n); % Input sequence
h = [1/5 1/5 1/5]; % Filter coefficients
y2 = conv(h,x);

Solution

function de=de(n)
if n==0
    de=1;
else de=0;
end
end

h=zeros(1,17641);
for n=0:17640
    h(n+1)=de(n)+0.4.*de(n-6615)+0.1.*de(n-17640);
end
h

result

<at n=0, h = 1>

<at n=6615, h=0.4>

<at n=17640, h=0.1>

else h=0

How would you create a Finite Impulse Reponse of the following equation in MATLAB? You must use the conv() function. e.g. n = 0:999; %Discrete time indices x =

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site