In this exercise we will determine the output of the ideal lowpass filter with b
ID: 2080610 • Letter: I
Question
In this exercise we will determine the output of the ideal lowpass filter with bandwidth B and delay t_0 = 0, assuming that its input x(t) is a rectangular pulse of unit amplitude and duration T. The frequency response of the filter is shown in the next figure. We recall that the impulse response of an ideal lowpass filter with bandwidth B is h(t) = 2 B sinc(2Bt). Create an M-file that: plots the input to the filter. c(t), where t ranges from -4 to 4 using 0.01 increments. Assume that T = 2; plots the impulse response h(t), where t ranges from -4 to 1 using 0.01 increments. Assume that B = 2; plots the output of the filter. y(t). Assume that T = 2 and B = 2; repeats (b), (c) for T = 2 and B = 4 and 1. Comment on the oscillatory behavior around the discontinuities of the output pulse? Can you describe the phenomenon? plots the amplitude spectra of the input to the filter x(t), the filter itself h(t) and the filter output y(t) for T = 2, B = 4 and B = 1. In your plots show all spectra for frequencies between -20 to 20 (you can select this frequency range in you program or manually on the MATLAB plots). For different values of B. the amplitude spectra of h(t) and y(f) should be drawn in the same figure in a way that they are distinguishable (e.g., different type of lines).Explanation / Answer
Part (a)
Code to plot input x(t)
T=2; %width of the rectangule pulse
t=-4:0.01:4; %time span
x=rectpuls(t,T); %function for rectangular pulse
plot(t,x,'k');
title(['Rectangular Pulse width=', num2str(T),'s']); %title of the plot
xlabel('Time(s)');
ylabel('Amplitude');
Part (b)
impulse response of filter is given as h(t)= 2Bsinc(2Bt)
Code
B=2; %Bandwidth of the filter
t=-4:0.01:4; % time span
h = 2*B*sinc(2*B*t); %impulse response
plot(t,h);
Part (c)
output of the filter will be the convolution of x(t) and h(t) in time domain
Code
T=2;
B=2; %Bandwidth of the filter
t=-4:0.01:4; % time span
x=rectpuls(t,T); %function for rectangular pulse
h = 2*B*sinc(2*B*t); %impulse response
y=conv(x,h);
plot(t,y);
Part (d)
For B=4
impulse response of filter is given as h(t)= 2Bsinc(2Bt)
Code
B=4; %Bandwidth of the filter
t=-4:0.01:4; % time span
h = 2*B*sinc(2*B*t); %impulse response
plot(t,h);
output of the filter will be the convolution of x(t) and h(t) in time domain
Code
T=2;
B=4; %Bandwidth of the filter
t=-4:0.01:4; % time span
x=rectpuls(t,T); %function for rectangular pulse
h = 2*B*sinc(2*B*t); %impulse response
y=conv(x,h);
plot(t,y);
For B=1
impulse response of filter is given as h(t)= 2Bsinc(2Bt)
Code
B=1; %Bandwidth of the filter
t=-4:0.01:4; % time span
h = 2*B*sinc(2*B*t); %impulse response
plot(t,h);
output of the filter will be the convolution of x(t) and h(t) in time domain
Code
T=2;
B=1; %Bandwidth of the filter
t=-4:0.01:4; % time span
x=rectpuls(t,T); %function for rectangular pulse
h = 2*B*sinc(2*B*t); %impulse response
y=conv(x,h);
plot(t,y);
Part (e)
For Amplitude spectra of x(t)
T=2; %width of the rectangule pulse
t=-4:0.01:4; %time span
x=rectpuls(t,T); %function for rectangular pulse
Ax=fftshift(fft(fftshift(x))); %built in function to calculate fourier transform
FH=(1/((length(x)-1)*0.01));
fx=(-0.2/0.01):FH:(0.2/0.01);
plot(fx,abs(Ax));
For Amplitude spectra of h(t)
For B=4
B=4; %Bandwidth of the filter
T=2;
t=-4:0.01:4; % time span
h = 2*B*sinc(2*B*t); %impulse response
Ah=fftshift(fft(fftshift(h))); %built in function to calculate fourier transform
FH=(1/((length(h)-1)*0.01));
fh=(-0.2/0.01):FL:(0.2/0.01);
plot(fh,abs(Ah));
For B=1
B=1; %Bandwidth of the filter
T=2;
t=-4:0.01:4; % time span
h = 2*B*sinc(2*B*t); %impulse response
Ah=fftshift(fft(fftshift(h))); %built in function to calculate fourier transform
FH=(1/((length(h)-1)*0.01));
fh=(-0.2/0.01):FL:(0.2/0.01);
plot(fh,abs(Ah));
For Amplitude spectra of y(t)
For B=4
T=2;
B=4; %Bandwidth of the filter
t=-4:0.01:4; % time span
x=rectpuls(t,T); %function for rectangular pulse
h = 2*B*sinc(2*B*t); %impulse response
y=conv(x,h);
Ay=fftshift(fft(fftshift(y))); %built in function to calculate fourier transform
FY=(1/((length(y)-1)*0.01));
fy=(-0.2/0.01):FL:(0.2/0.01);
plot(fy,abs(Ay));
For B=1
T=2;
B=1; %Bandwidth of the filter
t=-4:0.01:4; % time span
x=rectpuls(t,T); %function for rectangular pulse
h = 2*B*sinc(2*B*t); %impulse response
y=conv(x,h);
Ay=fftshift(fft(fftshift(y))); %built in function to calculate fourier transform
FY=(1/((length(y)-1)*0.01));
fy=(-0.2/0.01):FL:(0.2/0.01);
plot(fy,abs(Ay));
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.