Borrar filtros
Borrar filtros

Reconstruct a sequence from its DTFT

1 visualización (últimos 30 días)
Jetty Rakesh Aditya
Jetty Rakesh Aditya el 1 de Nov. de 2020
Respondida: Shubham Khatri el 10 de Nov. de 2020
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 comentario
Matt J
Matt J el 1 de Nov. de 2020
Wy not just use the known formula for the IDTFT?

Iniciar sesión para comentar.

Respuestas (1)

Shubham Khatri
Shubham Khatri el 10 de Nov. de 2020
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)
end
Xs(i1) = s
end
% 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);
end
xsr(i1) = s/2/pi/Fs; % divide by Fs to replciate infintesimaly small dt
end

Categorías

Más información sobre Time Series en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by