Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

compute samples of DTFT finite length signal

Status
Not open for further replies.

scdoro

Member level 5
Joined
Jan 12, 2005
Messages
87
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,040
The following MATLAB function can be used to compute samples of the DTFT of a
finite length signal.

Qn1) Can someone explain how this function works line by line?

**********************************************
Function [H,W] = dtft(x, n)
% Calculates DTFT of x at n equally spaced frequencies
% Usage:
% x: finite-length input vector (of length L)
% n: number of frequencies for evaluation over
% [-pi,pi]. n>=L.
% H: DTFT values
% W: vector of frequencies where DTFT is computed.
n=fix(n);
L=length(x); h=h:))
if (n < L)
error(‘DTFT: #data samples cannot exceed # freq samples.’)
end
W = (2*pi/n) * [0:(n-1)]’;
mid = ceil(n/2) + 1;
W(mid:n) = W(mid:n) – 2*pi;
W = fftshift(W);
H = fftshift( fft(h,n) );

**********************************************************

Qn2) plot the magnitude and phase responses of the signal xn, given by

a = 0.88 * exp( j*2*pi/5 );
nn = 0:40;
xn = a.^nn;
for n = 128.


Qn3) Where is the peak of the frequency response.and why are there “jumps” in the phase response plot?
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top