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

Hint: To compute the impulse response, make an input vector for filterí ) consis

ID: 2249146 • Letter: H

Question

Hint: To compute the impulse response, make an input vector for filterí ) consisting of one unil sample followed by 50 zero samples 2. [4 Points] MATLAB Exercise: In lecture 9, we have shown that the inverse DTFT of is given by In this exercise, we would like to reconstruct X (eng from x[n], using the DTFT formula: By the DTIT definition, we have N 00, However, this is nol practical. You are asked lo plol the reconstructed DTFT signal X, (ej") for different values of N = { 1,3,7, 15,50,70) using equation (3), and compare 11 against Lhe original signal X(ej") You may assume .-. For every value of N, plol x,(eM) in (3) overlapped with X(eju) in (1). The output comparison figure at N=1 may look like the figure belovw Hint: You may look for "Gibbs Phenomenon" to understand more the impact of finite summation

Explanation / Answer

The simplest FIR design technique is the ImpulseResponseTruncation , where an ideal impulse response of infinite duration is truncated to finite length and the samples are delayed to make it causal. This method comes with an undesirable effect due to Gibbs Phenomenon .

%%% Gibb's phenomenon..
t=linspace(-2,2,3000);
u=linspace(-2,2,3000);
sq=[zeros(1,500),2*ones(1,1000),zeros(1,500)];
k=2;
N=[1,3,7,19,49,70];
for n=1:6;
an=[];
for m=1:N(n)
    an=[an,2*k*sin(m*pi/2)/(m*pi)];
end;
fN=k/2;
for m=1:N(n)
    fN=fN+an(m)*cos(m*pi*t/2);
end;
nq=int2str(N(n));
subplot(3,2,n),plot(u,sq,'r','LineWidth',2);hold on;
plot(t,fN,'LineWidth',2); hold off; axis([-2 2 -0.5 2.5]);grid;
xlabel('Time'), ylabel('y_N(t)');title(['N= ',nq]);
end;
%%% End of gibb.m

clc
clear

N=20;
k=-N:N;
interval=-6:0.0001:6;

index=1;
for t=interval
    ck=0.5*sin(k*pi/2)./(k*pi/2);
    ck(isnan(ck))=0.5;
    value(index)=sum(ck.*exp(i*k*pi*t/2));
   
    if t<-5
        ideal(index)=0;
    elseif -5<=t && t<=-3
        ideal(index)=1;
    elseif -3<=t && t<=-1
        ideal(index)=0;     
    elseif -1<=t && t<=1
        ideal(index)=1;
    elseif 1<=t && t<=3
        ideal(index)=0;
    elseif 3<=t && t<=5
        ideal(index)=1;
    else
        ideal(index)=0;
    end
    index=index+1;
end

plot(interval,ideal,'Color',[1 0 1],'linewidth',2)
hold on
plot(interval,value,'w','linewidth',1.5)
xlabel('Time');
set(gca,'Color','k')
ylim([-1 2])
% xlim([-1.1 -0.9])

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