![Using the MATLAB M-file dft, compute the 32-point DFT of rn cos(₩), 0 〈 n < 10, x[n] 0 for all other n. COS](http://img.homeworklib.com/questions/4d9c2610-136c-11ec-99b8-377bea784a17.png?x-oss-process=image/resize,w_560)
M-file
dft.m
function Xk = dft(x)
[N,M] = size(x);
if M ~=1, % makes sure that x is a column vector
x = x';
N = M;
end
Xk=zeros(N,1);
n = 0:N-1;
for k=0:N-1
Xk(k+1) = exp(-j*2*pi*k*n/N)*x;
end
function Xk = dft(x,N)
M=length(x);
if M>N
disp('N must be >=M')
end
xnew=[x (zeros(1,N-M))]
for k=0:1:N-1
for n=0:1:N-1
xk(k+1,n+1)=exp(-j*2*pi*k*n/N);
end
end
Xk=xk*xnew'
Program:
N=32
n=0:1:10
xn=cos(10*n*pi/11)
Xk=dft(xn,N)
%__________________________________
%plots
k=0:1:N-1;
subplot(311)
stem(n,xn,'k')
title('Sequence in time domain x(n)')
xlabel('n')
ylabel('x(n)')
subplot(312)
stem(k,abs(Xk),'r')
title('DFT of x(n)-Magnitude response')
xlabel('k')
ylabel('|X(k)|')
subplot(313)
stem(k,angle(Xk),'m')
title('DFT of x(n)-Phase response')
xlabel('k')
ylabel('<X(k)')

M-file dft.m function Xk = dft(x) [N,M] = size(x); if M ~=1, % makes sure that...
Compute the DFT for each of the foregoing signals using the
MATLAB M-file dft
(a) x[0) - 1,x[1] =0, x[2] = 1,x[3] = 0 (b) x[0] = 1, *[1] = 0, x{2) = -1, x[3) = 0 (e) x[0] = 1, x[1] = 1, x[2] = -1, x[3] = -1
1. Let {X[k]}K=o be the N = 8-point DFT of the real-valued sequence x[n] = [1, 2, 3, 4]. (a) Let Y[k] = X[k]ejak + X[<k – 4 >8] be the N = 8-point DFT of a sequence y[n]. Compute y[n]. Note: Do NOT compute X[k]. (b) Let Y[k] = X*[k] be the DFT of the sequence y[n], where * denotes the conjugate. Compute the sequence y[n]. Note: Do NOT compute X[k].
Find N-point DFT of x[n]=
n=0,1,…,N-1
X[n] =
Using the periodicity of the complex exponentials, we can write
x[n] follows:
X[n] =
The DFT coefficients are
9N/2
k=0
X[k]=
N/4
k=2 and k=-2
0
else
Using the 4-point DFT/IFFT in matrix form, determine: (a) The DFT of x[n] = [1, 2, 1, 2]. (b) The IDFT of X[k] = [0, 4, 0, 4];
-Σ rinkin + ml. Sequence c[n] is defined as c[n] x(n] = { 1,-1, 1 } as x[k] and 5-point DFT of c[n] as c[k]. (i) Calculate C[1]? 「[I] = 1-e^(-%72%pi/5)+6 alculate the 4-point DFT of sequence Your last answer was interpreted as follows: I-e + e- Incorrect answer. ii) Calculate i [] is the conjugate operator) -96 Your last answer was interpreted as follows:-i Incorrect answer.
-Σ rinkin + ml. Sequence c[n] is defined as c[n] x(n] = {...
Problem 3 20 points Let f[n]- 1,2,1,0 Use MATLAB to compute the DFT F[k] and turn in the some comments and inclilcle the answer % Compute DFT from FFT x-[1 2 1 0] N-length(x) F-fft(x,N)
Problem 3 20 points Let f[n]- 1,2,1,0 Use MATLAB to compute the DFT F[k] and turn in the some comments and inclilcle the answer % Compute DFT from FFT x-[1 2 1 0] N-length(x) F-fft(x,N)
Consider a finite length DT sequence of length N -16 described below. 1, 0<n< 2 Use MATLAB built-in function dftmtx (N), and compute X[k] command and create stem plots for the following: DFT(X[k]. Use subplot (a) x n] vs n; (b) X[k] vs k; (c) angle (X [k) vs k. Label axes of these plots and include title for each of these plots
Compute the N-point DFT of the following finite-length sequences
considered to be of length N (N is even):
1, n odd 0, n even (a) x[n] = COS Tn
ASSIGNMENT 2 (C4,_CO2, PO1) 1. Calculate DFT of the following discrete-time sequence, x(n) using DFT technique x(n) = {72,-56, 159) (C4, CO2,PO1) 2. Calculate the 8-point DFT of the following discrete-time sequence, x(n) using Decimation In Time Fast Fourier transform (DIT-FFT) algorithm. Show the sketch and label all parameters on a signal flow graph/butterfly diagram structure in your answer. (1-3<ns3 x(n) = 0 elsewhere
DSP
4. (12 points) (a) (4 points) Let x[n] = {1,2, 1, 2} and h[n] = {1,-1,1, -1} be two length-4 sequences defined for 0 <n<3. Determine the circular convolution of length-4 y[n] = x[n] 4 hin). (b) (6 points) Find the 4-point discrete Fourier transform (DFT) X[k], H[k], and Y[k]. (c) (2 points) Find the 4-point inverse DFT (IDFT) of Z[k] = {X[k]H[k].