Impulse signal generation—MATLAB
When defining the impulse or \delta (t) signal, the shape of the signal used to do so is not important. Whether we use the rectangular pulse we considered in this chapter or another pulse, or even a signal that is not a pulse, in the limit we obtain the same impulse signal. Consider the following cases:
(a) The triangular pulse,
\Lambda_{\Delta}(t) = \frac{1}{\Delta}\left(1-\left\vert \frac{t}{\Delta}\right\vert\right)\left(u(t+\Delta) - u(t-\Delta)\right).
Carefully plot it, compute its area, and find its limit as \Delta\rightarrow 0. What do you obtain in the limit? Explain.
(b) Consider the signal
S_\Delta (t) = \frac{\sin (\pi t/\Delta)}{\pi t}.
Use the properties of the sinc signal S(t) = \sin (\pi t)/(\pi t) to express S_\Delta (t) in terms of S(t). Then find its area, and the limit as \Delta\rightarrow 0. Use symbolic MATLAB to show that for decreasing values of \Delta the S_\Delta (t) becomes like the impulse signal.
Solution: MATLAB Script
(a)
% Pr. 1.7
clear all; clf
% part (a)
delta=0.1;
t=[-delta:0.05:delta];N=length(t);
lambda=zeros(1,N);
figure(5)
for k=1:6,
lambda=(1-abs(t/delta))/delta;
delta=delta/2;
plot(t,lambda);xlabel(’t’)
axis([-0.1 0.1 0 330]);grid
hold on
pause(0.5)
end
grid
hold off
(b)
% part (b)
syms S t
delta=1;
figure(6)
for k=1:4,
delta=delta/k;
S=(1/delta)*sinc(t/delta);
ezplot(S,[-2 2])
axis([-2 2 -8 30])
hold on
I=subs(int(S,t,-100*delta, 100*delta)) % area under sinc
pause(0.5)
end
grid;xlabel(’t’)
hold off
No comments:
Post a Comment