Digital Signal Processing Reference
In-Depth Information
subplot(221);plot(T(s:e),x(s:e),'.',T(s:e),x(s:e),T(s:e),
y(s:e));grid;
xlabel(' Iterations ')
subplot(222);plot(T,A,T,B,T,C);grid
xlabel(' Iterations ');
ylabel(' Parameters ');
% subplot(212);polar(theta,rho, 'o') ;grid;
A.6 Chapter 6 MATLAB Programs
In this chapter we gave a detailed treatment of a specific problem in direction
finding, showing the need to understand systems engineering in order to implement
DSP algorithms. It is very difficult to isolate DSP problems from other areas of
engineering. Practical problems tend to cover many areas but centre on one area
that demands the principal focus.
A.6.1 Program f 6_9b
%Digital Signal Processing:A Practitioner's Approach
%Dr.Kaluri Venkata Ranga Rao, kaluri@ieee.org
%Generates figure 6.4
clear;close;
N=50;psi_deg=30;
k=1:N; f=0.1; theta=30; A_x=sin(theta*pi/180);A_y=cos(theta*pi/180);
psi_x=fix(rand(size(k))*psi_deg)*pi/180;
psi_y=fix(rand(size(k))*psi_deg)*pi/180;
x=A_x*cos(2*pi*f*k+psi_x);
y=A_y*cos(2*pi*f*k+psi_y);
subplot(221);
plot(x,y,'-');grid;title('A');xlabel('Analog');
%ylabel('- Y -');
u=ones(size(x));
A(:,1)=x';A(:,2)=u';
p=inv(A'*A)*A'*y';
X=linspace(min(x),max(x),100);
Y=p(1)*X+p(2);
subplot(222);
plot(x,y,'o',X,Y);grid;title('B');xlabel('Digital');
pause
print -depsc f6_9b
%ylabel('- Y -');
Search WWH ::




Custom Search