MATLAB Answers

Reconstruct a sequence from its DTFT

조회 수: 3(최근 30일)
Jetty Rakesh Aditya
Jetty Rakesh Aditya 2020년 11월 1일
답변: Shubham Khatri 2020년 11월 10일
I have a sequence x and i have found its DTFT. Now i am trying to reconstruct the sequence x from its DTFT. Can someone help me with this? Thanks
  댓글 수: 1
Matt J
Matt J 2020년 11월 1일
Wy not just use the known formula for the IDTFT?

댓글을 달려면 로그인하십시오.


Shubham Khatri
Shubham Khatri 2020년 11월 10일
Hi , please take a look at the following code for calculating the iDTFT. It first calculates the DTFT followed by IDTFT.
W = 2; %angular freq
Fs = 100; % frequency meant to replicate continuous data
t = 0:1/Fs:W-1/Fs; %time
N = length(t);
x = cos(2*pi*t);
% Sampled x
fs = 20; % sampling frequency
Ts = 1/fs;
num = W*fs; % # of (discrete) samples to get
n = 0:num-1;
xn = cos(2*pi*n*Ts);
% Discrete Time Fourier Transform
f2 = -10:1/Fs:10;
Xs = zeros(1,length(f2));
for i1 = 1:length(f2)
s = 0;
for i2 = 1:length(n)
s = s + xn(i2)*exp(-1i*f2(i1)*i2)
Xs(i1) = s
% Inverse Discrete Time Fourier Transform
n2 = 0:length(n)-1;
xsr = zeros(1,length(n2));
range = 0:1/Fs:2*pi-1/Fs;
for i1 = 1:length(n2)
s = 0;
for i2 = (1:length(range))+floor(length(f2)/2)
s = s + Xs(i2)*exp(1i*f2(i2)*i1);
xsr(i1) = s/2/pi/Fs; % divide by Fs to replciate infintesimaly small dt


Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by