Using MATLAB Using a computer program calculate the DFT of a

Using MATLAB:

Using a computer program, calculate the DFT of a rectangular pulse, IT(). Take five samples of the pulse and pad it with 59 zeros so that a 64-point FFT algorithm can be used. Sketch the re- sulting magnitude spectrum. Compare this result with the actual spectrum for the pulse. Try other combinations of tine lillinber of pulse samples anl zero fxads io sex, how the resulti! 14°1. changes.

Solution

Matlab code for sampling rate 1 and T=5

z=zeros(1,59);
x=[1 1 1 1 1 z];
abs_x=abs(fft(x));
plot(abs_x,\'-r\');
hold on
f=0:1/64:63/64;
T=5;
plot(sinc(f*T),\'-b\');

Matlab code for sampling rate 4 and T=4*5=20 and sampling vector size 4*64=256:

z=zeros(1,236);
o=ones(1,20);
x=[o z];
abs_x=abs(fft(x));
plot(abs_x,\'-r\');
hold on
f=0:1/256:255/256;
T=20;
plot(sinc(f*T),\'-b\');

Using MATLAB: Using a computer program, calculate the DFT of a rectangular pulse, IT(). Take five samples of the pulse and pad it with 59 zeros so that a 64-poi

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site