Signals and Systems - Electrical Engineering

(avery) #1

278 C H A P T E R 4: Frequency Analysis: The Fourier Series


Because the magnitude response of the low-pass filter changes very little in the range of frequencies
of the input, the output signal is very much like the input (see Figure 4.15). The following script is
used to find the response.

% low-pass filtering
% FS coefficients of input
X(1) = 0; % mean value
for k = 2:M - 1,
X(k) = sin((k−1)∗pi/2)/((k−1)∗pi/2);
end
% periodic signal
Ts = 0.001; t1 = 0:Ts:1 - Ts;L = length(t1);
x1 = [ones(1, L /4) zeros(1, L /2) ones(1, L /4)]; x1 = x1−0.5; x = [x1 x1];
% output of filter
t = 0:Ts:2−Ts;
y = X(1)∗ones(1, length(t))∗Ha(1);
plot(t, y); axis([0 max(t)−.6 .6])
for k = 2:M - 1,
y = y + X(k)∗Hm(k)∗cos(w0∗(k−1).∗t + Ha(k));
plot(t, y); axis([0 max(t)−.6 .6]); hold on
plot(t, x, ’r’); axis([0 max(t)−0.6 0.6]); grid
ylabel(’x(t), y(t)’); xlabel(’t (sec)’) ; hold off
pause(0.1)
end

(a) (b)

0 20 40 60 80 100

0

0.5

1

|H(


)|

0 20 40 60 80 100
− 1

−0.5

0

<H(


)

Ω (rad/sec)

0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8

−0.5

−0.4

−0.3

−0.2

−0.1

0

0.1

0.2

0.3

0.4

0.5

x(

t),

y(

t)

t(sec)

FIGURE 4.15
(a) Magnitude and phase response of the low-pass RC filterH(s)at harmonic frequencies, and (b) response due
to a train of pulses. n
Free download pdf