10.3 Fourier Series of Discrete-Time Periodic Signals 607
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Example 10.16---Filtering of a periodic signal
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
N = 500;n = 0: N - 1; x = cos(0.2∗pi∗n); x = sign(x); % pulse signal
X = fft(x)/50; X = X(1:250); % approximate DTFT of signal using fft
L = 500; w1 = 0:2∗pi/L:pi - 2∗pi/L;w1 = w1/pi; % range of frequencies
h1 = fir1(30,0.1); % low-pass filter
h2 = fir1(30,0.6,‘high’); % high-pass filter
h3 = fir1(30,[0.1 0.6]); % band-pass filter
y1 = filter(h1,1,x); y2 = filter(h2,1,x); y3 = filter(h3,1,x);
y = y1 + y2 + y3; % outputs of filters
[H1,w] = freqz(h1,1); [H2,w] = freqz(h2,1); [H3,w] = freqz(h3,1);
H = H1 + H2 + H3; % frequency responses n
10.3.5 Circular Shifting and Periodic Convolution
Circular Shifting
When a periodic signalx[n] of periodNis shifted byMsamples the signal is still periodic. The
circular representation provides the appropriate visualization of this shift, as it concentrates on the
period displayed by the representation. Values are rotated circularly.
The Fourier series of the shifted signalx 1 [n]=x[n−M] is obtained from the Fourier series ofx[n] by
replacingnbyn−Mto get
x 1 [n]=x[n−M]=
∑
k
X[k]ej^2 π(n−M)k/N
=
∑
k
(
X[k]e−j^2 πMk/N
)
ej^2 πnk/N
so that the shifted signal and its Fourier series coefficients are related as
x[n−M]⇔X[k]e−j^2 πMk/N (10.34)
It is important to consider what happens for different values ofM. This shift can be represented as
M=mN+r, m=0,±1,±2,..., 0≤r≤N− 1
and as such
e−j^2 πMk/N=e−j^2 π(mN+r)k/N=e−j^2 πrk/N (10.35)
for any value ofM, so that shifting by more than a period is equivalent to shifting by the residuerof
dividing the shiftMbyN.