Digital Signal Processing Reference
In-Depth Information
xlabel(' frequency Hz ')
pause
% print -depsc f11_5
%zoom;
A.2 Chapter 2 MATLAB Programs
This chapter was a refresher on some relevant engineering topics. It should help you
with the rest of the topic. We considered the autocorrelation function, representation
of linear systems, and noise and its propagation in linear systems. We also discussed
the need to know about systems reliability. Most problems in real life are inverse
problems, so we introduced the Moore-Penrose pseudo-inverse. We concluded by
providing an insight into binary number systems.
A.2.1 Program f 2_345
%Digital Signal Processing:A Practitioner's Approach
%Dr.Kaluri Venkata Ranga Rao, kaluri@ieee.org
%Generates figures 2.3,2.4
clear;clf
delta=0.1;f=100;
omega=2*pi*f;
b=omega*omega;
a=[1 2*delta*omega omega*omega];
Ts=1/(10*f);
sysc=tf(b,a)
sysd=c2d(sysc,Ts,'tustin');
sysd1=c2d(sysc,2*Ts,'tustin');
[b1 a1]=tfdata(sysd,'v');
[b2 a2]=tfdata(sysd1,'v');
[y,tc]=impulse(sysc); tfinal=length(tc);
td=1:tfinal; x=td*0; x(1)=1;
y1=f ilter(b1,a1,x); y2=filter(b2,a2,x);
delt=1;n1=length(x);delf = (1/delt)/n1;
Sy = fft(y2);
M = abs(Sy)*delt; n=fix(length(M)/2);
[Mx i]=max(M(1:n));
mark=zeros(size(M)); mark(i)=M(i);
f1=1:n; f1=f1*delf;
Rtow=real(ifft(fftshift(M)));
Rtow=fftshift(Rtow);
T=1:length(Rtow); T=T-fix(length(Rtow)/2);
T=T*delt;
Search WWH ::




Custom Search