A signal is described by

Graph the magnitude and phase of its DTFT over the range ?? ? ? < ? .


This can only be done numerically using the DFT to approximate the DTFT. The approximation is







n0 = -9 ;

n1 = 9 ;

n = [n0:n1]' ; % Vector of discrete-time indices for x[n]

N = length(n) ; % Number of points used to represent x[n]

% Compute x[n]

x = [-log(-n(1:9)+1);log(n(10:end)+1)] ;

% Zero-pad the time domain function to increase frequency domain resolution

padFac = 32 ;

Npad = N*padFac ;

nextra = [n1+1:n1+(Npad-N)]' ;

npad = [n;nextra] ;

xpad = [x;zeros(Npad-N,1)] ;

Npad = length(npad) ; % Number of values used to represent x[n]

Xpad = fft(xpad) ; % DFT of x is the approximation to DTFT of x

kpad = [0:Npad-1]' ; % Harmonic numbers in the range 0 through N-1

Xpad = Xpad.*exp(-j*2*pi*kpad*n0/Npad) % Compensate for the fact that x starts at n=-9, not n=0

% Rearrange k and X for a range of frequencies centered at zero

kpad0 = -floor(Npad/2) ;

kpad = kpad0 + [0:Npad-1]' ;

Wpad = 2*pi*kpad/Npad ; % Vector of discrete-time radian frequencies

Xpad = fftshift(Xpad) ; % Rearrange X for frequencies centered at zero

% Graph the results



figure('Position',[20,20,1500,1500],'PaperPosition',[0.5,0.5,10,10]) ;

subplot(3,1,1) ;

ptr = stem(n,x,'k','filled') ;

set(ptr,'LineWidth',2,'MarkerSize',4) ; grid on ;

xlabel('\itn','FontName','Times','FontSize',24) ;

ylabel('x[{\itn}]','FontName','Times','FontSize',24) ;

set(gca,'FontName','Times','FontSize',18) ;

subplot(3,1,2)

ptr = plot(Wpad,abs(Xpad),'k') ;

set(ptr,'LineWidth',2,'MarkerSize',4) ; grid on ;

xlabel('\Omega','FontName','Times','FontSize',24) ;

ylabel('|X({\ite}^{{\itj}\Omega})|','FontName','Times','FontSize',24) ;

set(gca,'FontName','Times','FontSize',18) ;

subplot(3,1,3)

ptr = plot(Wpad,angle(Xpad),'k') ;

set(ptr,'LineWidth',2,'MarkerSize',4) ; grid on ;

xlabel('\Omega','FontName','Times','FontSize',24) ;

ylabel('Phase of X({\ite}^{{\itj}\Omega})','FontName','Times','FontSize',24) ;

set(gca,'FontName','Times','FontSize',18) ;



Trades & Technology

You might also like to view...

Flexible stocking

What will be an ideal response?

Trades & Technology

The MERCOSUR countries provide substantial border protection to their producers

Indicate whether the statement is true or false

Trades & Technology

How does the operation of a “stinger” type dent puller differ from that of a stud gun?

What will be an ideal response?

Trades & Technology

Explain static wheel imbalance, and describe the results of static imbalance.

What will be an ideal response?

Trades & Technology