In: Electrical Engineering
question 4. For each of the f0 frequencies in Problem 3(c), construct a sinusoidal signal that is turned on at t = 0 and sampled at 100,000/ 2? Hz over the interval ?0.5 ? t ? 0.5 . Again, using Matlab’s convolution command, determine the amplitude and phase (relative to the input) of the response of the filter. Ignoring edges of output that are subject to numerical artifacts. Compare and contrast your answers to those obtained in Problem 3(c).
previous question #3
3. Suppose the transfer function of a low-pass filter with frequency specified in cyclic frequency f is given by H ( f ) = 100/ (100 +i2? f ):
a. Manually find and sketch the amplitude and phase spectra (on regular, non-log scale) of the transfer function.
b. If the input to the filter is x(t) = Acos (2? f0t), derive the general expression of the output. (Hint: use Fourier convolution theorem.)
c. Find the specific expressions for the outputs for f0 = 10/ 2? , 100/ 2? , 1,000/ 2? , and 10,000/ 2? Hz. (You may use a calculator or Matlab for the computation.)
matlab code:
clc;
close all;
clear all;
fs=(2*100000)/(2*pi);
Ts=1/fs;
t=Ts:Ts:0.5;
A=1;
h=100*exp(-100*t);
%f0=10/(2*pi)
x1=A*cos(10*t);
y1=conv(x1,h);
y1f=fft(y1);
y1mag=abs(y1f);
y1phase=angle(y1f);
figure;
plot(y1mag);
title('problem 3 magnitude response for f0=10');
ylabel('amplitude')
xlabel('frequency');
figure;
title('problem 3 magnitude response for f0=10');
plot(y1phase);
ylabel('phase')
xlabel('frequency');
%f0=100/(2*pi)
x2=A*cos(100*t);
y2=conv(x2,h);
y2f=fft(y2);
y2mag=abs(y2f);
y2phase=angle(y2f);
figure;
plot(y2mag);
title('problem 3 magnitude response for f0=100');
ylabel('amplitude')
xlabel('frequency');
figure;
plot(y2phase);
title('problem 3 phase response for f0=100');
ylabel('phase')
xlabel('frequency');
%f0=1000/(2*pi)
x3=A*cos(1000*t);
y3=conv(x3,h);
y3f=fft(y3);
y3mag=abs(y3f);
y3phase=angle(y3f);
figure;
plot(y3mag);
title('problem 3 magnitude response for f0=1000');
ylabel('amplitude')
xlabel('frequency');
figure;
plot(y3phase);
title('problem 3 phase response for f0=1000');
ylabel('phase')
xlabel('frequency');
%f0=10000/(2*pi)
x4=A*cos(10000*t);
y4=conv(x1,h);
y4f=fft(y4);
y4mag=abs(y4f);
y4phase=angle(y4f);
figure;
plot(y4mag);
title('problem 3 magnitude response for f0=10000');
ylabel('amplitude')
xlabel('frequency');
figure;
plot(y4phase);
title('problem 3 phase response for f0=10000');
ylabel('phase')
xlabel('frequency');
%problem 4
%f0=100000/(2*pi)
x5=A*cos(100000*t);
y5=conv(x5,h);
y5f=fft(y5);
y5mag=abs(y5f);
y5phase=angle(y5f);
figure;
plot(y5mag);
title('problem 4 magnitude response')
ylabel('amplitude')
xlabel('frequency');
figure;
plot(y5phase);
title('problem 4 phase response')
ylabel('phase')
xlabel('frequency');
results;