0% found this document useful (0 votes)
57 views

Experiment 2-Generation of Signals

This document contains code for generating and analyzing various signals including impulse, step, square wave, sawtooth, triangular and sine waves. It also contains code for performing operations on signals like multiplication, addition, time shifting. Further, it contains code for analyzing properties of linear time invariant (LTI) systems like superposition, time invariance. Code is also included for finding impulse response, step response, Fourier transform, autocorrelation and cross correlation of signals. Pole zero plots of transfer functions on s-plane and z-plane are also demonstrated.

Uploaded by

Bindu Madhavi
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
57 views

Experiment 2-Generation of Signals

This document contains code for generating and analyzing various signals including impulse, step, square wave, sawtooth, triangular and sine waves. It also contains code for performing operations on signals like multiplication, addition, time shifting. Further, it contains code for analyzing properties of linear time invariant (LTI) systems like superposition, time invariance. Code is also included for finding impulse response, step response, Fourier transform, autocorrelation and cross correlation of signals. Pole zero plots of transfer functions on s-plane and z-plane are also demonstrated.

Uploaded by

Bindu Madhavi
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 26

Experiment 2- Generation of signals

//Expt 2 Generation of impulse, step, squarewave, sawtooth, triangular


and sine waves
clf; //clear the figure
imp=zeros(1,100); //create a vector of 100 zeros
st=imp;
imp(1,5)=1; //make one of the values=1 to make it an impulse
st(1,5:100)=1; //make all the values from 5th position =1 making it to
be step function
a=[1 1 1 1 1 -1 -1 -1 -1 -1]; //create one cycle of square wave
sq=[a a a a a a a a a a]; repeat this to create multiple cycles
t=0:30; //create a set of ascending numbers from 0 to 30
t2=0:20; //create a set of ascending numbers from 0 to 20
t1=20-t2; //create a set of desscending numbers from 20 to 0
swt=[t t t]; // repeat set of ascending no.s to create sawtooth
tr=[t2 t1 t2 t1 t2 t1]; //repeat alternately ascending and descending
no.s to create triangular wave
sn=sin(0:0.1:10); // create sine wave
// plot all these signals created
subplot(321),plot2d3(1:100,imp,rect=[0,0,100,2]);xgrid(2);
subplot(322),plot2d(1:100,st,rect=[0,0,100,2]);xgrid(2);
subplot(323),plot2d(1:100,sq,rect=[0,-2,100,2]);xgrid(2);
subplot(324),plot2d(swt);xgrid(2);
subplot(325),plot2d(tr);xgrid(2);
subplot(326),plot2d(sn);xgrid(2);
Experiment 3- Operations on signals
//Arithmetic operations are valid on signals too...
clf;
imp=zeros(1,100);
st=imp;
imp(1,5)=1;
st(1,5:100)=1;
sq=squarewave(1:100);
t=1:10;
t1=10-t;
swt=[t t t t t t t t t t];
tr=[t t1 t t1 t t1 t t1 t t1];
sn=sin(0:0.1:10);
subplot(321),plot2d3(1:100,imp,rect=[0,0,100,2]);xtitle('Impulse');
subplot(322),plot2d(1:100,st,rect=[0,0,100,2]);xtitle('Step input');
subplot(323),plot2d(1:100,sq,rect=[0,-2,100,2]);xtitle('Square wave');
subplot(324),plot2d(swt);xtitle('Sawtooth');
subplot(325),plot2d(tr);xtitle('Triangular');
subplot(326),plot2d(sn);xtitle('Sine');
set("current_figure",1); //create another window to show the plots

sn_sw=sn(1,1:100).*sq; //element-wise multiplication of sine and


square wave
subplot(423),plot2d(sn_sw);xtitle('Multiplication');
sn1=sq+10*sn(1,1:100);
subplot(424),plot2d(sn1);xtitle('Addition');
sh_tr=[zeros(1,20),tr]; //pad 20 zeros before triangular signal to shift
the signal in time
subplot(425),plot2d(sh_tr);xtitle('Time-shifted');
sn2=zeros(1,101);
for i=1:50,
sn2(1,i)=sn(1,2*i+1); //compress the signal in time- down scaling
end;
fold_swt=swt(100:-1:1);
subplot(426),plot2d(sn2);xtitle('Time Scaled');
subplot(421),plot2d(sn);xtitle('Original sine');
subplot(422),plot2d(sq);xtitle('Square wave');
subplot(427),plot2d(fold_swt);xtitle('folded Sawtooth');
Experiment 4- Even & odd parts- real and imaginary parts of
signals
clf;
t=-10:0.1:10;
a=sin(t); // odd signal
b=cos(t); // even signal
c=a+b; // signal contains both odd and even parts f(t)
d=c(1,201:-1:1); //reverse the sequence f(-t)
e=c+d; // odd components cancel
f=c-d; // even components cancel
subplot(331),plot2d(a);
xtitle('Signal 1 (Odd)');
subplot(332),plot2d(b);xtitle('Signal 2 (even)');
subplot(333),plot2d(c);xtitle('Sum of 1 and 2');
subplot(334),plot2d(d);xtitle('Time inverted sum signal');
subplot(335),plot2d(e);xtitle('Even Component');
subplot(336),plot2d(f);xtitle('Odd component');
subplot(337),plot2d(clean(a-f/2));xtitle('Diff. of Odd signal and odd
component');
subplot(338),plot2d(clean(b-e/2));xtitle('Diff. of even signal and even
component');
y=rand(1,100)+%i*rand(1,100); //used to create the complex data. If
complex data is available, skip
//this step
yr=real(y); // get only the real part of the data
yi=imag(y); // get only the imaginary part of the data
set("current_figure",1); //create new window to show real and
imaginary parts of a signal
subplot(221),plot2d(x);xtitle('Input sequence');

subplot(222),plot2d(abs(y));xtitle('IFFT of x');
subplot(223),plot2d(yr);xtitle('Real Component');
subplot(224),plot2d(yi);xtitle('Imaginary Component');
Experiment 5- Convolution
clf;
t=0:.1:10;
x=sin(t)+sin(3*t)/3; //create a signal
//x=squarewave(1:10);
//h=[1 1 -1 1 -1 1 -1 1 -1 1 1 -1 1 -1 1];
//h=ones(1,60);
h=rand(1,60); //create a convolving function
//h=mtlb_repmat([1 -1],[1 20]);
y=convol(h,x);
subplot(311),plot2d3(x);xtitle('signal');xaxis(0,[2 2],[2 0.1 3],[-4 0]);
subplot(312),plot2d3(h);xtitle('window');
subplot(313),plot2d3(y);xtitle('Convolved result');
Experiment 6- Auto correlation and cross correlation
clc
t=0:0.1:10;
sn=.3*sin(%pi*t)+sin(4*%pi*t); //create an input signal
n=size(t,2);
// create different functions to study the effects of correlation
rn=rand(1,n); //random signal
sn1=-sn; // inverted form of input signal
sn2=.3*sin(%pi*t+%pi/4)+sin(4*%pi*t+%pi/4); // time-shifted input
signal
sn_ns=sn+.5*rn; //input signal with random noise
sn_smpl=sn_ns(1,3:22); // sample of input signal with noise
n1=size(sn_smpl,2);
cr1=0; // auto correlation of input
cr2=0; // auto correlation of noise
cr3=0; // cross correlation of input with noise
cr4=0; // cross correlation of input with its inverted form
cr5=0; // cross correlation of input with time-shifted input signal
for i=1:n,
cr1=cr1+sn(1,i)*sn(1,i);
cr2=cr2+rn(1,i)*rn(1,i);
cr3=cr3+sn(1,i)*rn(1,i);
cr4=cr4+sn(1,i)*sn1(1,i);
cr5=cr5+sn(1,i)*sn2(1,i);
end
cr_cor=zeros(1,n);
cr_cor1=cr_cor;
cr_cor2=cr_cor;
cr_cor3=cr_cor;
cr_cor4=cr_cor;

for i=1:n-n1,
for j=0:n1-1,
cr_cor(1,i)=cr_cor(1,i)+sn(1,i+j)*sn_smpl(1,j+1);
cr_cor1(1,i)=cr_cor1(1,i)+rn(1,i+j)*sn_smpl(1,j+1);
cr_cor2(1,i)=cr_cor2(1,i)+sn2(1,i+j)*sn_smpl(1,j+1);
cr_cor3(1,i)=cr_cor3(1,i)+sn1(1,i+j)*sn_smpl(1,j+1);
cr_cor4(1,i)=cr_cor4(1,i)+sn_ns(1,i+j)*sn_smpl(1,j+1);
end
end
clc
printf('\nCorrelation of sin with itself:\n');
cr1n=cr1/n
printf('\nCorrelation of random with itself:\n');
cr2n=cr2/n
printf('\nCorrelation of input with randomn:\n');
cr3n=cr3/n
printf('\nCorrelation of input with its inverted form:\n');
cr4n=cr4/n
printf('\nCorrelation of input with time_shifted input:\n');
cr5n=cr5/n
clf
subplot(431),plot(sn);
title('signal');
subplot(432),plot(rn);
title('random noise');
subplot(433),plot(sn1);
title('inverted signal');
subplot(434),plot(sn2);
title('time-shifted signal');
subplot(435),plot(sn_ns);
title('noisy signal')
subplot(436),plot(cr_cor);
title('autocorrelation of signal');
subplot(437),plot(cr_cor1);
title('correlation of signal with noise');
subplot(438),plot(cr_cor2);
title('correlation of signal with time-shifted signal');
subplot(439),plot(cr_cor3);
title('correlation of signal with inverted signal');
subplot(4,3,10),plot(cr_cor4);
title('correlation of signal with noisy signal');
Experiment 7- Linearity and time-invariance
//Testing LTI Properties Superposition Principle, Time Invariance
clf;
t=0:0.1:10;
x=sin(t)+sin(3*t)/3; //create an input signal

y=diff(x); //linear operation on input


[m,n]=size(x);
[m1,n1]=size(y);
p=20;
x1=zeros(m,n+p);
x1(1,p+1:n+p)=x; //create time-shifted input
y1=diff(x1);
y2=zeros(size(y1));
y2(1,p+1:n1+p)=y(1,1:n1);
subplot(321),plot2d3(x);xtitle('original');
subplot(322),plot2d3(x1);xtitle('shifted');
subplot(323),plot2d3(y);xtitle('original response');
subplot(324),plot2d3(y1);xtitle('shifted response');
subplot(325),plot2d3(y2);xtitle('original response shifted');
subplot(326),plot2d3(clean(y1-y2));xtitle('difference between shifted
response and response shifted');
xl1=sin(t); //create input 1
xl2=sin(3*t)/3; //create input2
xl=xl1+xl2; // sum of inputs
yl1=diff(xl1); // operate on input 1
yl2=diff(xl2); // operate on input 2
yl=yl1+yl2; // sum of operated inputs
yld=diff(xl); // operation on sum of inputs
set("current_figure",1);
clf;
subplot(421),plot2d3(xl1);xtitle('signal 1');
subplot(422),plot2d3(yl1);xtitle('output 1');
subplot(423),plot2d3(xl2);xtitle('signal 2');
subplot(424),plot2d3(yl2);xtitle('output 2');
subplot(427),plot2d3(xl);xtitle('signal 1+2');
subplot(426),plot2d3(yl);xtitle('output 1+ output 2');
subplot(428),plot2d3(yld);xtitle('output (1+2)');
Experiment 8- Response of LTI system
clf;
s=poly(0,'s');
t=0:0.05:5;
n=[0 0 1 1]; //coefficients of numerator polynomial
d=[1 0 2 2]; //coefficients of denominator polynomial
//create the transfer function of the system
h=syslin('c',(n(1,1)*s^3+n(1,2)*s^2+n(1,3)*s+n(1,4))/
((d(1,1)*s^3+d(1,2)*s^2+d(1,3)*s+d(1,4))));
y1=csim('step',t,h); // find the step response of the system
y2=csim('impuls',t,h); // find the impulse response of the system
subplot(311),plzr(h); // plot the pole-zero locations on the s-plane
subplot(312),plot2d(y1); xtitle('step response');
subplot(313),plot2d(y2); xtitle('impulse response');

Experiment 9- Gibb's Phenomenon


// In realizing the square wave from the N harmonics, as N increases,
the ripples in the partial sum
//becomes compressed towards the discontinuity
t=1:1000;
n=input('No of Harmonics:');
//y=zeros(1,1000);
y=10*ones(1,1000);
for i=1:2:n,
y=y+ 10*sin(2*%pi*i*t/1000)/i; // add odd harmonic to the partial sum
ysp=abs(fft(y)); // frequency spectrum of the partial sum
clf
subplot(2,1,1),plot(y);
subplot(2,1,2), plot2d3(ysp(1:50));
xclick(); //wait for the mouse click
end;
Experiment 10- Fourier transform of a signal
//Expt 10 Finding the Fourier transform of a given signal
mtlb_close all;
clf;
t=0:0.1:10;
nt=size(t,2);
sig=sin(t)+sin(3*t); //create an input signal
sin_ft=fft(sig); // find its Fourier transform
[phi,db]=phasemag(sin_ft); // seperate the magnitude and phase
informations
subplot(311),plot(sig);
subplot(312),plot2d(db); xgrid;
subplot(313),plot2d(phi); xgrid
Experiment 11- Waveform Synthesis using Laplace transform
Experiment 12- pole-zero plots on s- and z-plane
// Expt 12- Locating poles and zeros of the given transfer function
clear
mtlb_close all;
nz=input('No. of zeros:');
np=input('No. of poles:');
s=poly(0,'s');
if np>0, // make sure that minimum of one pole is required for any
physical system
hp=1;
hz=1;
for i=1:np,
pl(i)=input('Enter the position of pole:');
hp=hp*(s-pl(i)); // create the polynomial using each pole position
information
end;

h=1;
if nz>0,
for i=1:nz,
zr(i)=input('Enter position of zero:');
hz=hz*(s-zr(i)); // create the polynomial using each zero position
information, if any
end;
end;
h=real(hz)/real(hp); // create the transfer function
h1=syslin('c',h); // create the system
plzr(h1); // plot pole-zero positions on s-plane
xgrid;
else
disp('Minimum one pole is a must for any system...');
end;
Experiment 13- Gaussian noise
//Expt 13 Generation of Gaussian noise
mn=0; // set the value of mean
sig=2.5; // set the value of the variance
x=-10:0.1:10;
a=2.5; // set initial values of a, b and m to generate the pseudorandom sequence
b=-0.02;
m=5;
x1(1,1)=x(1,201); //initiate the first number of the sequence
for i=2:201, //pseudo random no. generation
x1(1,i)=modulo (a*x1(1,i-1)+b,m); // Linear Congruent pseudo random
number generator
end;
gsn=exp(-(x-mn)^2/(2*sig^2)); //Gaussian
subplot(221),plot(x,gsn);
gsn1=exp(-(x1-mn)^2/(2*sig^2)); // Linear Congruent pseudo random
Gaussian noise generator
subplot(222),plot(abs(gsn1));
mn1=mean(gsn1) // compute the mean of the sequence
v1=variance(gsn1) // compute the variance of the sequence
skw1=exp(-(gsn1-mn1)^3/v1^3); // compute the skew of the sequence
subplot(223),plot(abs(skw1));
krts1=exp(-(gsn1-mn1)^4/v2^4); // compute the Kurtosis of the
sequence
subplot(224),plot(abs(krts1));
y1=sum(skw1)
R1=sum(krts1)
Experiment 14- Sampling theorem
mtlb_close all;
clf;

t=0:0.1:10;
nt=size(t,2);
n=10;
fs=28; //sampling frequency
fm=3; //signal frequency
sn=sin(fm*t); //signal creation
sn_sp=fft(sn); // signal spectrum
sq=(1+squarewave(fs*t))/2; // sampling signal
sq_sp=fft(sq); // sampling signal spectrum
smpl=sn.*sq; // sampling of the signal
smpl_sp=fft(smpl); //spectrum of the sampled signal
sn1=smpl_sp;
sn1(n:nt-n)=0; // low-pass filtering
sn2=ifft(sn1); // time-domain of the filtered sampled signal
(Reconstructed signal)
subplot(4,2,2),plot(abs(sn_sp));xtitle('Input signal spectrum');
subplot(4,2,4),plot(abs(sq_sp));xtitle('Sampling signal spectrum');
subplot(4,2,6),plot(abs(smpl_sp));xtitle('Sampled Input signal
spectrum');
subplot(4,2,1),plot(sn);xtitle('Input Signal');
mtlb_axis([0 120 -2 2]);
subplot(4,2,3),plot(sq);xtitle('Sampling Signal');
mtlb_axis([0 120 -2 2]);
subplot(4,2,5),plot(smpl);xtitle('Sampled Input Signal');
mtlb_axis([0 120 -2 2]);
subplot(4,2,7), plot((sn2));xtitle('Reconstructed Signal');
subplot(4,2,8),plot(sn1);xtitle('Reconstructed Signal spectrum');
Experiment 15- Noise removal by correlation
// this program shows the use of correlation
// in removing noise from the signal
mtlb_close all;
clc;
clf;
t=0:.1:50;
nt=size(t,2);
sq=sin(4*t)+0.5*rand(1,nt); // signal with noise
sn1=rand(t); //random signal
sn=sn1(1,round(0.11*nt):round(0.14*nt)); // sample of random signal
smpl=sq(1,round(0.11*nt):round(0.14*nt)); // sample of input noisy
signal
n1=size(sn,2);
nn=n+2*(n1-1);
plot(sq);
set('current_figure',1);
plot(smpl);
cor=zeros(1,nt);

cor1=cor;
for i=1:nt-n1,
sm=0;
sm1=0;
for j=1:n1,
sm=sm+sq(i+j-1)*smpl(j); // correlation of input with its sample
sm1=sm1+sq(i+j-1)*sn(j); // correlation of input with sample of
random signal
end;
cor(i)=sm;
cor1(i)=sm1;
end;
set('current_figure',2);
subplot(211),plot(cor); xtitle('filtered signal');
subplot(212),plot(cor1);xtitle('filtered noise');
disp('peak to peak of filtered signal:');
mx1=max(cor)-min(cor)
disp('peak to peak of filtered noise:');
mx2=max(cor1)-min(cor1)
Experiment 16- Extraction of periodic signal from noisy signal
/ this program shows the use of correlation
// in extracting the signal
mtlb_close all;
clc;
clf;
t=0:.1:50;
nt=size(t,2);
sq=sin(4*t)+0.5*rand(1,nt); // signal with noise
sn1=rand(t);
sn=sn1(1,round(0.11*nt):round(0.14*nt)); //
smpl=sq(1,round(0.11*nt):round(0.14*nt)); // sample of input noisy
signal
n1=size(sn,2);
nn=n+2*(n1-1);
plot(sq);
set('current_figure',1);
plot(smpl);
cor=zeros(1,nt);
cor1=cor;
for i=1:nt-n1,
sm=0;
sm1=0;
for j=1:n1,
sm=sm+sq(i+j-1)*smpl(j);
sm1=sm1+sq(i+j-1)*sn(j);
end;

cor(i)=sm;
cor1(i)=sm1;
end;
set('current_figure',2);
subplot(211),plot(cor); xtitle('filtered signal');
subplot(212),plot(cor1);xtitle('filtered noise');
disp('peak to peak of filtered signal:');
mx1=max(cor)-min(cor)
disp('peak to peak of filtered noise:');
mx2=max(cor1)-min(cor1)
Experiment 17- Weiner-Khinchine relations
// Wiener-Khinchin theorem
// The power spectral density of wide-sense stationary process
// is the Fourier transform of the corresponding
// Auto-correlation fn.
clc;
clf;
t=0:0.1:10;
//x=squarewave(2*t);
x=rand(1,101);
y=sin(t);
sm1=cspect(100,100,'tr',x);
sm2=cspect(100,100,'tr',y);
sm3=cspect(100,100,'tr',x,y);
subplot(321),plot(sm1);xtitle('random signal');
subplot(322),plot(sm2);xtitle('sine signal');
subplot(323),plot(sm3);xtitle('cross-correlation');
[cov,mn]=corr(x,101);
subplot(324),bar(cov);xtitle('Auto-correlation');
sm4=fft(cov);
sm4m=abs(sm4);
subplot(325),plot(2*t,sm4m,'r',t,sm1(1,1:101),'b')
xtitle('ft of auto-correlation-red power spectral density blue');
Experiment 18- Random process stationarity checking
// Expt 18 Wide-sense stationarity checking of stationary process
// means at different times remain same m(t1)=m(t2)
//variances measured between two intervals depends only on the
difference between the intervals and
// not on the interval itself v(t1)-v(t2)=v(t1+)-v(t2+)
clc
x=rand(1,500); //random signal output of a random process
mx=mean(x) //mean of this whole sequence
// sample creation around different instants
x1=x(1,26:50);
x2=x(1,76:100);
x3=x(1,126:150);

x4=x(1,226:250);
m1=mean(x1) // mean of
m2=mean(x2) // mean of
m3=mean(x3) // mean of
m4=mean(x4) // mean of
v12=variance([m1 m2])
v13=variance([m1 m3])
v14=variance([m1 m4])
v34=variance([m3 m4])
0 10 20 30 40 50 60 70 80 90 100
0.0
0.2
0.4
0.6
0.8
1.0
1.2
1.4
1.6
1.8
2.0
Impulse
0 10 20 30 40 50 60 70 80 90 100
0.0
0.2
0.4
0.6
0.8
1.0
1.2
1.4
1.6
1.8
2.0
Step input
0 10 20 30 40 50 60 70 80 90 100
2.0
1.5
1.0
0.5
0.0
0.5
1.0
1.5
2.0
Square wave
0 10 20 30 40 50 60 70 80 90 100
1
2
3
4
5
6
7

samples
samples
samples
samples

around
around
around
around

t1
t2
t3
t4

8
9
10
Sawtooth
0 10 20 30 40 50 60 70 80 90 100
0123456789
10
Triangular
0 10 20 30 40 50 60 70 80 90 100 110
1.0
0.8
0.6
0.4
0.2
0.0
0.2
0.4
0.6
0.8
1.0
Sine
0 10 20 30 40 50 60 70 80 90 100
1.0
0.8
0.6
0.4
0.2
0.0
0.2
0.4
0.6
0.8
1.0
Multiplication
0 10 20 30 40 50 60 70 80 90 100
15
10
5
0
5
10
15
Addition
0 20 40 60 80 100 120
0123456789
10
Timeshifted
0 10 20 30 40 50 60 70 80 90 100 110
1.0
0.8
0.6
0.4
0.2
0.0
0.2
0.4

0.6
0.8
1.0
Time Scaled
0 10 20 30 40 50 60 70 80 90 100 110
1.0
0.8
0.6
0.4
0.2
0.0
0.2
0.4
0.6
0.8
1.0
Original sine
0 10 20 30 40 50 60 70 80 90 100
1.0
0.8
0.6
0.4
0.2
0.0
0.2
0.4
0.6
0.8
1.0
Square wave
0 10 20 30 40 50 60 70 80 90 100
123456789
10
folded Sawtooth
0 20 40 60 80100120140160180200220
1.0
0.8
0.6
0.4
0.2
0.0
0.2
0.4
0.6
0.8
1.0
Signal 1 (Odd)
0 20 40 60 80100120140160180200220
1.0
0.8
0.6
0.4
0.2
0.0
0.2
0.4

0.6
0.8
1.0
Signal 2 (even)
0 20 40 60 80100120140160180200220
1.5
1.0
0.5
0.0
0.5
1.0
1.5
Sum of 1 and 2
0 20 40 60 80100120140160180200220
1.5
1.0
0.5
0.0
0.5
1.0
1.5
Time inverted sum signal
0 20 40 60 80100120140160180200220
2.0
1.5
1.0
0.5
0.0
0.5
1.0
1.5
2.0
Even Component
0 20 40 60 80100120140160180200220
2.0
1.5
1.0
0.5
0.0
0.5
1.0
1.5
2.0
Odd component
0 20 40 60 80100120140160180200220
1.0
0.8
0.6
0.4
0.2
0.0
0.2
0.4
0.6
0.8
1.0

Diff. of Odd signal and odd component


0 20 40 60 80100120140160180200220
1.0
0.8
0.6
0.4
0.2
0.0
0.2
0.4
0.6
0.8
1.0
Diff. of even signal and even component
0 10 20 30 40 50 60 70 80 90 100
0.0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1.0
Input sequence
0 10 20 30 40 50 60 70 80 90 100
0.00
0.05
0.10
0.15
0.20
0.25
0.30
0.35
0.40
0.45
0.50
IFFT of x
0 10 20 30 40 50 60 70 80 90 100
0.1
0.0
0.1
0.2
0.3
0.4
0.5
Real Component
0 10 20 30 40 50 60 70 80 90 100
0.08
0.06
0.04
0.02
0.00
0.02

0.04
0.06
0.08
Imaginary Component
0 10 20 30 40 50 60 70 80 90100110
1.5
1.0
0.5
0.0
0.5
1.0
1.5
signal
0 10 20 30 40 50 60 70 80 90100110
0.0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1.0
random noise
0 10 20 30 40 50 60 70 80 90100110
1.5
1.0
0.5
0.0
0.5
1.0
1.5
inverted signal
0 10 20 30 40 50 60 70 80 90100110
1.5
1.0
0.5
0.0
0.5
1.0
1.5
timeshifted signal
0 10 20 30 40 50 60 70 80 90100110
1.5
1.0
0.5
0.0
0.5
1.0
1.5
2.0
noisy signal
0 10 20 30 40 50 60 70 80 90100110
10

5
0
5
10
15
autocorrelation of signal
0 10 20 30 40 50 60 70 80 90100110
0.0
0.5
1.0
1.5
2.0
2.5
3.0
3.5
4.0
correlation of signal with noise
0 10 20 30 40 50 60 70 80 90100110
15
10
5
0
5
10
correlation of signal with timeshifted signal
0 10 20 30 40 50 60 70 80 90100110
15
10
5
0
5
10
correlation of signal with inverted signal
0 10 20 30 40 50 60 70 80 90100110
10
5
0
5
10
15
correlation of signal with noisy signal
0 10 20 30 40 50 60 70 80 90 100 110
1.0
0.8
0.6
0.4
0.2
0.0
0.2
0.4
0.6
0.8
1.0
original
0 20 40 60 80 100 120 140
1.0

0.8
0.6
0.4
0.2
0.0
0.2
0.4
0.6
0.8
1.0
shifted
0 10 20 30 40 50 60 70 80 90 100
0.20
0.15
0.10
0.05
0.00
0.05
0.10
0.15
0.20
original response
0 20 40 60 80 100 120
0.20
0.15
0.10
0.05
0.00
0.05
0.10
0.15
0.20
shifted response
0 20 40 60 80 100 120
0.20
0.15
0.10
0.05
0.00
0.05
0.10
0.15
0.20
original response shifted
0 20 40 60 80 100 120
1.0
0.8
0.6
0.4
0.2
0.0
0.2
0.4
0.6
0.8
1.0

difference between shifted response and response shifted


0 10 20 30 40 50 60 70 80 90 100 110
1.0
0.8
0.6
0.4
0.2
0.0
0.2
0.4
0.6
0.8
1.0
signal 1
0 10 20 30 40 50 60 70 80 90 100
0.10
0.08
0.06
0.04
0.02
0.00
0.02
0.04
0.06
0.08
0.10
output 1
0 10 20 30 40 50 60 70 80 90 100 110
0.4
0.3
0.2
0.1
0.0
0.1
0.2
0.3
0.4
signal 2
0 10 20 30 40 50 60 70 80 90 100
0.10
0.08
0.06
0.04
0.02
0.00
0.02
0.04
0.06
0.08
0.10
output 2
0 10 20 30 40 50 60 70 80 90 100 110
1.0
0.8
0.6
0.4

0.2
0.0
0.2
0.4
0.6
0.8
1.0
signal 1+2
0 10 20 30 40 50 60 70 80 90 100
0.20
0.15
0.10
0.05
0.00
0.05
0.10
0.15
0.20
output 1+ output 2
0 10 20 30 40 50 60 70 80 90 100
0.20
0.15
0.10
0.05
0.00
0.05
0.10
0.15
0.20
output (1+2)
2.0 ZPeorleo1s.5

1.0 0.5 0.0 0.5 1.0 1.5


1.5
1.0
0.5
0.0
0.5
1.0
1.5
transmission zeros and poles
real axis
imag. axis
0 100 200 300 400 500 600 700 800 900 1000 1100
0.0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1.0
0 100 200 300 400 500 600 700 800 900 1000 1100
1.0
0.8

0.6
0.4
0.2
0.0
0.2
0 100 200 300 400 500 600 700 800 900 1000
0
2
4
6
8
10
12
14
16
18
20
0 5 10 15 20 25 30 35 40 45 50
0
1000
2000
3000
4000
5000
6000
7000
8000
9000
10000
0 100 200 300 400 500 600 700 800 900 1000
0
2
4
6
8
10
12
14
16
18
20
0 5 10 15 20 25 30 35 40 45 50
0
1000
2000
3000
4000
5000
6000
7000
8000
9000
10000
0 100 200 300 400 500 600 700 800 900 1000
0
2

4
6
8
10
12
14
16
18
20
0 5 10 15 20 25 30 35 40 45 50
0
1000
2000
3000
4000
5000
6000
7000
8000
9000
10000
0 10 20 30 40 50 60 70 80 90 100 110
2.0
1.5
1.0
0.5
0.0
0.5
1.0
1.5
2.0
0 10 20 30 40 50 60 70 80 90 100 110
5
0
5
10
15
20
25
30
35
0 10 20 30 40 50 60 70 80 90 100 110
800
700
600
500
400
300
200
100
0
100
ZPeorleos

2.5 2.0 1.5 1.0 0.5 0.0 0.5 1.0 1.5


1.5
1.0

0.5
0.0
0.5
1.0
1.5
transmission zeros and poles
real axis
imag. axis
10 8 6 4 2 0 2 4 6 8 10
0.0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1.0
0 20 40 60 80 100 120 140 160 180 200 220
0.0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1.0
0 20 40 60 80 100 120 140 160 180 200 220
0e+000
1e+212
2e+212
3e+212
4e+212
5e+212
6e+212
7e+212
8e+212
0 20 40 60 80 100 120 140 160 180 200 220
0.0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1.0
0 10 20 30 40 50 60 70 80 90 100 110
05

10
15
20
25
30
35
40
45
50
Input signal spectrum
0 10 20 30 40 50 60 70 80 90 100 110
0
10
20
30
40
50
60
Sampling signal spectrum
0 10 20 30 40 50 60 70 80 90 100 110
0
5
10
15
20
25
Sampled Input signal spectrum
0 20 40 60 80 100 120
2.0
1.5
1.0
0.5
0.0
0.5
1.0
1.5
2.0
Input Signal
0 20 40 60 80 100 120
2.0
1.5
1.0
0.5
0.0
0.5
1.0
1.5
2.0
Sampling Signal
0 20 40 60 80 100 120
2.0
1.5
1.0
0.5
0.0
0.5

1.0
1.5
2.0
Sampled Input Signal
0 10 20 30 40 50 60 70 80 90 100 110
0.6
0.4
0.2
0.0
0.2
0.4
0.6
0.8
Reconstructed Signal
0 10 20 30 40 50 60 70 80 90 100 110
0
5
10
15
20
25
Reconstructed Signal spectrum
0 50 100 150 200 250 300 350 400 450 500 550
1.0
0.5
0.0
0.5
1.0
1.5
0 5 10 15 20 25 30 35 40 45
1.0
0.5
0.0
0.5
1.0
1.5
0 50 100 150 200 250 300 350 400 450 500 550
20
15
10
5
0
5
10
15
20
25
filtered signal
0 50 100 150 200 250 300 350 400 450 500 550
0
1
2
3
4
5
6

7
filtered noise
0 20 40 60 80 100 120 140 160 180 200
0.00
0.05
0.10
0.15
0.20
0.25
random signal
0 20 40 60 80 100 120 140 160 180 200
0
5
10
15
sine signal
0 20 40 60 80 100 120 140 160 180 200
0.00
0.05
0.10
0.15
0.20
0.25
0.30
crosscorrelation
12345678191101121314151617282920212232425262738393031323343536374849404142434
45464758595051525354556576869606162636465667879707727374757677889808182838485
8687989909192939495916917809001
0.02
0.01
0.00
0.01
0.02
0.03
0.04
0.05
0.06
0.07
Autocorrelation
0 2 4 6 8 10 12 14 16 18 20
0.00
0.05
0.10
0.15
0.20
0.25
ft of autocorrelationred power psectral density blue
ft
psd

You might also like