Signal LabReport
Signal LabReport
Signal LabReport
Lab Report
Advanced Signal Processing
Submitted By
DR. A. Karmakar
IC Design Group
Lab Assignment - I
Signal & Image Processing - I: ENG(CEERI) : 2-219
Advanced Electronic Systems
AcSIR IMP Programme
CSIR-CEERI, Pilani
CENTRAL ELECTRONICS ENGINEERING RESEARCH INSTITUTE, PILANI, RAJASTHAN, INDIA-333 031 Page 2
I.1
y[n]
1
M
M 1
x[n k ] .
k 0
Such a system is often used in smoothing random variations in data. Consider the case of a signal
s[n] is corrupted by a noise d[n] for n>=0, resulting in a measured data given by x[n] s[n] d[n] .
We would like to reduce the effect of the noise d[n] and get a better estimate of s[n] from x[n].
n
Generate the signal s[n] 2n 0.9 and plot this uncorrupted signal. Generate a realization of
(100 values) of random noise by using rand function containing pseudo-random values drawn from
a uniform distribution on the unit interval. Now, generate the corrupted signal x[n].Employ the
moving average filter for M=3 and notice the effect of the noise smoothing. Comment on delay for
this operation. Also investigate the effect of signal smoothing by the moving average filter of length
4 and higher. Comment on your results.
CODE:
assignment1_1.m
%Lab Assignment-1.1
%M-Point Moving Average Filter to smooth corrupted signal
%Submitted By
% Tapas Kumar Dash
% Trainee Scientist, PGRPE-2014
clc
clear all
close all
M=input('Enter the required M point value of Moving Average
Filter:');
out=moving_average_filter( M );
--------------------------------------------------------------
moving_average_filter.m
function [ y ] = moving_average_filter( M )
%Implementation of MOVING AVERAGE FILTER
%Such a system is used in smoothing random variations in data
CENTRAL ELECTRONICS ENGINEERING RESEARCH INSTITUTE, PILANI, RAJASTHAN, INDIA-333 031 Page 3
%Time Index n
%Generate the uncorrupted signal
%Generate the random noise
x=s+d;
%***************************************************************
********
%Logic Implementation of Moving Average Filter Starts from here
%***************************************************************
********
x=[zeros(1,M-1) x];
y=zeros(1,100);
for i=M:(length(x))
for j=1:M
y(i-M+1)=y(i-M+1)+x(i-j+1);
end
end
y=y/M;
OUTPUT:
Enter the required M point value of Moving Average Filter:3
CENTRAL ELECTRONICS ENGINEERING RESEARCH INSTITUTE, PILANI, RAJASTHAN, INDIA-333 031 Page 5
CENTRAL ELECTRONICS ENGINEERING RESEARCH INSTITUTE, PILANI, RAJASTHAN, INDIA-333 031 Page 6
Comments:
1. For M=3,4, and higher order(M=10),M-point moving average system
output were found out.
2. It is observed that for higher order M-Point averaging system the noise
smoothing is more.
CENTRAL ELECTRONICS ENGINEERING RESEARCH INSTITUTE, PILANI, RAJASTHAN, INDIA-333 031 Page 7
I.2
implemented by sliding a window of one length over the input sequence x[n] one sample time. At
the nth instant, the input samples inside the window are rank ordered from the largest to the
smallest in values, and the sample at the middle is the median value. The output y[n] of the median
filter is then given
CODE:
assignment1_2.m
%Lab Assignment-1.2
%Median Filter to smooth corrupted signal
%Submitted By
% Tapas Kumar Dash
% Trainee Scientist, PGRPE-2014
clc
clear all
close all
k=7;
%***************************************************************
********
%Description of given system
m=0:1:99;
%Time Index n
x=zeros(1,100);
s=zeros(1,100);
for i=1:100
s(i)=2*(i-1)*((.9).^(i-1)); %Generate the uncorrupted signal
CENTRAL ELECTRONICS ENGINEERING RESEARCH INSTITUTE, PILANI, RAJASTHAN, INDIA-333 031 Page 8
x=s+d;
%***************************************************************
********
y=median_filter(k,x);
%***************************************************************
********
%***************************************************************
**********
%Plotting of The Results starts here
%***************************************************************
**********
subplot(2,1,1);
plot(m,d,'r-',m,s,'g--',m,x,'b-.'),xlabel('Time index
n');ylabel('Amplitude');legend('d[n]:Random Noise
Signal','s[n]:Uncorrupted Signal','x[n]: Corrupted Signal');
grid,title('Variation of Random Noise Signal:d[n], Uncorrupted
signal:s[n]and Corrupted signal:x[n] w.r.t Time index n)');
subplot(2,1,2);
plot(m,y,'r-',m,s,'g--',m,x,'b-.');
legend('y[n]: Smoothed Median Filter Output','s[n]:Uncorruped
Signal','x[n]: Corrupted Signal');
xlabel('Time index n');ylabel('Amplitude');
grid,title('Median Filter Smoothed Output');
%Plotting of The Results ends here
%***************************************************************
***********
median_filter.m
function [ y ] = median_filter( k,x)
%MEDIAN_FILTER is used to smooth the corrupted signal
y=zeros(1,100);
%***************************************************************
********
%Logic Implementation of Median Filter Starts from here
CENTRAL ELECTRONICS ENGINEERING RESEARCH INSTITUTE, PILANI, RAJASTHAN, INDIA-333 031 Page 9
piecewise_sorting.m
function [ w ] = piecewise_sorting( x )
%PIECEWISE_SORTING sorts the input vector piecewise
for i=1:length(x)
for j=1:i-1
if x(j)>x(j+1)
tmp=x(j);
x(j)=x(j+1);
x(j+1)=tmp;
end
end
end
w=x;
end
linearity_time_invariance_check.m
clear all;
close all;
clc
k=7;
x1=[1 4 8 2 3 9 0 0 8 9 0 9 8];
x2=[8 0 2 4 1 3 7 0 8 9 0 9 8];
m1=median_filter(7,x1);
m2=median_filter(7,x2);
x3=3.*x1+5.*x2;
m3=median_filter(7,x3);
if(m3==3*m1+5*m2)
disp('filter is linear');
else
disp('filter is non-linear');
CENTRAL ELECTRONICS ENGINEERING RESEARCH INSTITUTE, PILANI, RAJASTHAN, INDIA-333 031 Page 10
Comment:
PLOT:
CENTRAL ELECTRONICS ENGINEERING RESEARCH INSTITUTE, PILANI, RAJASTHAN, INDIA-333 031 Page 11
I.3
1
x[n]
y[n] y[n 1]
2
y[n 1]
where x[n] and y[n] are , respectively, the input and output sequences. Show that the output y[n] of
the above system for an input x[n] nu[n] with y[1] 1 converges to
as n when is
a positive number. Is the above system linear or non-linear ? Is it time-invariant ? Justify your
answer.
Implement the above system in MATLAB and show that output y[n] of the above system for an
input x[n] nu[n] with y[1] 1 converges to
as n .
CODE
assignment1_3.m
%Lab Assignment-1.3
%Submitted By
% Tapas Kumar Dash
% Trainee Scientist, PGRPE-2014
close all;
clear all;
clc
alpha= input('Enter values of Alpha:');
u=ones(1,100);
n=1:100;
for i=1:length(alpha)
x=alpha(i)*u;
out=output_discrete_system(x);
plot(n,out,'DisplayName',['alpha=',num2str(alpha(i))]),legend('DynamicLegend'),hold all;
end
output_discrete_system.m
CENTRAL ELECTRONICS ENGINEERING RESEARCH INSTITUTE, PILANI, RAJASTHAN, INDIA-333 031 Page 12
OUTPUT:
Enter values of Alpha:[ 0.25 0.5 2 5 8];
CENTRAL ELECTRONICS ENGINEERING RESEARCH INSTITUTE, PILANI, RAJASTHAN, INDIA-333 031 Page 13
I.4
process of recovering x[n] knowing y[n] is called deconvolution. A recursive algorithm for
deconvolution can be developed from a sequence obtained by a convolution of two finite-length
sequences. Let the lengths of x[n] and h[n] be N and M, respectively. Show that x[n] can be
computed recursively for 0 n N 1 from h[n] and the first N samples of y[n] by a linear
constant coefficient difference equation. Now consider the following cases,
a)
b)
Determine x[n] for the above. The first sample in each sequence is its value at n=0.
The deconvolution operation as defined above can be performed using MATLAB. Employ the
appropriate MATLAB function and the obtain x[n] for the two cases. Compare your results.
CODE:
assignment1_4.m
%Lab Assignment-1.4
%Submitted By
% Tapas Kumar Dash
% Trainee Scientist, PGRPE-2014
%Deconvolution
clear all
close all
clc
y1=[2 8 20 40 60 68 62 40];
h1=[2 4 6 8];
x1=deconv(y1,h1);
disp(x1);
x2=deconvolution(y1,h1);
disp(x2);
x3=x2(1:length(y1)-length(h1)+1);
disp(x3);
if(x1==int64(x3))
CENTRAL ELECTRONICS ENGINEERING RESEARCH INSTITUTE, PILANI, RAJASTHAN, INDIA-333 031 Page 14
deconvolution.m
function [ out ] = deconvolution( y,h )
[mb,nb] = size(y);
nb = max(mb,nb);
na = length(h);
% Deconvolution and polynomial division are the same
operations
% as a digital filter's impulse response B(z)/A(z):
q = filter(y, h,[1 zeros(1,nb-na)]);
out=q;
end
CENTRAL ELECTRONICS ENGINEERING RESEARCH INSTITUTE, PILANI, RAJASTHAN, INDIA-333 031 Page 15
X1= 1
For 1st question Deconvolution obtained from User defined function is same as obtained by InBuilt
Function deconv()
X2=3 -2
4 18 39
X2=3 -2
4 18 39
For 2nd question Deconvolution obtained from User defined function is same as obtained by InBuilt
Function deconv()
I.5
1 N n N
0 otherwise
a) y1[n]
1 n / N , N n N
otherwise
b) y2 [n]
cos( n / 2 N ), N n N
otherwise
0,
c) y2 [n]
Plot the real and imaginary parts and the magnitude and phase spectra of the DTFTs. Comment on
the result.
CODE:
assignment1_5.m
%Lab Assignment-1.5
%DTFT of the given sequences
%Submitted By
CENTRAL ELECTRONICS ENGINEERING RESEARCH INSTITUTE, PILANI, RAJASTHAN, INDIA-333 031 Page 16
%Time Index n
CENTRAL ELECTRONICS ENGINEERING RESEARCH INSTITUTE, PILANI, RAJASTHAN, INDIA-333 031 Page 17
discrete_fourier_transform.m
function [ out ] = discrete_fourier_transform( x )
%DISCRETE_FOURIER_TRANSFORM Summary of this function goes here
%
Detailed explanation goes here
k=1;
for w=-pi:pi/40:pi
y(1)=0;
for i=2:length(x)+1
y(i)=x(i-1)*exp(-1i*w*(i-2))+y(i-1);
end
out(k)=sum(y);
k=k+1;
end
end
plot_figure.m
function [ output_args ] = plot_figure( y,x,w,i )
%PLOT_FIGURE Summary of this function goes here
%
Detailed explanation goes here
n=-40:40;
subplot(2,2,1),stem(n,x),grid,title(['Input
Sequence',int2str(i)]);
subplot(2,2,2),plot(w./pi,real(y),'b',w,imag(y),'r'),grid,title(
['DTFT of Input Sequence-',int2str(i)]);
subplot(2,2,3),plot(w./pi,abs(y)),grid,title(['Magnitude
spectrum of DTFT of Input Sequence-',int2str(i)]);
CENTRAL ELECTRONICS ENGINEERING RESEARCH INSTITUTE, PILANI, RAJASTHAN, INDIA-333 031 Page 18
OUTPUT:
enter the value for N:5
CENTRAL ELECTRONICS ENGINEERING RESEARCH INSTITUTE, PILANI, RAJASTHAN, INDIA-333 031 Page 19
I.6
Determine and plot the real and imaginary parts, and the magnitude and phase spectra of
the following DTFTs
a) G(e j )
1
for(i) r 0.9 0.75 and (ii) r 0.7 0.5
1 2r (cos )e j r 2e j 2
1 3e j 3e j 2 e j 3
b) X (e )
0.0736 0.0718e j 0.0631e j 2 0.0214e j 3
j
CODE
assignment1_6.m
%Lab Assignment-1.6
%Plot the real and imaginary parts, and the magnitude and phase
spectra of
%DTFTs
%Submitted By
% Tapas Kumar Dash
% Trainee Scientist, PGRPE-2014
clc
clear all
close all
CENTRAL ELECTRONICS ENGINEERING RESEARCH INSTITUTE, PILANI, RAJASTHAN, INDIA-333 031 Page 20
plot_figure_6.m
function [ out ] = plot_figure_6( G,w )
%PLOT_FIGURE_6 Summary of this function goes here
%
Detailed explanation goes here
out=G;
CENTRAL ELECTRONICS ENGINEERING RESEARCH INSTITUTE, PILANI, RAJASTHAN, INDIA-333 031 Page 21
CENTRAL ELECTRONICS ENGINEERING RESEARCH INSTITUTE, PILANI, RAJASTHAN, INDIA-333 031 Page 22
I.7
2 z 4 16 z 3 44 z 2 56 z 32
a) G1 ( z )
3z 4 3z 3 15 z 2 18 z 12
b) G2 ( z )
and show their pole-zero plots. Determine all regions of convergence (ROCs) of each of the above ztransforms, and describe the type of their inverse z-transforms (left-sided, right-sided, two-sided
sequences) associated with each of the ROCs.
CODE:
assignment1_7.m
%Lab Assignment-1.7
%Determine Factored form of given Z-transform
%Plot its pole-zero plot
%Submitted By
% Tapas Kumar Dash
% Trainee Scientist, PGRPE-2014
CENTRAL ELECTRONICS ENGINEERING RESEARCH INSTITUTE, PILANI, RAJASTHAN, INDIA-333 031 Page 23
OUTPUT
enter numerator:[2 16 44 56 32]
enter denominator:[3 3 -15 18 -12]
ans =
(z-(-4))(z-(-2))(z-(-1+1i))(z-(-1-1i))
G=
------------------------------------------------(z-(-3.2361))(z-(1.2361))(z-(0.5+0.86603i))(z-(0.5-0.86603i))
b)
CENTRAL ELECTRONICS ENGINEERING RESEARCH INSTITUTE, PILANI, RAJASTHAN, INDIA-333 031 Page 24
------------------------------------------------(z-(2+3i))(z-(2-3i))(z-(-1+2i))(z-(-1-2i))
Power Complementary
I.8
H (e )
j
i 0
1.
Through analytic continuation, we find the equivalent relation in z-transform (on unit circle)
L 1
H ( z)H ( z
i 0
) 1
H 0 ( z) H 0 ( z 1 ) H1 ( z) H1 ( z 1 ) 1
CENTRAL ELECTRONICS ENGINEERING RESEARCH INSTITUTE, PILANI, RAJASTHAN, INDIA-333 031 Page 25
0.75 z 1 2 z 2 2 z 3 z 4 0.75 z 5
3 3.5 z 2 z 4
b) H ( z )
CODE:
assignment1_8.m
%Lab Assignment-1.8
%verification of power complementary function
%Submitted By
% Tapas Kumar Dash
% Trainee Scientist, PGRPE-2014
clear all;
close all;
clc
w=2*pi;
b=input('enter numerator:');
a=input('enter denominator:');
[Z,p,k]=tf2zpk(b,a);
np=poly(Z);
dp=poly(p);
%H(z)
z=exp(1i*w);
num=polyval(np,z);
den=polyval(dp,z);
h1=k*(num./den);
%H(z^-1)
z1=exp(-1i*w);
num1=polyval(np,z1);
den1=polyval(dp,z1);
h2=k*(num1./den1);
%H(z)*H(z^-1)
h3=h1.*h2;
%H(-z)
z2=-exp(1i*w);
num2=polyval(np,z2);
den2=polyval(dp,z2);
h4=k*(num2./den2);
%H(-z^-1)
z3=-exp(-1i*w);
num3=polyval(np,z3);
CENTRAL ELECTRONICS ENGINEERING RESEARCH INSTITUTE, PILANI, RAJASTHAN, INDIA-333 031 Page 26
OUTPUT:
a)
>>enter numerator:[0 0.75 2 2 1 0.75]
enter denominator:[3 0 3.5 0 1]
0.755555555555554
b)
>>enter numerator:[1 -1.5 3.75 -2.75 2.75 -3.75 1.55 -1]
enter denominator:[6 0 6.5 0 4.5 0 1]
1.005570987654322
I.9
z 1 (1 z 1 )2
H ( z)
(1 0.4 z 1 )(1 0.88 z 1 0.61z 2 )
Using MATLAB determine and plot its gain reponses and show that it has a highpass response.
CODE:
assignment1_9.m
%Lab Assignment-1.9
%Submitted By
% Tapas Kumar Dash
% Trainee Scientist, PGRPE-2014
clear all;
close all;
clc
CENTRAL ELECTRONICS ENGINEERING RESEARCH INSTITUTE, PILANI, RAJASTHAN, INDIA-333 031 Page 27
Output:
>>
enter zeros:[0;1;1]
enter poles:[0.4;0.44+0.6453i;0.44-0.6543i]
CENTRAL ELECTRONICS ENGINEERING RESEARCH INSTITUTE, PILANI, RAJASTHAN, INDIA-333 031 Page 28
Lab Assignment II
Lab: Signal & Image Processing- I: ENG (CEERI): 2-219
Advanced Electronic Systems
AcSIR IMP Programme
CSIR-CEERI, Pilani
CENTRAL ELECTRONICS ENGINEERING RESEARCH INSTITUTE, PILANI, RAJASTHAN, INDIA-333 031 Page 29
Show the plots pole-zero, log magnitude, phase, and group delay for Hd(ejw) and comment on
stability, causality and also on whether the system is minimum phase .
CODE:
test_1.m
%
%
%
%
%
%
%Lab Assignment-1
%Author:TAPAS KUMAR DASH
%Trainee Scientist,PGRPE-2014
Show the plots pole-zero, log magnitude, phase, and group delay for
distorting function Hd(ejw) and comment on stability, causality and
also on whether the system is minimum phase
clc
clear all
close all
zero=[0.9*exp(0.6j*pi) 0.9*exp(-0.6j*pi) 1.25*exp(0.8j*pi) 1.25*exp(0.8j*pi)];
pole=[0 0 0 0];
[Hmag,Hang,w]=freq_response(pole,zero,'PZ');
num=poly(zero);
den=poly(pole);
hd=filt(num,den);%Transfer function
figure(1),
subplot(2,2,1)
plot(w/pi,Hmag);
xlabel('frequency(xPi)');
title('log magnitude');
subplot(2,2,3)
plot(w/pi,Hang);
xlabel('frequency(xPi)');
title('phase');
subplot(2,2,2)
pzmap(hd);
title('pole zero plot');
[grpdel,w]=group_delay_calculation(pole,zero,'PZ');
subplot(2,2,4)
plot(w,grpdel);
title('group delay');
res1=verify_stability(zero,pole);
CENTRAL ELECTRONICS ENGINEERING RESEARCH INSTITUTE, PILANI, RAJASTHAN, INDIA-333 031 Page 30
freq_response.m
function [ Hmag,Hang,w ] =
freq_response(Pole_or_Denominator,Zero_or_Numerator,TYPE )
%Function has 3 arguments:: 1-Pole_or_Denominator
%
2-Zero_or_Numerator
%
3-TYPE
%Argument TYPE denotes whether input arguments are in pole zero form(if
%TYPE='PZ') or numerator and denominator form(if TYPE='ND')
if strcmp(TYPE,'PZ')
denominator=poly(Pole_or_Denominator);
numerator=poly(Zero_or_Numerator);
elseif strcmp(TYPE,'ND')
denominator=Pole_or_Denominator;
numerator=Zero_or_Numerator;
end
denominator_length=length(denominator);
numerator_length=length(numerator);
Hmag_numerator=zeros(1,101);
Hmag_denominator=zeros(1,101);
k=1;
for w=-pi:pi/50:pi
for m=0:numerator_length-1
Hmag_numerator(k)=Hmag_numerator(k)+numerator(m+1)*exp(-m*1j*w);
end
k=k+1;
end
CENTRAL ELECTRONICS ENGINEERING RESEARCH INSTITUTE, PILANI, RAJASTHAN, INDIA-333 031 Page 31
end
group_delay_calculation.m
function [ group_delay,w ] = group_delay_calculation(
Zero_or_Numerator,Pole_or_Denominator,TYPE )
%This function performs group delay calculation
if strcmp(TYPE,'PZ')
denominator=poly(Pole_or_Denominator);
numerator=poly(Zero_or_Numerator);
elseif strcmp(TYPE,'ND')
denominator=Pole_or_Denominator;
numerator=Zero_or_Numerator;
end
denominator_length=length(denominator);
numerator_length=length(numerator);
Hmag_numerator=zeros(1,101);
Hmag_denominator=zeros(1,101);
k=1;
for w=-pi:pi/50:pi
for m=0:numerator_length-1
Hmag_numerator(k)=Hmag_numerator(k)+numerator(m+1)*exp(-m*1j*w);
end
k=k+1;
end
k=1;
for w=-pi:pi/50:pi
for m=0:denominator_length-1
Hmag_denominator(k)=Hmag_denominator(k)+denominator(m+1)*exp(m*1j*w);
end
k=k+1;
CENTRAL ELECTRONICS ENGINEERING RESEARCH INSTITUTE, PILANI, RAJASTHAN, INDIA-333 031 Page 32
verify_stability.m
function [res] =verify_stability(zero,pole)
%If all the poles are inside unit circle then system is stable
if max(abs(pole))<1
res=1; %Stable
else
res=0;
end
end
verify_causality.m
function [res] = verify_causality(zero,pole)
if max(abs(pole))==0
res=1;
else
res=0;
end
end
verify_minimumphasesystem_pz.m
function [res] = verify_minimumphasesystem_pz(zero,pole)
pole_mag=abs(pole);
zero_mag=abs(zero);
if max(pole_mag)<1 && max(zero_mag)<1
res=1;
else
res=0;
end
end
CENTRAL ELECTRONICS ENGINEERING RESEARCH INSTITUTE, PILANI, RAJASTHAN, INDIA-333 031 Page 33
OUTPUT:
Comment:
System is: stable causal and non-minimum phase system
II.2 Plot the log magnitude, phase and group delay for a second order all-pass system with poles at
z =0.9e-j/4 and z=0.9ej/4.
CODE:
CENTRAL ELECTRONICS ENGINEERING RESEARCH INSTITUTE, PILANI, RAJASTHAN, INDIA-333 031 Page 34
%Lab Assignment-2
%Author:TAPAS KUMAR DASH
%Trainee Scientist,PGRPE-2014
Plot the log magnitude, phase and group delay for a second order
all-pass system with poles at z =0.9e-j?/4 and z=0.9ej?/4.
clc
clear all
close all
pole=[0.9*exp(-1j*pi/4) 0.9*exp(1j*pi/4)];
%Zeros are conjugate inverse of poles
zero=[1.1111*exp(1j*pi/4) 1.1111*exp(-1j*pi/4)];
[Hmag,Hang,w]=freq_response(pole,zero,'PZ');
num=poly(zero);
den=poly(pole);
hd=filt(num,den);%Transfer function
figure(1),
subplot(2,2,1)
plot(w/pi,Hmag);
xlabel('frequency(xPi)');
title('log magnitude');
subplot(2,2,3)
plot(w/pi,Hang);
xlabel('frequency(xPi)');
title('phase');
subplot(2,2,2)
pzmap(hd);
title('pole zero plot');
[grpdel,w]=group_delay_calculation(pole,zero,'PZ');
subplot(2,2,4)
plot(w,grpdel);
title('group delay');
freq_response.m
function [ Hmag,Hang,w ] =
freq_response(Pole_or_Denominator,Zero_or_Numerator,TYPE )
%Function has 3 arguments:: 1-Pole_or_Denominator
%
2-Zero_or_Numerator
%
3-TYPE
%Argument TYPE denotes whether input arguments are in pole zero form(if
%TYPE='PZ') or numerator and denominator form(if TYPE='ND')
if strcmp(TYPE,'PZ')
denominator=poly(Pole_or_Denominator);
numerator=poly(Zero_or_Numerator);
elseif strcmp(TYPE,'ND')
denominator=Pole_or_Denominator;
numerator=Zero_or_Numerator;
CENTRAL ELECTRONICS ENGINEERING RESEARCH INSTITUTE, PILANI, RAJASTHAN, INDIA-333 031 Page 35
end
group_delay_calculation.m
function [ group_delay,w ] = group_delay_calculation(
Zero_or_Numerator,Pole_or_Denominator,TYPE )
%This function performs group delay calculation
if strcmp(TYPE,'PZ')
denominator=poly(Pole_or_Denominator);
numerator=poly(Zero_or_Numerator);
elseif strcmp(TYPE,'ND')
denominator=Pole_or_Denominator;
numerator=Zero_or_Numerator;
end
denominator_length=length(denominator);
numerator_length=length(numerator);
Hmag_numerator=zeros(1,101);
Hmag_denominator=zeros(1,101);
k=1;
for w=-pi:pi/50:pi
CENTRAL ELECTRONICS ENGINEERING RESEARCH INSTITUTE, PILANI, RAJASTHAN, INDIA-333 031 Page 36
OUTPUT:
and
Hmax(z) = Hmin(z-1)z-Mi
Consider the minimum phase function
= .
( .
)( .
)( .
)( .
CENTRAL ELECTRONICS ENGINEERING RESEARCH INSTITUTE, PILANI, RAJASTHAN, INDIA-333 031 Page 37
Code:
test_3.m
% % %Lab Assignment-3
% % %Author:TAPAS KUMAR DASH
% % %Trainee Scientist,PGRPE-2014
%
Consider the equations
%
H(z) = Hmin(z)Huc(z)Hmax(z);
and
%
%
Hmax(z) = Hmin(z-1)z-Mi
%
%
Consider the minimum phase function
%
%
H_min (z)=?1.25?^2 (1-0.9e^j0.6? z^(-1) )
%
(1-0.9e^(-j0.6?) z^(-1) )(1-0.8e^(-j0.8?) z^(-1) )(10.8e^j0.8? z^(-1) )
%
%
By using above equations and the minimum phase function design a
%linear phase system and plot the log magnitude, phase and group delay.
clc
clear all
close all
k=1.25*1.25;
zero=[0.9*exp(1j*0.6*pi); 0.9*exp(-1j*0.6*pi); 0.8*exp(-1j*0.8*pi);
0.8*exp(1j*0.8*pi)];
pole=[];
figure,frequency_response(zero,pole,k);%minimum phase system
zero=[1.11*exp(1i*0.6*pi);1.11*exp(-1i*0.6*pi);1.25*exp(1i*0.8*pi);1.25*exp(1i*0.8*pi)];
pole=[];
k=0.9*0.9;
figure,frequency_response(zero,pole,k);%maximum phase system
zero=[1.11*exp(1i*0.6*pi);1.11*exp(1i*0.6*pi);1.25*exp(1i*0.8*pi);1.25*exp(1i*0.8*pi);0.9*exp(1i*0.6*pi);0.9*exp(1i*0.6*pi);0.8*exp(1i*0.8*pi);0.8*exp(-1i*0.8*pi)];
pole=[];
k=1.2656;
figure,frequency_response(zero,pole,k);%linear phase system
frequency_response.m
function [ y ] = frequency_response(Z,p,k)
%FREQUENCY_RESPONSE Summary of this function goes here
%Frequncy Response of a filter given poles and zeros
w=0:pi/100:2*pi;
z=exp(1i*w);
CENTRAL ELECTRONICS ENGINEERING RESEARCH INSTITUTE, PILANI, RAJASTHAN, INDIA-333 031 Page 38
OUTPUT:
Minimum phase system
CENTRAL ELECTRONICS ENGINEERING RESEARCH INSTITUTE, PILANI, RAJASTHAN, INDIA-333 031 Page 39
CENTRAL ELECTRONICS ENGINEERING RESEARCH INSTITUTE, PILANI, RAJASTHAN, INDIA-333 031 Page 40
CODE:
test_4.m
% % %Lab Assignment-4
% % %Author:TAPAS KUMAR DASH
% % %Trainee Scientist,PGRPE-2014
% II.4 A causal IIR system is characterized by a constant
%coefficient difference equation given by
%
% Y(n) = x(n-1) 1.2 x(n-2) + x(n-3) + 1.3 y(n-1) 1.07 y(n-2) + 0.222 y(n3)
%
Find the location of poles zeros of this system.
%Using MATLAB plot magnitude, phase and group delay.
clc
close all
clear all
num=[0 1 -1.2 1];
den=[1 -1.3 1.07 -0.222];
h=filt(num,den);
zeroes=zero(h);
poles=pole(h);
k=1;
figure,frequency_response(zeroes,poles,k);
frequency_response.m
function [ y ] = frequency_response(Z,p,k)
%FREQUENCY_RESPONSE Summary of this function goes here
%Frequncy Response of a filter given poles and zeros
w=0:pi/100:2*pi;
z=exp(1i*w);
np=poly(Z);
dp=poly(p);
numer=polyval(np,z);
denom=polyval(dp,z);
h=k*(numer./denom);
theta=atan2(imag(h),real(h));
%pole zero plot
subplot(2,2,1),zplane(Z,p),grid,title('Pole-Zero plot');
CENTRAL ELECTRONICS ENGINEERING RESEARCH INSTITUTE, PILANI, RAJASTHAN, INDIA-333 031 Page 41
OUTPUT:
CENTRAL ELECTRONICS ENGINEERING RESEARCH INSTITUTE, PILANI, RAJASTHAN, INDIA-333 031 Page 42
The zero locations of FIR transfer functions of order 6 are sketched as shown in the figure.
a) Does any one of the FIR filters have a linear phase response? If so which one?
b) Does any one of the FIR filters have a minimum phase response? If so which one?
Comment:
system 1 is non-linear and non minimum phase
System 2 is linear and non minimum phase
System 3 is non-linear and non minimum phase
System 4 is non-linear and non minimum phase
CODE:
test_5.m
% % %Lab Assignment-4
% % %Author:TAPAS KUMAR DASH
% % %Trainee Scientist,PGRPE-2014
%check linear phase and minimum phase system
CENTRAL ELECTRONICS ENGINEERING RESEARCH INSTITUTE, PILANI, RAJASTHAN, INDIA-333 031 Page 43
CENTRAL ELECTRONICS ENGINEERING RESEARCH INSTITUTE, PILANI, RAJASTHAN, INDIA-333 031 Page 44
verify_linear_phase.m
function [res]=verify_linear_phase(zero)
%For linear phase, the response should always be symmetric
%or antisymmetric in time domain
%And we can observe linearity only for FIR filters
h=poly(zero);
flag=0;
N=length(h);
for i=1:N
if uint8(h(i)*10000)==uint8(h(N+1-i)*10000)
flag=flag+1;
end
end
if flag==N
res=1;
CENTRAL ELECTRONICS ENGINEERING RESEARCH INSTITUTE, PILANI, RAJASTHAN, INDIA-333 031 Page 45
verify_minimumphasesystem_pz.m
function [res] = verify_minimumphasesystem_pz(zero,pole)
pole_mag=abs(pole);
zero_mag=abs(zero);
if max(pole_mag)<1 && max(zero_mag)<1
res=1;
else
res=0;
end
end
OUTPUTS:
CENTRAL ELECTRONICS ENGINEERING RESEARCH INSTITUTE, PILANI, RAJASTHAN, INDIA-333 031 Page 46
z=
Solution:
a) The poles and zeros of Hmin (z) are inside the unit circle which are reciprocal
conjugates of poles and zeros of Hlin (z) which are magnitude of greater than 1.
b) The filter is TYPE-IV .An odd number of zeros at z=1 and either an even number or
no zeros at z=-1.
So
=
+ 1
a)
.8 4 1
+ 1
Find expressions for minimum phase system H1(z) and an all-pass system Hap(z), such that
H(z) = H1(z)Hap(z)
b)
Find expressions for a different minimum phase system H2(z) and a generalized linear phase
CODE:
test_7.m
% % %Lab Assignment-7
% % %Author:TAPAS KUMAR DASH
% % %Trainee Scientist,PGRPE-2014
%II.7
A causal LTI discrete time system has system function
%
H(Z) = ((1-0.5z-1)(1+4z-2))/(1-0.64z-2).
%find minimum phase,all pass and linear phase system
CENTRAL ELECTRONICS ENGINEERING RESEARCH INSTITUTE, PILANI, RAJASTHAN, INDIA-333 031 Page 47
compensation_system_design.m
function [ y ] = compensation_system_design( z,p,k )
%COMPENSATION_SYSTEM_DESIGN Summary of this function goes here
%Function to find Minimuam phase and All pass system for a given system
%H(z)=Hmin(z)*Hap(z)
%GIVEN SYSTEM Response
figure('Name','Given System'),frequency_response(z,p,k);
%Construction of MINIMUM PAHSE SYSTEM
z1=z;
for i=1:length(z)
if(abs(z(i))>1)
z1(i)=1/(conj(z(i)));
end
end
p1=p;
for j=1:length(p)
if(abs(p(j))>1)
p1(j)=1/conj(p(j));
end
end
figure('Name','Minimum Phase System'),frequency_response(z1,p1,k);
z3=p1;
p3=z1;
figure('Name','Inverse of Minimum Phase System(compensation
system)'),frequency_response(z3,p3,k);
%ALL PASS SYSTEM
q=1;
for k=1:length(z)
if(abs(z(k))>1)
z2(q,1)=z(k);
p2(q,1)=1/conj(z(k));
q=q+1;
end
end
r=q+1;
for l=1:length(p)
if(abs(p(l))>1)
p2(r,1)=p(l);
z2(r,l)=1/conj(p(l));
r=r+1;
end
end
CENTRAL ELECTRONICS ENGINEERING RESEARCH INSTITUTE, PILANI, RAJASTHAN, INDIA-333 031 Page 48
OUTPUT:
CENTRAL ELECTRONICS ENGINEERING RESEARCH INSTITUTE, PILANI, RAJASTHAN, INDIA-333 031 Page 49
CENTRAL ELECTRONICS ENGINEERING RESEARCH INSTITUTE, PILANI, RAJASTHAN, INDIA-333 031 Page 50
Solution:
CODE:
test_8.m
%Lab Assignment-8
%Author:TAPAS KUMAR DASH
%Trainee Scientist,PGRPE-2014
% Figure shows the pole-zero plots for three different causal LTI systems
% with real impulse responses. Indicate which of the following properties
% apply to each of the systems pictured: stable, IIR, FIR, minimum phase ,
clc
clear all
close all
CENTRAL ELECTRONICS ENGINEERING RESEARCH INSTITUTE, PILANI, RAJASTHAN, INDIA-333 031 Page 51
-1j; -0.707-
CENTRAL ELECTRONICS ENGINEERING RESEARCH INSTITUTE, PILANI, RAJASTHAN, INDIA-333 031 Page 52
CENTRAL ELECTRONICS ENGINEERING RESEARCH INSTITUTE, PILANI, RAJASTHAN, INDIA-333 031 Page 53
verify_allpass.m
function [res] = verify_allpass(zero,pole)
%If there are no poles then FIR
nz=length(zero);
np=length(pole);
zflag=0;
pflag=0;
for i=1:nz
for j=1:np
if pole(j)==1/conj(zero(i))
zflag=zflag+1;
break;
end
end
end
for i=1:np
for j=1:nz
if zero(j)==1/conj(pole(i))
pflag=pflag+1;
end
end
end
if zflag==nz && pflag==np
res=1;
else
res=0;
end
verify_iir_fir.m
function [res] = verify_iir_fir(zero,pole)
%If there are no poles then FIR
if max(abs(pole))==0
res=1;
%FIR
else
%IIR
res=0;
end
end
CENTRAL ELECTRONICS ENGINEERING RESEARCH INSTITUTE, PILANI, RAJASTHAN, INDIA-333 031 Page 54
verify_stability.m
function [res] =verify_stability(zero,pole)
%If all the poles are inside unit circle then system is stable
if max(abs(pole))<1
res=1; %Stable
else
res=0;
end
end
verify_minimumphasesystem_pz.m
function [res] = verify_minimumphasesystem_pz(zero,pole)
pole_mag=abs(pole);
zero_mag=abs(zero);
if max(pole_mag)<1 && max(zero_mag)<1
res=1;
else
res=0;
end
end
CENTRAL ELECTRONICS ENGINEERING RESEARCH INSTITUTE, PILANI, RAJASTHAN, INDIA-333 031 Page 55
Comment:
1st system is: unstable iir non-linear-phase non-minimum-phase non-all-pass
2nd system is: stable fir linear-phase minimum-phase non-all-pass
3rd system is: stable iir non-linear-phase non-minimum-phase all-pass
CENTRAL ELECTRONICS ENGINEERING RESEARCH INSTITUTE, PILANI, RAJASTHAN, INDIA-333 031 Page 56
CODE:
test_9.m
%Lab Assignment-9
%Author:TAPAS KUMAR DASH
%Trainee Scientist,PGRPE-2014
%
% The z-tranforms of five sequences of length 7 are given as:
%
H1(z) = 0.0083653-0.001782726z-1 -0.075506z-2 -0.3413956532z-3
+0.13529123z-4 -1.50627293z-5 + 3.3207295z-6,
%
H2(z) = 3.3207295-1.50627293z-1 + 0.13529123 z-2 + 0.34139565 z-3
0.07550603 z-4 0.001782725 z-5 + 0.0083652 z-6
%
H3(z) = 0.0269311 0.0840756z-1 +0.02580603 z-2 + 0.94049849 z-3 2.2508765z-4 + 2.53245711z5+ 1.03147943 z-6
%
H4(z) = 10.03147943 + 2.5324571 z-1 + 2.2508765 z-2 +0.94044985 z-3
+0.02580602 z-4
0.0840756 z-5 +0.02693111z-6
%
H5(z) = 0.16667 0.05556z-1 -0.75z-2 + 3.5z-3 -0.75z-4 -0.05556z-5
+0.16667z-6
%
%
The magnitude of the DFT for each of the above sequences is the same
%which one of the above z-transforms has all its zeros outside the unit
%circle? Which one has all its zeros inside the unit circle?
close all;
clear all;
clc
format long
b1=[0.0083653 0.001782726 0.075506 0.3413956532 0.13529123 1.50627293
3.3207295];
a1=1;
h1=filt(b1,a1);
figure(1),frequency_response(zero(h1),pole(h1),1);
b2=[3.3207295 -1.50627293 0.13529123 0.34139565 0.07550603 0.001782725
0.0083652];
a2=1;
h2=filt(b2,a2);
CENTRAL ELECTRONICS ENGINEERING RESEARCH INSTITUTE, PILANI, RAJASTHAN, INDIA-333 031 Page 57
frequency_response.m
function [ y ] = frequency_response(Z,p,k)
%FREQUENCY_RESPONSE Summary of this function goes here
%Frequncy Response of a filter given poles and zeros
w=0:pi/100:2*pi;
z=exp(1i*w);
np=poly(Z);
dp=poly(p);
numer=polyval(np,z);
denom=polyval(dp,z);
h=k*(numer./denom);
theta=atan2(imag(h),real(h));
%pole zero plot
subplot(2,2,1),zplane(Z,p),grid,title('Pole-Zero plot');
%magnitude plot
subplot(2,2,2),plot(w,20*log10(abs(h))),grid,title('Magnitude plot(dB)');
%Phase plot
subplot(2,2,3),plot(w,theta),grid,title('Phase plot');
%Group delay plot
[gd,w1]=grpdelay(np,dp,1024,'whole');
subplot(2,2,4),plot(w1,gd),grid,title('Group Delay plot');
end
CENTRAL ELECTRONICS ENGINEERING RESEARCH INSTITUTE, PILANI, RAJASTHAN, INDIA-333 031 Page 58
CENTRAL ELECTRONICS ENGINEERING RESEARCH INSTITUTE, PILANI, RAJASTHAN, INDIA-333 031 Page 59
CENTRAL ELECTRONICS ENGINEERING RESEARCH INSTITUTE, PILANI, RAJASTHAN, INDIA-333 031 Page 60
CONCLUSION:
1. Among all systems H1(z) has all it's zeros outside the unit circle and H2(z)
and H4(z) have all zeros inside the unit circle.
2. Frequency response for all 5 system were plotted.
CENTRAL ELECTRONICS ENGINEERING RESEARCH INSTITUTE, PILANI, RAJASTHAN, INDIA-333 031 Page 61
COMMENT:
and
Compensating system
Hc(z) =1/Hdmin(z).
G(z)=Hap(z).
CODE:
test_10.m
%Lab Assignment-10
%Author:TAPAS KUMAR DASH
%Trainee Scientist,PGRPE-2014
%The transfer function of a typical transmission channel is given by
%
H(z) = (z-0.3)(z^2 2z +2)/(z-0.9)(z-0.5)
%In order to correct for the magnitude distortion introduced by
CENTRAL ELECTRONICS ENGINEERING RESEARCH INSTITUTE, PILANI, RAJASTHAN, INDIA-333 031 Page 62
clc
clear all
close all
pole=[0.9 0.5];
zero=[0.3 1+i 1-i];
res=verify_minimumphasesystem_pz(zero,pole);
str='';
if res==1
str=strcat(str,'System is minimum-phase');
else
str=strcat(str,'System is non-minimum-phase');
end
disp(str);
compensation_system_design([0.3;1+i;1-i],[0.9;0.5],1);
frequency_response.m
function [ y ] = frequency_response(Z,p,k)
%FREQUENCY_RESPONSE Summary of this function goes here
%Frequncy Response of a filter given poles and zeros
w=0:pi/100:2*pi;
z=exp(1i*w);
np=poly(Z);
dp=poly(p);
numer=polyval(np,z);
denom=polyval(dp,z);
h=k*(numer./denom);
theta=atan2(imag(h),real(h));
%pole zero plot
subplot(2,2,1),zplane(Z,p),grid,title('Pole-Zero plot');
%magnitude plot
subplot(2,2,2),plot(w,20*log10(abs(h))),grid,title('Magnitude plot(dB)');
%Phase plot
subplot(2,2,3),plot(w,theta),grid,title('Phase plot');
%Group delay plot
[gd,w1]=grpdelay(np,dp,1024,'whole');
subplot(2,2,4),plot(w1,gd),grid,title('Group Delay plot');
end
verify_minimumphasesystem_pz.m
function [res] = verify_minimumphasesystem_pz(zero,pole)
CENTRAL ELECTRONICS ENGINEERING RESEARCH INSTITUTE, PILANI, RAJASTHAN, INDIA-333 031 Page 63
compensation_system_design.m
function [ y ] = compensation_system_design( z,p,k )
%COMPENSATION_SYSTEM_DESIGN Summary of this function goes here
%Function to find Minimuam phase and All pass system for a given system
%H(z)=Hmin(z)*Hap(z)
%GIVEN SYSTEM Response
figure('Name','Given System'),frequency_response(z,p,k);
%Construction of MINIMUM PAHSE SYSTEM
z1=z;
for i=1:length(z)
if(abs(z(i))>1)
z1(i)=1/(conj(z(i)));
end
end
p1=p;
for j=1:length(p)
if(abs(p(j))>1)
p1(j)=1/conj(p(j));
end
end
figure('Name','Minimum Phase System'),frequency_response(z1,p1,k);
z3=p1;
p3=z1;
figure('Name','Inverse of Minimum Phase System(compensation
system)'),frequency_response(z3,p3,k);
%ALL PASS SYSTEM
q=1;
for k=1:length(z)
if(abs(z(k))>1)
z2(q,1)=z(k);
p2(q,1)=1/conj(z(k));
q=q+1;
end
end
r=q+1;
for l=1:length(p)
if(abs(p(l))>1)
p2(r,1)=p(l);
z2(r,l)=1/conj(p(l));
CENTRAL ELECTRONICS ENGINEERING RESEARCH INSTITUTE, PILANI, RAJASTHAN, INDIA-333 031 Page 64
PLOTS:
CENTRAL ELECTRONICS ENGINEERING RESEARCH INSTITUTE, PILANI, RAJASTHAN, INDIA-333 031 Page 65
CENTRAL ELECTRONICS ENGINEERING RESEARCH INSTITUTE, PILANI, RAJASTHAN, INDIA-333 031 Page 66
Given System is a non-minimum phase system as all pole and zero are not
inside unit circle
2.
Minimum Phase system was found for the given system where all pole and
zero lies inside unit circle.
3.
4.
5.
Output of the entire system is all pass system whose frequency response is also
plotted.
CENTRAL ELECTRONICS ENGINEERING RESEARCH INSTITUTE, PILANI, RAJASTHAN, INDIA-333 031 Page 67
CODE:
test_11.m
%Lab Assignment-11
%Author:TAPAS KUMAR DASH
%Trainee Scientist,PGRPE-2014
%Check Minimum Phase,Construct minimum phase system if given system is not
%minimum phase,find unit sample responseof g[n] and h[n],find value of m
%for which sum 0f squares of g[n] > sum of squares of h[n]
%H(z) = (z+3)(z-2)/(z-0.25)(z+0.5)
clc
clear all
close all
pole=[0.25 -0.5];
zero=[-3 2];
res=verify_minimumphasesystem_pz(zero,pole);
str='';
if res==1
str=strcat(str,'System is minimum-phase');
else
str=strcat(str,'System is non-minimum-phase');
end
disp(str);
construct_minimumphase_system([-3;2],[0.25;-0.5],1);
[b a]=zp2tf([-3;2],[0.25;-0.5],1);
[h,t]=impz(b,a,5);
figure,stem(t,h,'.','b'),grid,title('impulse response of h[n]');
frequency_response.m
CENTRAL ELECTRONICS ENGINEERING RESEARCH INSTITUTE, PILANI, RAJASTHAN, INDIA-333 031 Page 68
verify_minimumphasesystem_pz.m
function [res] = verify_minimumphasesystem_pz(zero,pole)
pole_mag=abs(pole);
zero_mag=abs(zero);
if max(pole_mag)<1 && max(zero_mag)<1
res=1;
else
res=0;
end
end
construct_minimumphase_system.m
function [ y ] = construct_minimumphase_system(z,p,k )
%Function to find Minimuam phase and All pass system for a given system
%H(z)=Hmin(z)*Hap(z)
%GIVEN SYSTEM Response
figure('Name','Given System'),frequency_response(z,p,k);
%Impulse response of given system
[b a]=zp2tf(z,p,k);
[h,t]=impz(b,a,25);
%Construction of MINIMUM PAHSE SYSTEM
z1=z;
for i=1:length(z)
if(abs(z(i))>1)
z1(i)=1/(conj(z(i)));
end
CENTRAL ELECTRONICS ENGINEERING RESEARCH INSTITUTE, PILANI, RAJASTHAN, INDIA-333 031 Page 69
end
if n>f
m=1;
m=i;
end
end
sum_of_squre_g=sqg
sum_of_squre_h=sqh
m
str1='';
if m==0
str=strcat(str1,'there is no such m exist where squre sum g is greater
than square sum of h');
end
disp(str);
[g,t]=impz(b,a,5);
figure,stem(t,g,'.','b'),grid,title('impulse response of g[n]');
figure('Name','Minimum Phase System'),frequency_response(z1,p1,k);
CENTRAL ELECTRONICS ENGINEERING RESEARCH INSTITUTE, PILANI, RAJASTHAN, INDIA-333 031 Page 70
RESULT:
System is non-minimum-phase
sample_values_g =Columns 1 through 11
1.0000 -0.4167 0.0625 -0.0677 0.0247 -0.0146 0.0068 -0.0035 0.0017 -0.0009 0.0004
Columns 12 through 22
-0.0002
0.0001 -0.0001 0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000
Columns 23 through 25
0.0000 -0.0000 0.0000
sample_values_h =
Columns 1 through 11
1.0000 0.7500 -6.0625 1.6094 -1.1602
Columns 12 through 22
0.0081 -0.0041 0.0020 -0.0010 0.0005 -0.0003 0.0001 -0.0001 0.0000 -0.0000 0.0000
Columns 23 through 25
-0.0000
0.0000 -0.0000
sum_of_squre_g =1.1830
sum_of_squre_h = 42.5877
m=0
There is no such m exist where squre sum g is greater than square sum of h
CENTRAL ELECTRONICS ENGINEERING RESEARCH INSTITUTE, PILANI, RAJASTHAN, INDIA-333 031 Page 71
CENTRAL ELECTRONICS ENGINEERING RESEARCH INSTITUTE, PILANI, RAJASTHAN, INDIA-333 031 Page 72
CENTRAL ELECTRONICS ENGINEERING RESEARCH INSTITUTE, PILANI, RAJASTHAN, INDIA-333 031 Page 73
CONCLUSION:
1.
System is a non-minimum phase system as all pole and zero are not inside unit
circle
2.
Minimum Phase system was found for the given system where all pole and
zero lies inside unit circle.
3.
4.
Impulse response of g[n] and h[n] evaluated and plotted. Sum of their squares
were also calculated for comparison.
----------------------------------------------------------------END-------------------------------------------------------------
CENTRAL ELECTRONICS ENGINEERING RESEARCH INSTITUTE, PILANI, RAJASTHAN, INDIA-333 031 Page 74
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: