Nov 12th, 2014 IZMIR UNIVERSITY OF ECONOMICS EEE 301 LABORATORY ASSIGNMENT II In this assignment, you will learn to compute the Discrete-Time Fourier Series (DTFS) analysis and synthesis of discrete-time periodic signals in Matlab. BACKGROUND: For periodic (N) discrete-time signals, the discrete-time Fourier series synthesis and analysis equations are given respectively as: x[n] a e k N ak jk ( 2 / N ) n k 1 x[n]e jk ( 2 / N ) n N n N The discrete-time Fourier series representation is a finite series with N terms since there are only N distinct complex exponentials that are periodic with period N. The spectral coefficients ak repeat periodically with period N. ASSIGNMENT: The following code in Matlab simulates a discrete-time periodic square-wave signal: % Specify x[n] as discrete-time periodic square-wave with N1=2, N=8 N=8; xn=[0 1 1 1 1 1 0 0]; % plot one period k=-3:4; % “stem plot” the original function figure, p = stem(k,xn,'k','filled'); set(p,'LineWidth',2','MarkerSize',4); xlabel('n'),ylabel('x[n]'),title('periodic square wave'); % label the original function axis axis([-4 4 0 2]) 1. Simulate the DTFS analysis equation above to compute and plot the Fourier series coefficients of a given periodic square-wave signal: % DTFS analysis equation: ak = (1/N)*sum_{n=<N>}(x[n]*exp(-jk(2pi/N)n)) % signal period (in samples) N = length(xn); n = [0:(N-1)]'; % allocate space for N DTFS coefficients ak = zeros(N,1); % loop over all coefficients for k=0:(N-1) % DTFS anaysis equation here end 2. Next, simulate the DTFS synthesis equation above to construct the periodic square-wave signal as a weighted (by coefficients ak) sum of N harmonically related complex exponentials: % DTFS synthesis equation: x[n] = sum_{n=<N>}(ak*exp(jk(2pi/N)n)) k = [0:(N-1)]'; % allocate space for synthesized x[n] xns = zeros(N,1); % loop over all signal samples for n=0:(N-1) % DTFS synthesis equation here end 3. Recompute and plot the Fourier series coefficients of a given periodic square-wave signal for the following period values, N=16, 32, 64.