# IMPULSE TRAIN GENERATION IN MATLAB...

Status
Not open for further replies.

#### Nosheen

##### Member level 1 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

#### mondunno 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

#### mondunno 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

#### Nosheen

##### Member level 1 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 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.