can anyone help me in DFT files of matlab

Status
Not open for further replies.

Nosheen

Member level 1
Joined
Aug 2, 2007
Messages
33
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,286
Activity points
1,557
matlab to build matrix w for dft

hi...
can anyone help me in DFT files of matlab

thanx
 

matlab doesn't have dft.
it's fft instead.
correct me if i am wrong.
 

    Nosheen

    Points: 2
    Helpful Answer Positive Rating
Hi,

FFT is an efficient Algorithm for implementing DFT. So simply use it.

Regards
 

    Nosheen

    Points: 2
    Helpful Answer Positive Rating
FFT is directly available in MatLab . If you still want DFT you have to write MatLab code on your own.
By the way what do you mean by DFT files?
 

    Nosheen

    Points: 2
    Helpful Answer Positive Rating
here is direct command in matlab : fot calculating DFT . direct fourier transform , is the fastest version of FFT , so, it DFT uses FFT algorithm. ( theory)

fft(x,N) , or fft(x) where N, is the no. of samples, or length. and x is your signal.( Practical )

this is from comsian's ATD.

Added after 17 seconds:

here is direct command in matlab : fot calculating DFT . direct fourier transform , is the fastest version of FFT , so, it DFT uses FFT algorithm. ( theory)

fft(x,N) , or fft(x) where N, is the no. of samples, or length. and x is your signal.( Practical )
hope u will understand now...
this is from comsian's ATD.
 

If you want DFT

% transform length
N=8;
% make DFT matrix
>> W=fft(eye(N))
W =
Columns 1 through 4
1.0000 1.0000 1.0000 1.0000
1.0000 0.7071 - 0.7071i 0 - 1.0000i -0.7071 - 0.7071i
1.0000 0 - 1.0000i -1.0000 0 + 1.0000i
1.0000 -0.7071 - 0.7071i 0 + 1.0000i 0.7071 - 0.7071i
1.0000 -1.0000 1.0000 -1.0000
1.0000 -0.7071 + 0.7071i 0 - 1.0000i 0.7071 + 0.7071i
1.0000 0 + 1.0000i -1.0000 0 - 1.0000i
1.0000 0.7071 + 0.7071i 0 + 1.0000i -0.7071 + 0.7071i
Columns 5 through 8
1.0000 1.0000 1.0000 1.0000
-1.0000 -0.7071 + 0.7071i 0 + 1.0000i 0.7071 + 0.7071i
1.0000 0 - 1.0000i -1.0000 0 + 1.0000i
-1.0000 0.7071 + 0.7071i 0 - 1.0000i -0.7071 + 0.7071i
1.0000 -1.0000 1.0000 -1.0000
-1.0000 0.7071 - 0.7071i 0 + 1.0000i -0.7071 - 0.7071i
1.0000 0 + 1.0000i -1.0000 0 - 1.0000i
-1.0000 -0.7071 - 0.7071i 0 - 1.0000i 0.7071 - 0.7071i
% vector to be transformed
>> x=randn(1,N)
x =
-0.4326 -1.6656 0.1253 0.2877 -1.1465 1.1909 1.1892 -0.0376
% result of transform
>> y=x*W
y =
Columns 1 through 4
-0.4892 -1.5360 + 2.8537i -2.8935 + 0.7247i 2.9638 + 0.7260i
Columns 5 through 8
-0.0399 2.9638 - 0.7260i -2.8935 - 0.7247i -1.5360 - 2.8537i
The same result if we use built-in matlab function (fast algorithm of DFT)
>> y1=fft(x)
y1 =
Columns 1 through 4
-0.4892 -1.5360 + 2.8537i -2.8935 + 0.7247i 2.9638 + 0.7260i
Columns 5 through 8
-0.0399 2.9638 - 0.7260i -2.8935 - 0.7247i -1.5360 - 2.8537i
>>
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…