Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Register Log in

can anyone help me in DFT files of matlab

Status
Not open for further replies.

Nosheen

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

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

thanx
 

rsrinivas

Advanced Member level 1
Joined
Oct 10, 2006
Messages
415
Helped
50
Reputation
100
Reaction score
12
Trophy points
1,298
Location
bengalooru
Activity points
3,704
matlab doesn't have dft.
it's fft instead.
correct me if i am wrong.
 

    Nosheen

    points: 2
    Helpful Answer Positive Rating

mahdithdn

Advanced Member level 4
Joined
Aug 18, 2004
Messages
107
Helped
27
Reputation
54
Reaction score
9
Trophy points
1,298
Location
Iran
Activity points
896
Hi,

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

Regards
 

    Nosheen

    points: 2
    Helpful Answer Positive Rating

sudarshan_onkar

Junior Member level 1
Joined
Sep 3, 2006
Messages
15
Helped
2
Reputation
4
Reaction score
0
Trophy points
1,281
Activity points
1,359
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

vjfaisal

Full Member level 4
Joined
Sep 24, 2006
Messages
205
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,296
Location
pakistan
Activity points
2,701
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.
 

vadkudr

Advanced Member level 4
Joined
Jul 12, 2005
Messages
109
Helped
15
Reputation
30
Reaction score
4
Trophy points
1,298
Activity points
2,236
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.
Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top