Asked by geometry geometry
on 18 May 2018

How can write a function DFT(x) (in terms of jw) such that for the given discrete signal x[n]:

Answer by KALYAN ACHARJYA
on 18 May 2018

Edited by KALYAN ACHARJYA
on 18 May 2018

Do you know how to calculate DFT of x=[1,0,-1,0], Do it manually (On paper) and implement it in Matlab. During Implementation, if you find any difficulty, then share on the Matlab Answer Platform.

Sign in to comment.

Opportunities for recent engineering grads.

Apply Today
## 7 Comments

## Walter Roberson (view profile)

Direct link to this comment:https://www.mathworks.com/matlabcentral/answers/401352-creating-function-matlab-code#comment_569200

What is w in this context?

## Walter Roberson (view profile)

Direct link to this comment:https://www.mathworks.com/matlabcentral/answers/401352-creating-function-matlab-code#comment_569203

Is x[n] intended to indicate x multiplied by floor(n)? Because if it is intended to indicate indexing then you cannot index at infinity.

## geometry geometry (view profile)

Direct link to this comment:https://www.mathworks.com/matlabcentral/answers/401352-creating-function-matlab-code#comment_569225

no x[n] is a discrete type signal. and DFT is the Fourier transform of x[n]. (w is frequency variable)

## Guillaume (view profile)

Direct link to this comment:https://www.mathworks.com/matlabcentral/answers/401352-creating-function-matlab-code#comment_569234

A

discretetransform is by definition over a finite discrete domain, not -∞, +∞.The discrete fourier transform is the

fftfunction in matlab. Is that what you're asking?## geometry geometry (view profile)

Direct link to this comment:https://www.mathworks.com/matlabcentral/answers/401352-creating-function-matlab-code#comment_569239

I don't want to use fft. the signal x[n] is zero for large n. (for example we can assume that x[n]=0 for n<-100 and n>100).

the result of DFT should be in terms of w.

## Guillaume (view profile)

Direct link to this comment:https://www.mathworks.com/matlabcentral/answers/401352-creating-function-matlab-code#comment_569240

I think you need to explain in a lot more details what it is you're after. Perhaps, give some concrete examples.

I don't want to use fft. Why not? This gives you the frequencies (ω) of your discrete signal.## geometry geometry (view profile)

Direct link to this comment:https://www.mathworks.com/matlabcentral/answers/401352-creating-function-matlab-code#comment_569330

I'm going to plot DFT.

Because my project says to do it without using fft.

Sign in to comment.