Академический Документы
Профессиональный Документы
Культура Документы
>> b=[.2];
>> a= [1 -.8];
>> W = -pi:(2*pi)/8192:pi;
>> [H,W] = freqz(b,a,W);
>> plot(W,abs(H));
>> hold on
>> plot (W ,phase(H))
>> n=0:.5:100;
>> x=cos(2*pi*n/20);
>> plot(n,x)
>> hold on;
>> y=filter(b,a,x);
>> plot(n,y)
2. Plot the phase response Ψ(𝜔) and ∠𝐻(𝑒𝑗𝜔) of the system described in Ex. 5.3.
2 b)
>> w=0:0.01:2*pi;
>> phi1=-3*w;
>> plot(w,phi1)
3. Reproduce Fig. 5.3 in Matlab using two different methods described on pp 210.
>> n=0:100;
>> x=cos(.05*pi*n);
>> plot(n,x)
>> stem(n,x)
>> hold on
>> y=filter(1,[1 -0.8], x)
>> hold on
>> stem (n,y)
>> n=0:100;
>> h=0.8.^n;
>> x=cos(.05*pi*n);
>> y=conv(h,x)
>> stem(n,x)
>> hold on;
>> stem(y);
System is with more memory now, as impulse response becomes zero after 40 samples as compared to
Problem 4 where it becomes zero after 15 samples.
>> [xp,n]=unitpulse(0,0,5,9);
>> x=persegen(xp,10,50,0);
>> stem(x);
>> hold on;
>> y=filter(b,a,x);
>> stem(y);
>>om=linspace(0,pi,60)
>> plot(om,abs(dtft12(x,0,om)))
>> y=filter(b,a,x);
>> plot(y);
>> b=[1];
>> a1=[1 -0.9*exp(j*pi/3)];
% System contains just two poles pk = 0.9e±jπ/3
.
>> a2=[1 -0.9*exp(-j*pi/3)];
>> a=conv(a1,a2);
>> fvtool(b,a);
>> a= [1];
>> b=[1 -.5]; % H (z) = (z-0.5) z=0.5 is a zero inside unit circle
>> fvtool(b,a) % Set the frequency range from -pi to +pi from analysis parameters.
Graphical analysis
>> b=[0.1646];
>> a=[1 -0.9 0.81];
>> fvtool(b,a)
12. Verify graphically that system given in (5.121) provides improved BPF than system in (5.115).
The graph obtained for equation 5.115 is given in problem 11 which is replicated below.
Following commands will be used to obtain the graph of the system of equation 5.121.
The second graph shows the better band pass characteristics from 0 to π radians.