Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics 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.

IMPULSE TRAIN GENERATION IN 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
impulse train matlab

an anyone help me generate an IMPUSLE COMB(impulse train) both in time and freq domain....

let the sampling period be Ts=0.00025 or Fs=4000 , next 2Fs,3Fs and so on...
kindly help me plot this impulse train and its FFT in MATLAB

thanx in advance
 

mondunno

Advanced Member level 4
Joined
Jan 11, 2007
Messages
119
Helped
15
Reputation
30
Reaction score
4
Trophy points
1,298
Activity points
1,907
impulse train in matlab

>> Ts = 0.00025;
>> Len = 16;
>> impulseTrain = ones(1, Len);
>> n = 0:Ts:Ts*(Len-1);
>> stem(n, impulseTrain);
>> xlabel('n ----->')
 

    Nosheen

    Points: 2
    Helpful Answer Positive Rating

mondunno

Advanced Member level 4
Joined
Jan 11, 2007
Messages
119
Helped
15
Reputation
30
Reaction score
4
Trophy points
1,298
Activity points
1,907
matlab impulse train

>> freq = fft(impulseTrain, Len);
>> stem([(0:Len-1)/(Len*Ts)], abs(freq))

it shows a peak at 0 frequency, that result is correct.
what happens is the fft just gives u the first window, its made to give only the non repeating part...
actually every discrete signal is a periodic in frequency domain.
so the actual fft that u obtained(which is a spike delta function),,, repeat it to get ur actual frequency domain(which is a impulse train again, repeated impulses, coz FD is periodic)

mon
 

    Nosheen

    Points: 2
    Helpful Answer Positive Rating

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
delta train matlab

yes, u r correct..i am having a peak at zero freq and all zeroz else where...
the problem iz that i want to see the plot of FFT of the impulse train as
--> the first peak at zero freq
--> 2nd impulse at Fs(or 1/Ts)
--> third at 2Fs(1/2Ts) and so on

i want the FFT to look like this in MATLAB... IZ IT POSSIBLE???
 

mondunno

Advanced Member level 4
Joined
Jan 11, 2007
Messages
119
Helped
15
Reputation
30
Reaction score
4
Trophy points
1,298
Activity points
1,907
plot impulses train

>> freq = fft(impulseTrain, Len);

>> freqRepeated = repmat(freq, 1, 10);
>> stem([(0:Len*10-1)/(Len*Ts)], abs(freqRepeated))

this method just shows 10 repetetions of FFT of impulse train...
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top