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

61 次查看(过去 30 天)
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

采纳的回答

sairaj burewar
sairaj burewar 2018-3-1
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');

更多回答(2 个)

Abhishek Ballaney
编辑:Abhishek Ballaney 2018-3-1
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 2022-7-1

类别

Help CenterFile Exchange 中查找有关 Logical 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by