how i can find the DTFT of sequence without using fft inbuilt function ?

56 vues (au cours des 30 derniers jours)
i am trying this code,
clc; clear; close all;
n = 0:1:100;
x = ((n >= 0) - (n >= 5));
stem(n, x);
len = length(x);
X = zeros(1, len);
for w = 0:2*pi*len
for n = 0:len
X(w+1) = X(w+1) + x(w+1)*exp(-1j*w*n);
end
end

Réponse acceptée

sairaj burewar
sairaj burewar le 1 Mar 2018
w=-pi:0.01:pi;
n=0:50;
x=[1 2 3 4];
for i=1:length(w);
X(i)=0;
for k=1:length(x);
X(i)=X(i)+x(k).*exp(-j.*w(i).*n(k));
end
end
plot(w,X);
title('DTFT');

Plus de réponses (2)

Abhishek Ballaney
Abhishek Ballaney le 1 Mar 2018
Modifié(e) : Abhishek Ballaney le 1 Mar 2018
https://blogs.mathworks.com/steve/2010/06/25/plotting-the-dtft-using-the-output-of-fft/
https://blogs.mathworks.com/steve/2010/03/15/the-dft-and-the-dtft/

Piotr Gregor
Piotr Gregor le 1 Juil 2022

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by