SlideShare a Scribd company logo
1 of 73
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING
        Siddharth Institute of Engineering and Technology
          (Affiliated to J.N.T.UNIVERSITY, ANANTAPUR)
                       Narayanavanam, puttur, AP.




II YEAR BTECH I SEMESTER

 BASIC SIMULATION LAB                                       MANUAL




  PREPARED BY:
VERIFIED BY:




                         LIST OF EXPERIMENTS
   S.No                     Name of the Experiment
          Basic operations on matrices.
    1.
          Generation on various signals and Sequences (periodic and a
          periodic), such as unit impulse, unit step, square, saw tooth,
    2.
          triangular, sinusoidal, ramp, sinc.

          Operations on signals and sequences such as addition,
          multiplication, scaling, shifting, folding, computation of
    3.
          energy and average power.

          Finding the even and odd parts of signal/sequence and real
    4.    and imaginary part of signal.
5.    Convolution between signals and sequences
      Auto correlation and cross correlation between signals and
6.    sequences.

      Verification of linearity and time invariance properties of a
7.    given continuous /discrete system.

      Computation of unit sample, unit step and sinusoidal
      response of the given LTI system and verifying its physical
8.
      Reliability and stability properties.

      Gibbs phenomenon.
9.

      Finding the Fourier transform of a given signal and plotting
10.
         its magnitude and phase spectrum

11. Waveform synthesis using Laplace Transform.

    Locating the zeros and poles and plotting the pole zero maps
12. in s8plane and z8plane for the given transfer function.

    Generation of Gaussian Noise (real and
    complex),computation of its mean, M.S. Value and its skew,
13.
    kurtosis, and PSD, probability distribution function.


14. Sampling theorem verification.

15. Removal of noise by auto correlation/cross correlation.

      Extraction of periodic signal masked by noise using
16.
      correlation.

17. Verification of Weiner8Khinchine relations.


18. Checking a random process for stationary in wide sense.




                                  1
EXP.NO:
1
BASIC OPERATIONS ON MATRICES


Aim: To generate matrix and perform basic operation on matrices Using
MATLAB Software.
EQUIPMENTS:
PC with windows (95/98/XP/NT/2000).
MATLAB Software

CONCLUSION:

EXP.NO: 2

   GENERATION OF VARIOUS SIGNALS AND SEQUENCES (PERIODIC
       AND APERIODIC), SUCH AS UNIT IMPULSE, UNIT STEP,
         SQUARE, SAWTOOTH, TRIANGULAR, SINUSOIDAL, RAMP,
                            SINC.


Aim: To generate different types of signals Using MATLAB Software.
EQUIPMENTS:
PC with windows
(95/98/XP/NT/2000).
MATLAB Software




Matlab program:

%unit impulse
generation clc
close all
n1=-3;
n2=4;
n0=0;
n=[n1:n
2];
x=[(n-n0)==0]
stem(n,x)




% unit step
generation n1=-4;
n2=5;
n0=0;
9
[y,n]=stepseq(n0,n1,n2);
stem(n,y); xlabel('n') ylabel('amplitude'); title('unit step');
% square wave wave
generator fs = 1000;
t = 0:1/fs:1.5;
x1 = sawtooth(2*pi*50*t); x2 =
square(2*pi*50*t);
subplot(2,2,1),plot(t,x1), axis([0 0.2 -1.2
1.2])
xlabel('Time (sec)');ylabel('Amplitude'); title('Sawtooth Periodic Wave')
subplot(2,2,2),plot(t,x2), axis([0 0.2 -1.2 1.2])
xlabel('Time (sec)');ylabel('Amplitude'); title('Square Periodic Wave');
subplot(2,2,3),stem(t,x2), axis([0 0.1 -1.2 1.2])
xlabel('Time (sec)');ylabel('Amplitude');


% sawtooth wave
generator fs = 10000;
t = 0:1/fs:1.5;
x = sawtooth(2*pi*50*t);
subplot(1,2,1);
plot(t,x), axis([0 0.2 -1
1]);
xlabel('t'),ylabel('x(t)')
title('sawtooth signal');
N=2; fs = 500;n =
0:1/fs:2; x =
sawtooth(2*pi*50*n);
subplot(1,2,2);
stem(n,x), axis([0 0.2 -1
1]);
xlabel('n'),ylabel('x(n)')
title('sawtooth
sequence');

To generate a trianguular pulse
A=2; t = 0:0.0005:1;
x=A*sawtooth(2*pi*5*t,0.25); %5 Hertz wave with duty cycle 25%
plot(t,x);
grid
axis([0 1 -3 3]);


%%To generate a trianguular
pulse fs = 10000;t = -1:1/fs:1;
x1 = tripuls(t,20e-3); x2 = rectpuls(t,20e-3);
subplot(211),plot(t,x1), axis([-0.1 0.1 -0.2 1.2])
xlabel('Time (sec)');ylabel('Amplitude'); title('Triangular Aperiodic Pulse')
subplot(212),plot(t,x2), axis([-0.1 0.1 -0.2 1.2])
xlabel('Time (sec)');ylabel('Amplitude'); title('Rectangular Aperiodic Pulse')
set(gcf,'Color',[1 1 1]),




%%To generate a rectangular pulse
t=-5:0.01:5;
pulse = rectpuls(t,2); %pulse of width 2 time units
plot(t,pulse)
axis([-5 5 -1 2]);
grid
% sinusoidal signal
N=64; % Define Number of samples
n=0:N-1; % Define vector
n=0,1,2,3,...62,63 f=1000; % Define
the frequency
fs=8000; % Define the sampling
frequency x=sin(2*pi*(f/fs)*n); %
Generate x(t) plot(n,x); % Plot x(t) vs.
t
title('Sinewave [f=1KHz,
fs=8KHz]'); xlabel('Sample
Number'); ylabel('Amplitude');




% RAMP
clc
close all
n=input('enter the length of ramp');
t=0:n; plot(t); xlabel('t');
ylabel('amplitude');
title ('ramp')
% sinc
x = linspace(-5,5); y =
sinc(x);
subplot(1,2,1);plot(x,y
) xlabel(‘time’);
ylabel(‘amplitude’);
title(‘sinc function’);
subplot(1,2,2);stem(x,
y); xlabel(‘time’);
ylabel(‘amplitude’);
title(‘sinc function’);
CONCLUSION:
EXP.NO: 3

  OPERATIONS ON SIGNALS AND SEQUENCES SUCH AS ADDITION,
        MULTIPLICATION, SCALING, SHIFTING, FOLDING,
        COMPUTATION OF ENERGY AND AVERAGE POWER

Aim: To perform arithmetic operations different types of signals Using
MATLAB Software.
EQUIPMENTS:
PC with windows
(95/98/XP/NT/2000).
MATLAB Softwar
%plot the 2 Hz sine wave in the top panel
 t = [0:.01:1];         % independent (time) variable
 A = 8;                % amplitude
f1 = 2;               % create a 2 Hz sine wave lasting
 1 sec s1 = A*sin(2*pi*f1*t);
f2 = 6;               % create a 4 Hz sine wave lasting
1 sec s2 = A*sin(2*pi*f2*t);
figure subplot(4,1,1) plot(t, s1)
title('1 Hz sine wave')
ylabel('Amplitude')
%plot the 4 Hz sine wave in the middle panel subplot(4,1,2)
plot(t, s2)
title('2 Hz sine wave')
ylabel('Amplitude')
%plot the summed sine waves in the bottom panel subplot(4,1,3)
plot(t, s1+s2) title('Summed sine waves') ylabel('Amplitude') xlabel('Time (s)')
xmult=s1.*s2;
subplot(4,1,4); plot(xmult); title('multiplication'); ylabel('Amplitude') xlabel('Time (s)')
%signal folding clc; clear all t=0:0.1:10; x=0.5*t; lx=length(x); nx=0:lx-1;
xf=fliplr(x);
nf=-fliplr(nx); subplot(2,1,1); stem(nx,x); xlabel('nx'); ylabel('x(nx)');
title('original signal'); subplot(2,1,2); stem(nf,xf); xlabel('nf'); ylabel('xf(nf)');
title('folded signal');


                                            23
%plot the 2 Hz sine wave scalling

t = [0:.01:1];        % independent (time) variable
 A = 8;               % amplitude
f1 = 2;             % create a 2 Hz sine wave
lasting 1 sec s1 = A*sin(2*pi*f1*t);
subplot(3,2,1) plot(s1); xlabel('t');
ylabel('amplitude'); s2=2*s1; subplot(3,2,2) plot(s2);
xlabel('t');
ylabel('amplitude');
s3=s1/2; subplot(3,2,3) plot(s3); xlabel('t');
ylabel('amplitude'); subplot(3,2,4) stem(s1);
xlabel('t'); ylabel('amplitude'); s2=2*s1; subplot(3,2,5) stem(s2);
xlabel('t'); ylabel('amplitude'); s3=s1/2; subplot(3,2,6) stem(s3);
xlabel('t');
ylabel('amplitude
');




Excersize questions: Sketch the following questions using MATLAB


   1. x(t)= u(-t+1)
2.    x(t)=3r(t-1)
   3.    x(t)=U(n+2-u(n-3)
   4.    x(n)=x1(n)+x2(n)where x1(n)={1,3,2,1},x2(n)={1,-2,3,2}
   5.    x(t)=r(t)-2r(t-1)+r(t-2)
   6.    x(n)=2δ(n+2)-2δ(n-4), -5≤ n ≥5.
   7.    X(n)={1,2,3,4,5,6,7,6,5,4,2,1} determine and plot the following
        sequence a. x1(n)=2x(n-5-3x(n+4))
        b. x2(n)=x(3-n)+x(n)x(n-
                     2)

CONCLUSION: Inthis experiment the various oprations on signals
have been performedUsing MATLAB have been demonstrated.
EXP.NO: 4

 FINDING THE EVEN AND ODD PARTS OF SIGNAL/SEQUENCE AND
           REAL AND IMAGINARY PART OF SIGNAL

Aim: program for finding even and odd parts of signals Using MATLAB
Software.
EQUIPMENTS:
PC with windows
(95/98/XP/NT/2000). MATLAB
Software


%even and odd signals program:

t=-4:1:4;
 h=[ 2 1 1 2 0 1 2 2 3 ];
 subplot(3,2,1)
 stem(t,h);
 xlabel('time'); ylabel('amplitude');
 title('signal');
  n=9;
for i=1:9 x1(i)=h(n); n=n-1;
end subplot(3,2,2)
stem(t,x1);
xlabel('time'); ylabel('amplitude');
title('folded
signal'); z=h+x1
subplot(3,2,3);
stem(t,z);
 xlabel('time');
ylabel('amplitude'); title('sum
of two signal'); subplot(3,2,4);
stem(t,z/2);
xlabel('time'); ylabel('amplitude');
title('even
 signal'); a=h-
 x1;
 subplot(3,2,5);
 stem(t,a);
 xlabel('time'); ylabel('amplitude');
title('difference of two signal');
 subplot(3,2,6);
stem(t,a/2);
xlabel('time'); ylabel('amplitude');
title('odd signal');
% energy clc;
close all; clear all; x=[1,2,3]; n=3
e=0;
for i=1:n;
  e=e+(x(i).*x(i));
end

% energy clc;
close all; clear all; N=2 x=ones(1,N) for i=1:N
  y(i)=(1/3)^i.*x(i);
end n=N;
  e=0;
for i=1:n;
  e=e+(y(i).*y(i));
end
%
power
clc;
close all;
clear all;
N=2
x=ones(1,
N) for
i=1:N
   y(i)=(1/3)^i.*x(i);
end
n=
N;
e=0
;
for i=1:n;
  e=e+(y(i).*y(i))
          ;
end
 p=e/(2*N+
 1);


% power
N=input('type a value for
N'); t=-N:0.0001:N;
x=cos(2*pi*50*t).^2;
disp('the calculated power p of the
signal is'); P=sum(abs(x).^2)/length(x)
plot(t,x);
axis([0 0.1 0 1]);
disp('the theoretical power of the
signal is'); P_theory=3/8


CONCLUSION:
EXP.NO:
5                            LINEAR CONVOLUTION

Aim: To find the out put with linear convolution operation Using MATLAB
Software.
EQUIPMENTS:
PC with windows
(95/98/XP/NT/2000). MATLAB
Software


Program:
clc;
close all;
clear all;
x=input('enter input
sequence'); h=input('enter
impulse response');
y=conv(x,h);
subplot(3,1,1);
stem(x);
xlabel('n');ylabel('x(n)'
); title('input signal')
subplot(3,1,2);
stem(h);
xlabel('n');ylabel('h(n)'
); title('impulse
response')
subplot(3,1,3);
stem(y);
xlabel('n');ylabel('y(n)')
; title('linear
convolution')
disp('The resultant signal is');
disp(y)


linear convolution
output:
enter input sequence[1 4 3
2] enter impulse response[1
0 2 1] The resultant signal
is
   1 4 5 11 10 7 2
CONCLUSION:
EXP.NO: 6

6. AUTO CORRELATION AND CROSS CORRELATION BETWEEN
SIGNALS AND SEQUENCES.
………………………………………………………………………………………………
Aim: To compute auto correlation and cross correlation between signals and
sequences
EQUIPMENTS:
      PC with windows
      (95/98/XP/NT/2000). MATLAB
      Software

% Cross
Correlation clc;
close all;
clear all;
x=input('enter input sequence');
h=input('enter the impulse suquence');
subplot(3,1,
1); stem(x);
xlabel('n');
ylabel('x(n)');
title('input signal');
subplot(3,1,
2); stem(h);
xlabel('n');
ylabel('h(n)');
title('impulse
signal');
y=xcorr(x,h);
subplot(3,1,3);
stem(y);
xlabel('n');
ylabel('y(n)');
disp('the resultant signal is');
disp(y);
title('correlation signal');
% auto
correlation clc;
close all;
clear all;
x = [1,2,3,4,5]; y = [4,1,5,2,6];
subplot(3,1,
1); stem(x);
xlabel('n');
ylabel('x(n)');
title('input
signal');
subplot(3,1,2);
stem(y);
xlabel('n');
ylabel('y(n)');
title('input
signal');
z=xcorr(x,x);
subplot(3,1,3);
stem(z);
xlabel('n');
ylabel('z(n)');
title('resultant signal signal');
CONCLUSION: In this experiment correlation of various signals
have been performed Using MATLAB

Applications:it is used to measure the degree to which the two signals are
similar and it is also used for radar detection by estimating the time delay.it
is also used in Digital communication, defence applications and sound
navigation

Excersize questions: perform convolution between the following signals
   1. X(n)=[1 -1 4 ], h(n) = [ -1 2 -3 1]
   2. perform convolution between the. Two periodic
       sequences x1(t)=e-3t{u(t)-u(t-2)} , x2(t)= e -3t
       for 0 ≤ t ≤ 2
EXP.NO: 7

 VERIFICATION OF LINEARITY AND TIME INVARIANCE PROPERTIES OF A
GIVEN CONTINUOUS /DISCRETE SYSTEM.


Aim: To compute linearity and time invariance properties of a given continuous
/discrete system

EQUIPMENTS:

PC with windows (95/98/XP/NT/2000).
MATLAB Software


Program1:
clc;
clear all;
close all;
n=0:40; a=2; b=1;
x1=cos(2*pi*0.1*n);
x2=cos(2*pi*0.4*n);
x=a*x1+b*x2; y=n.*x;
y1=n.*x1;
y2=n.*x2;
yt=a*y1+b*y2;
d=y-yt;
d=round(
d) if d
  disp('Given system is not satisfy linearity property');
else
  disp('Given system is satisfy linearity property');
end
subplot(3,1,1), stem(n,y);
grid subplot(3,1,2),
stem(n,yt); grid
subplot(3,1,3), stem(n,d);
grid




Program2:

clc;
clear all;
close all;
n=0:40; a=2; b=-
3;
x1=cos(2*pi*0.1*n)
;
x2=cos(2*pi*0.4*n)
; x=a*x1+b*x2;
y=x.^2;
y1=x1.^2;
y2=x2.^2;
yt=a*y1+b*y2
;
d=y-yt;
d=round(d
); if d
   disp('Given system is not satisfy linearity property');
else
   disp('Given system is satisfy linearity property');
end
subplot(3,1,1), stem(n,y); grid
subplot(3,1,2), stem(n,yt); grid
subplot(3,1,3), stem(n,d); grid




Program
clc;
close all;
clear all;
x=input('enter the sequence');
N=length(x);
n=0:1:N-1;
y=xcorr(x,x);
subplot(3,1,
1); stem(n,x);
xlabel(' n----->');ylabel('Amplitude--->');
title('input
seq');
subplot(3,1,2);
N=length(y);
n=0:1:N-1;
stem(n,y);
xlabel('n---->');ylabel('Amplitude---
-.'); title('autocorr seq for input');
disp('autocorr seq for input');
disp(y)
p=fft(y,N);
subplot(3,1,3
); stem(n,p);
xlabel('K----->');ylabel('Amplitude--->');
title('psd         of
input'); disp('the
psd            fun:');
disp(p)


Program1:
clc;
close
all;
clear
all;
n=0:40;
D=10
;
x=3*cos(2*pi*0.1*n)-2*cos(2*pi*0.4*n);
xd=[zeros(1,D)
x];
y=n.*xd(n+D);
n1=n+D;
yd=n1.*x;
d=y-yd;
if d
   disp('Given system is not satisfy time shifting property');
else
   disp('Given system is satisfy time shifting property');
end
subplot(3,1,1),stem(y),gri
d;
subplot(3,1,2),stem(yd),g
rid;
subplot(3,1,3),stem(d),gri
d;
Program
2:
clc;
close
all;
clear
all;
n=0:40;
D=10;
x=3*cos(2*pi*0.1*n)-2*cos(2*pi*0.4*n);
xd=[zeros(1,D)
x]; x1=xd(n+D);
y=exp(x1);
n1=n+D;
yd=exp(xd(n1));
d=y-yd;
if d
   disp('Given system is not satisfy time shifting property');
else
   disp('Given system is satisfy time shifting property');
end
subplot(3,1,1),stem(y),gri
d;
subplot(3,1,2),stem(yd),g
rid;
subplot(3,1,3),stem(d),gri
d;
CONCLUSION:
EXP.NO:8

   COMPUTATION OF UNIT SAMPLE, UNIT STEP AND SINUSOIDAL
    RESPONSE OF THE GIVEN LTI SYSTEM AND VERIFYING ITS
     PHYSICAL REALIZABILITY AND STABILITY PROPERTIES.


Aim: To Unit Step And Sinusoidal Response Of The Given LTI System And
Verifying
Its Physical Realizability And Stability
Properties.

EQUIPMENTS:
PC        with              windows
(95/98/XP/NT/2000).
MATLAB
Software


%calculate and plot the impulse response and step
response b=[1];
a=[1,-1,.9];
x=impseq(0,-20,120); n = [-20:120]; h=filter(b,a,x); subplot(3,1,1);stem(n,h);
title('impulse response'); xlabel('n');ylabel('h(n)');
=stepseq(0,-20,120); s=filter(b,a,x); s=filter(b,a,x); subplot(3,1,2); stem(n,s);
title('step response'); xlabel('n');ylabel('s(n)') t=0:0.1:2*pi;
x1=sin(t);
%impseq(0,-20,120); n = [-20:120]; h=filter(b,a,x1); subplot(3,1,3);stem(h);
title('sin response'); xlabel('n');ylabel('h(n)'); figure;
zplane(b,a);
CONCLUSION: I
EXP.NO: 9                     GIBBS      PHENOMENON

Aim: To verify the Gibbs Phenomenon.

EQUIPMENTS:
PC with windows (95/98/XP/NT/2000).
MATLAB Software

Gibbs Phenomina Program :

t=0:0.1:(pi*8); y=sin(t); subplot(5,1,1); plot(t,y); xlabel('k');
ylabel('amplitude'); title('gibbs phenomenon'); h=2;
%k=3;
for k=3:2:9 y=y+sin(k*t)/k; subplot(5,1,h);
plot(t,y); xlabel('k'); ylabel('amplitude'); h=h+1;
end
CONCLUSION: In this experiment Gibbs phenomenon have been
demonstrated Using MATLAB
EXP.NO: 10.

   FINDING THE FOURIER TRANSFORM OF A GIVEN SIGNAL AND
        PLOTTING ITS MAGNITUDE AND PHASE SPECTRUM

Aim: to find the fourier transform of a given signal and plotting its
magnitude and phase spectrum

EQUIPMENTS:
 PC with windows (95/98/XP/NT/2000).
 MATLAB Software

EQUIPMENTS:
      PC with windows (95/98/XP/NT/2000).
MATLAB Software



  Program:
 clc;
close all;
clear all;
x=input('enter the sequence'); N=length(x);
n=0:1:N-1; y=fft(x,N) subplot(2,1,1); stem(n,x);
title('input sequence'); xlabel('time index n----->'); ylabel('amplitude x[n]-
---> '); subplot(2,1,2);
stem(n,y);
title('output sequence');
xlabel(' Frequency index K---->');
ylabel('amplitude X[k]------>');
FFT magnitude and Phase plot:

clc
close all x=[1,1,1,1,zeros(1,4)]; N=8;
X=fft(x,N); magX=abs(X),phase=angle(X)*180/pi; subplot(2,1,1)
plot(magX); grid xlabel('k')
ylabel('X(K)') subplot(2,1,2) plot(phase);
grid xlabel('k') ylabel('degrees')
CONCLUSION: In this experiment the fourier transform of a given signal
and plotting its magnitude and phase spectrum have been demonstrated
using matlab
Exp:11
                               LAPLACE TRNASFORMS

Aim: To perform waveform synthesis using Laplece Trnasforms of a given
signal
Program for Laplace Transform:
 f=t
 syms f t; f=t; laplace(f)
 Program for nverse Laplace Transform
 f(s)=24/s(s+8) invese LT
 syms F s F=24/(s*(s+8)); ilaplace(F)
 y(s)=24/s(s+8) invese LT poles and zeros
Signal synthese using Laplace Tnasform:
clear all clc t=0:1:5 s=(t);
subplot(2,3,1) plot(t,s); u=ones(1,6) subplot(2,3,2) plot(t,u); f1=t.*u;
subplot(2,3,3) plot(f1);
s2=-2*(t-1); subplot(2,3,4); plot(s2);
u1=[0 1 1 1 1 1]; f2=-2*(t-1).*u1; subplot(2,3,5); plot(f2);
u2=[0 0 1 1 1 1]; f3=(t-2).*u2; subplot(2,3,6); plot(f3); f=f1+f2+f3; figure;
plot(t,f);
% n=exp(-t);
% n=uint8(n);
% f=uint8(f);
% R = int(f,n,0,6)
laplace(f);
CONCLUSION: In this experiment the Triangular signal synthesised using
Laplece Trnasforms using MATLAB
EXP.NO: 12

 LOCATING THE ZEROS AND POLES AND PLOTTING THE POLE ZERO
MAPS IN S-PLANE AND Z-PLANE FOR THE GIVEN TRANSFER FUNCTION.


Aim: To locating the zeros and poles and plotting the pole zero maps in
s-plane and z- plane for the given transfer function

EQUIPMENTS:
PC with windows (95/98/XP/NT/2000).
MATLAB Software

clc; close all clear all;
%b= input('enter the numarator cofficients')
%a= input('enter the denumi cofficients')
b=[1 2 3 4] a=[1 2 1 1 ] zplane(b,a);




                                 Result: :
EXP.NO: 13
                     13. Gaussian noise


 %Estimation of Gaussian density and Distribution Functions

 %% Closing and Clearing
 all clc;
 clear all;
 close all;

 %% Defining the range for the Random
 variable dx=0.01; %delta x
 x=-3:dx:3; [m,n]=size(x);

 %% Defining the parameters of the pdf
 mu_x=0;    % mu_x=input('Enter the value of mean');
 sig_x=0.1; % sig_x=input('Enter the value of varience');

 %% Computing the probability density
 function px1=[];
 a=1/(sqrt(2*pi)*sig_x);
 for j=1:n
   px1(j)=a*exp([-((x(j)-mu_x)/sig_x)^2]/2);
 end

 %% Computing the cumulative distribution
 function cum_Px(1)=0;
 for j=2:n
   cum_Px(j)=cum_Px(j-1)+dx*px1(j);
 end

 %% Plotting the
 results figure(1)
 plot(x,px1);grid
 axis([-3 3 0 1]);
 title(['Gaussian pdf for mu_x=0 and sigma_x=', num2str(sig_x)]);
 xlabel('--> x')
 ylabel('--> pdf')
 figure(2)
 plot(x,cum_Px);gri
 d axis([-3 3 0 1]);
 title(['Gaussian Probability Distribution Function for mu_x=0 and
 sigma_x=', num2str(sig_x)]);
 title('ite^{omegatau} = cos(omegatau) + isin(omegatau)')
xlabel('--> x')
 ylabel('--> PDF')
EXP.NO: 14
                    14. Sampling theorem verification


Aim: To detect the edge for single observed image using sobel edge detection
and canny edge detection.

EQUIPMENTS:
PC with windows (95/98/XP/NT/2000).
MATLAB Software
Figure 2: (a) Original signal g(t) (b) Spectrum G(w)
δ (t) is the sampling signal with fs = 1/T > 2fm.




Figure 3: (a) sampling signal δ (t) ) (b) Spectrum δ (w)

Let gs(t) be the sampled signal. Its Fourier Transform Gs(w) isgiven by




Figure 4: (a) sampled signal gs(t) (b) Spectrum Gs(w)
To recover the original signal G(w):
1. Filter with a Gate function, H2wm(w) of width 2wm
Scale it by T.




Figure 5: Recovery of signal by filtering with a fiter of width 2wm


Aliasing
{ Aliasing is a phenomenon where the high frequency components of the
sampled signal interfere with each other because of inadequate sampling
ws < 2wm.




Figure 6: Aliasing due to inadequate sampling
Aliasing leads to distortion in recovered signal. This is the
reason why sampling frequency should be atleast twice thebandwidth of
the signal. Oversampling
{ In practice signal are oversampled, where fs is
signi_cantly higher than Nyquist rate to avoid
aliasing.




Figure 7: Oversampled signal-avoids aliasing t=-10:.01:10;
 T=4; fm=1/T; x=cos(2*pi*fm*t); subplot(2,2,1); plot(t,x);
 xlabel('time');ylabel('x(t)') title('continous time signal') grid;
 n1=-4:1:4 fs1=1.6*fm; fs2=2*fm; fs3=8*fm;
x1=cos(2*pi*fm/fs1*n1); subplot(2,2,2); stem(n1,x1); xlabel('time');ylabel('x(n)')
title('discrete time signal with fs<2fm')
hold on subplot(2,2,2); plot(n1,x1) grid;
 n2=-5:1:5; x2=cos(2*pi*fm/fs2*n2); subplot(2,2,3); stem(n2,x2);
 xlabel('time');ylabel('x(n)')
title('discrete time signal with fs=2fm')
 hold on

subplot(2,2,3); plot(n2,x2) grid;
 n3=-20:1:20;
x3=cos(2*pi*fm/fs3*n
 3); subplot(2,2,4);
 stem(n3,x3);
 xlabel('time');ylabel('x(
 n)')
title('discrete time signal with fs>2fm')
 hold on
subplot(2,2
,4);
plot(n3,x3)
grid;




CONCLUSION: In this experiment the sampling theorem have been verified
 Using MATLAB
EXP.No:1
5
REMOVAL OF NOISE BY AUTO CORRELATION/CROSS
                       CORRELATION


Aim: removal of noise by auto correlation/cross correlation


EQUIPMENTS:
PC with windows (95/98/XP/NT/2000).
MATLAB Software

a)auto correlation clear all
clc t=0:0.1:pi*4; s=sin(t);
k=2; subplot(6,1,1) plot(s); title('signal s'); xlabel('t');
ylabel('amplitude'); n = randn([1 126]); f=s+n; subplot(6,1,2) plot(f);
title('signal f=s+n'); xlabel('t'); ylabel('amplitude'); as=xcorr(s,s); subplot(6,1,3)
plot(as);
title('auto correlation of s'); xlabel('t'); ylabel('amplitude'); an=xcorr(n,n);
subplot(6,1,4)
plot(an);

title('auto correlation of
n'); xlabel('t');
ylabel('amplitude');
cff=xcorr(f,f);
subplot(6,1,5)
plot(cff);
title('auto correlation of
f'); xlabel('t');
ylabel('amplitude');
hh=as+an;
subplot(6,1,6)
plot(hh);
title('addition of
as+an'); xlabel('t');
ylabel('amplitude');
B)CROSS CORRELATION :

clear all clc
t=0:0.1:pi*4;
s=sin(t);
k=2;
%sk=sin(t+k);
subplot(7,1,1)
plot(s);
title('signal s');xlabel('t');ylabel('amplitude');
c=cos(t); subplot(7,1,2) plot(c);
title('signal c');xlabel('t');ylabel('amplitude');
n = randn([1 126]); f=s+n; subplot(7,1,3) plot(f);
title('signal f=s+n');xlabel('t');ylabel('amplitude');
asc=xcorr(s,c); subplot(7,1,4) plot(asc);
title('auto correlation of s and c');xlabel('t');ylabel('amplitude');
anc=xcorr(n,c); subplot(7,1,5) plot(anc);
title('auto correlation of n and c');xlabel('t');ylabel('amplitude');
cfc=xcorr(f,c); subplot(7,1,6) plot(cfc);
title('auto correlation of f and c');xlabel('t');ylabel('amplitude');
hh=asc+anc; subplot(7,1,7) plot(hh);
title('addition of asc+anc');xlabel('t');ylabel('amplitude');




                                          76
Result:
EXP.No:16
                     Program:
EXTRACTION OF
                     Clear all; close all; clc; n=256; k1=0:n-1;
                            P
                     x=cos(32*pi*k1/n)+sin(48*pi*k1/n);
                            E
                     plot(k1,x)
                            R
                     %Module to find period of input signl k=2;
                            I
                     xm=zeros(k,1); ym=zeros(k,1); hold on
                            O
                     for i=1:k
                            D
                       [xm(i) ym(i)]=ginput(1);
                            I
                          plot(xm(i), ym(i),'r*');
                            C
                     end
                          period=abs(xm(2)-xm(1)); rounded_p=round(period);
                            S
                       m=rounded_p
                            I
                     % Adding noise and plotting noisy signal
                            G
                            N
                            A
                            L

                            M
                            A
                     y=x+randn(1,n);
                            S
                     figure plot(k1,y)
                            K
                            E
                            D

                            B
                            Y

                            N
                            O
                            I
                            S
                            E

                            U
                            S
                            I
                            N
                            G

                            C
                            O
                            R
                            R
                            E
                            L
                            A
                            T
                            I
                            O
                            N
    Extraction of
   Periodic Signal
  Masked By Noise
        Using
     Correlation
% To generate impulse train with the period as that of input signal
d=zeros(1,n);
for i=1:n

if (rem(i-1,m)==0)

  d(i)=1;

end end
%Correlating noisy signal and impulse train cir=cxcorr1(y,d);
%plotting the original and reconstructed signal m1=0:n/4;
figure

Plot (m1,x(m1+1),'r',m1,m*cir(m1+1));
CONCLUSION: In this experiment the Weiner-Khinchine Relation have
been verified using MATLAB.
EXP.No:17
       VERIFICATION OF WIENER–KHINCHIN RELATION


AIM: Verification of wiener–khinchine relation

EQUIPMENTS:
PC with windows (95/98/XP/NT/2000).
MATLAB Software

PROGRAM:
Clc
clear all;
t=0:0.1:2*pi; x=sin(2*t); subplot(3,2,1); plot(x); au=xcorr(x,x); subplot(3,2,2);
plot(au); v=fft(au); subplot(3,2,3); plot(abs(v)); fw=fft(x); subplot(3,2,4);
plot(fw);
fw2=(abs(fw)).^2;
subplot(3,2,5); plot(fw2);




Result:
EXP18.

  CHECKING A RANDOM PROCESS FOR STATIONARITY IN WIDE SENSE.


 AIM: Checking a random process for stationary in wide sense.

EQUIPMENTS:
PC with windows (95/98/XP/NT/2000).
MATLAB Software

MATLAB PROGRAM:

Clear all
Clc
y = randn([1 40]) my=round(mean(y));
z=randn([1 40]) mz=round(mean(z)); vy=round(var(y)); vz=round(var(z));
t = sym('t','real'); h0=3; x=y.*sin(h0*t)+z.*cos(h0*t); mx=round(mean(x));
k=2;
xk=y.*sin(h0*(t+k))+z.*cos(h0*(t+k));
x1=sin(h0*t)*sin(h0*(t+k));
x2=cos(h0*t)*cos(h0*(t+k)); c=vy*x1+vz*x1;
% if we solve “c=2*sin (3*t)*sin (3*t+6)" we get c=2cos (6)
% which is a costant does not depent on variable’t’
% so it is wide sence stationary




Result:

More Related Content

What's hot

Digital Signal Processing Lab Manual
Digital Signal Processing Lab Manual Digital Signal Processing Lab Manual
Digital Signal Processing Lab Manual Amairullah Khan Lodhi
 
Pass Transistor Logic
Pass Transistor LogicPass Transistor Logic
Pass Transistor LogicDiwaker Pant
 
Discrete Fourier Transform
Discrete Fourier TransformDiscrete Fourier Transform
Discrete Fourier TransformAbhishek Choksi
 
Structures for FIR systems
Structures for FIR systemsStructures for FIR systems
Structures for FIR systemsChandan Taluja
 
Pyramid Vector Quantization
Pyramid Vector QuantizationPyramid Vector Quantization
Pyramid Vector QuantizationShahDhruv21
 
Introduction state machine
Introduction state machineIntroduction state machine
Introduction state machineShreyans Pathak
 
synchronous state machine design
synchronous state machine designsynchronous state machine design
synchronous state machine designAdarsh Patel
 
Signal modelling
Signal modellingSignal modelling
Signal modellingDebangi_G
 
Coherent and Non-coherent detection of ASK, FSK AND QASK
Coherent and Non-coherent detection of ASK, FSK AND QASKCoherent and Non-coherent detection of ASK, FSK AND QASK
Coherent and Non-coherent detection of ASK, FSK AND QASKnaimish12
 
Fast Fourier Transform
Fast Fourier TransformFast Fourier Transform
Fast Fourier Transformop205
 
Decimation in time and frequency
Decimation in time and frequencyDecimation in time and frequency
Decimation in time and frequencySARITHA REDDY
 
Design of FIR filters
Design of FIR filtersDesign of FIR filters
Design of FIR filtersop205
 

What's hot (20)

Unit I.fundamental of Programmable DSP
Unit I.fundamental of Programmable DSPUnit I.fundamental of Programmable DSP
Unit I.fundamental of Programmable DSP
 
Speech coding techniques
Speech coding techniquesSpeech coding techniques
Speech coding techniques
 
Dee2034 chapter 5 counter
Dee2034 chapter 5 counterDee2034 chapter 5 counter
Dee2034 chapter 5 counter
 
Digital Signal Processing Lab Manual
Digital Signal Processing Lab Manual Digital Signal Processing Lab Manual
Digital Signal Processing Lab Manual
 
Pass Transistor Logic
Pass Transistor LogicPass Transistor Logic
Pass Transistor Logic
 
Discrete Fourier Transform
Discrete Fourier TransformDiscrete Fourier Transform
Discrete Fourier Transform
 
Multipliers in VLSI
Multipliers in VLSIMultipliers in VLSI
Multipliers in VLSI
 
DSP lab manual
DSP lab manualDSP lab manual
DSP lab manual
 
DSP Processor
DSP Processor DSP Processor
DSP Processor
 
Chapter 4
Chapter 4Chapter 4
Chapter 4
 
Unit iv wcn main
Unit iv wcn mainUnit iv wcn main
Unit iv wcn main
 
Structures for FIR systems
Structures for FIR systemsStructures for FIR systems
Structures for FIR systems
 
Pyramid Vector Quantization
Pyramid Vector QuantizationPyramid Vector Quantization
Pyramid Vector Quantization
 
Introduction state machine
Introduction state machineIntroduction state machine
Introduction state machine
 
synchronous state machine design
synchronous state machine designsynchronous state machine design
synchronous state machine design
 
Signal modelling
Signal modellingSignal modelling
Signal modelling
 
Coherent and Non-coherent detection of ASK, FSK AND QASK
Coherent and Non-coherent detection of ASK, FSK AND QASKCoherent and Non-coherent detection of ASK, FSK AND QASK
Coherent and Non-coherent detection of ASK, FSK AND QASK
 
Fast Fourier Transform
Fast Fourier TransformFast Fourier Transform
Fast Fourier Transform
 
Decimation in time and frequency
Decimation in time and frequencyDecimation in time and frequency
Decimation in time and frequency
 
Design of FIR filters
Design of FIR filtersDesign of FIR filters
Design of FIR filters
 

Similar to Basic simulation lab manual1

Matlab 2
Matlab 2Matlab 2
Matlab 2asguna
 
Dsp 1recordprophess-140720055832-phpapp01
Dsp 1recordprophess-140720055832-phpapp01Dsp 1recordprophess-140720055832-phpapp01
Dsp 1recordprophess-140720055832-phpapp01Sagar Gore
 
Digital Signal Processing Lab Manual ECE students
Digital Signal Processing Lab Manual ECE studentsDigital Signal Processing Lab Manual ECE students
Digital Signal Processing Lab Manual ECE studentsUR11EC098
 
Fast Fourier Transform (FFT) of Time Series in Kafka Streams
Fast Fourier Transform (FFT) of Time Series in Kafka StreamsFast Fourier Transform (FFT) of Time Series in Kafka Streams
Fast Fourier Transform (FFT) of Time Series in Kafka StreamsHostedbyConfluent
 
Signal Prosessing Lab Mannual
Signal Prosessing Lab Mannual Signal Prosessing Lab Mannual
Signal Prosessing Lab Mannual Jitendra Jangid
 
DIGITAL SIGNAL PROCESSING: Sampling and Reconstruction on MATLAB
DIGITAL SIGNAL PROCESSING: Sampling and Reconstruction on MATLABDIGITAL SIGNAL PROCESSING: Sampling and Reconstruction on MATLAB
DIGITAL SIGNAL PROCESSING: Sampling and Reconstruction on MATLABMartin Wachiye Wafula
 
BS LAB Manual (1).pdf
BS LAB Manual  (1).pdfBS LAB Manual  (1).pdf
BS LAB Manual (1).pdfssuser476810
 
Fourier series example
Fourier series exampleFourier series example
Fourier series exampleAbi finni
 
DSP Lab Manual (10ECL57) - VTU Syllabus (KSSEM)
DSP Lab Manual (10ECL57) - VTU Syllabus (KSSEM)DSP Lab Manual (10ECL57) - VTU Syllabus (KSSEM)
DSP Lab Manual (10ECL57) - VTU Syllabus (KSSEM)Ravikiran A
 
EC8553 Discrete time signal processing
EC8553 Discrete time signal processing EC8553 Discrete time signal processing
EC8553 Discrete time signal processing ssuser2797e4
 
Applied Digital Signal Processing 1st Edition Manolakis Solutions Manual
Applied Digital Signal Processing 1st Edition Manolakis Solutions ManualApplied Digital Signal Processing 1st Edition Manolakis Solutions Manual
Applied Digital Signal Processing 1st Edition Manolakis Solutions Manualtowojixi
 
Digital signal Processing all matlab code with Lab report
Digital signal Processing all matlab code with Lab report Digital signal Processing all matlab code with Lab report
Digital signal Processing all matlab code with Lab report Alamgir Hossain
 

Similar to Basic simulation lab manual1 (20)

Dsp Lab Record
Dsp Lab RecordDsp Lab Record
Dsp Lab Record
 
Matlab 2
Matlab 2Matlab 2
Matlab 2
 
Dsp 1recordprophess-140720055832-phpapp01
Dsp 1recordprophess-140720055832-phpapp01Dsp 1recordprophess-140720055832-phpapp01
Dsp 1recordprophess-140720055832-phpapp01
 
Digital Signal Processing Lab Manual ECE students
Digital Signal Processing Lab Manual ECE studentsDigital Signal Processing Lab Manual ECE students
Digital Signal Processing Lab Manual ECE students
 
Dsp manual
Dsp manualDsp manual
Dsp manual
 
Matlab programs
Matlab programsMatlab programs
Matlab programs
 
DSP Lab 1-6.pdf
DSP Lab 1-6.pdfDSP Lab 1-6.pdf
DSP Lab 1-6.pdf
 
Fast Fourier Transform (FFT) of Time Series in Kafka Streams
Fast Fourier Transform (FFT) of Time Series in Kafka StreamsFast Fourier Transform (FFT) of Time Series in Kafka Streams
Fast Fourier Transform (FFT) of Time Series in Kafka Streams
 
Dsp iit workshop
Dsp iit workshopDsp iit workshop
Dsp iit workshop
 
Dsp file
Dsp fileDsp file
Dsp file
 
Signal Prosessing Lab Mannual
Signal Prosessing Lab Mannual Signal Prosessing Lab Mannual
Signal Prosessing Lab Mannual
 
DIGITAL SIGNAL PROCESSING: Sampling and Reconstruction on MATLAB
DIGITAL SIGNAL PROCESSING: Sampling and Reconstruction on MATLABDIGITAL SIGNAL PROCESSING: Sampling and Reconstruction on MATLAB
DIGITAL SIGNAL PROCESSING: Sampling and Reconstruction on MATLAB
 
BS LAB Manual (1).pdf
BS LAB Manual  (1).pdfBS LAB Manual  (1).pdf
BS LAB Manual (1).pdf
 
DSP_EXP.pptx
DSP_EXP.pptxDSP_EXP.pptx
DSP_EXP.pptx
 
Fourier series example
Fourier series exampleFourier series example
Fourier series example
 
DSP Lab Manual (10ECL57) - VTU Syllabus (KSSEM)
DSP Lab Manual (10ECL57) - VTU Syllabus (KSSEM)DSP Lab Manual (10ECL57) - VTU Syllabus (KSSEM)
DSP Lab Manual (10ECL57) - VTU Syllabus (KSSEM)
 
EC8553 Discrete time signal processing
EC8553 Discrete time signal processing EC8553 Discrete time signal processing
EC8553 Discrete time signal processing
 
Ecg
EcgEcg
Ecg
 
Applied Digital Signal Processing 1st Edition Manolakis Solutions Manual
Applied Digital Signal Processing 1st Edition Manolakis Solutions ManualApplied Digital Signal Processing 1st Edition Manolakis Solutions Manual
Applied Digital Signal Processing 1st Edition Manolakis Solutions Manual
 
Digital signal Processing all matlab code with Lab report
Digital signal Processing all matlab code with Lab report Digital signal Processing all matlab code with Lab report
Digital signal Processing all matlab code with Lab report
 

Recently uploaded

Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Hyundai Motor Group
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 

Recently uploaded (20)

Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 

Basic simulation lab manual1

  • 1. DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING Siddharth Institute of Engineering and Technology (Affiliated to J.N.T.UNIVERSITY, ANANTAPUR) Narayanavanam, puttur, AP. II YEAR BTECH I SEMESTER BASIC SIMULATION LAB MANUAL PREPARED BY: VERIFIED BY: LIST OF EXPERIMENTS S.No Name of the Experiment Basic operations on matrices. 1. Generation on various signals and Sequences (periodic and a periodic), such as unit impulse, unit step, square, saw tooth, 2. triangular, sinusoidal, ramp, sinc. Operations on signals and sequences such as addition, multiplication, scaling, shifting, folding, computation of 3. energy and average power. Finding the even and odd parts of signal/sequence and real 4. and imaginary part of signal.
  • 2. 5. Convolution between signals and sequences Auto correlation and cross correlation between signals and 6. sequences. Verification of linearity and time invariance properties of a 7. given continuous /discrete system. Computation of unit sample, unit step and sinusoidal response of the given LTI system and verifying its physical 8. Reliability and stability properties. Gibbs phenomenon. 9. Finding the Fourier transform of a given signal and plotting 10. its magnitude and phase spectrum 11. Waveform synthesis using Laplace Transform. Locating the zeros and poles and plotting the pole zero maps 12. in s8plane and z8plane for the given transfer function. Generation of Gaussian Noise (real and complex),computation of its mean, M.S. Value and its skew, 13. kurtosis, and PSD, probability distribution function. 14. Sampling theorem verification. 15. Removal of noise by auto correlation/cross correlation. Extraction of periodic signal masked by noise using 16. correlation. 17. Verification of Weiner8Khinchine relations. 18. Checking a random process for stationary in wide sense. 1
  • 4. BASIC OPERATIONS ON MATRICES Aim: To generate matrix and perform basic operation on matrices Using MATLAB Software. EQUIPMENTS: PC with windows (95/98/XP/NT/2000). MATLAB Software CONCLUSION: EXP.NO: 2 GENERATION OF VARIOUS SIGNALS AND SEQUENCES (PERIODIC AND APERIODIC), SUCH AS UNIT IMPULSE, UNIT STEP, SQUARE, SAWTOOTH, TRIANGULAR, SINUSOIDAL, RAMP, SINC. Aim: To generate different types of signals Using MATLAB Software. EQUIPMENTS: PC with windows (95/98/XP/NT/2000). MATLAB Software Matlab program: %unit impulse generation clc close all n1=-3; n2=4; n0=0; n=[n1:n 2]; x=[(n-n0)==0] stem(n,x) % unit step generation n1=-4; n2=5; n0=0;
  • 5. 9
  • 7. % square wave wave generator fs = 1000; t = 0:1/fs:1.5; x1 = sawtooth(2*pi*50*t); x2 = square(2*pi*50*t); subplot(2,2,1),plot(t,x1), axis([0 0.2 -1.2 1.2]) xlabel('Time (sec)');ylabel('Amplitude'); title('Sawtooth Periodic Wave') subplot(2,2,2),plot(t,x2), axis([0 0.2 -1.2 1.2]) xlabel('Time (sec)');ylabel('Amplitude'); title('Square Periodic Wave'); subplot(2,2,3),stem(t,x2), axis([0 0.1 -1.2 1.2]) xlabel('Time (sec)');ylabel('Amplitude'); % sawtooth wave generator fs = 10000; t = 0:1/fs:1.5; x = sawtooth(2*pi*50*t); subplot(1,2,1); plot(t,x), axis([0 0.2 -1 1]); xlabel('t'),ylabel('x(t)') title('sawtooth signal'); N=2; fs = 500;n = 0:1/fs:2; x = sawtooth(2*pi*50*n); subplot(1,2,2);
  • 8. stem(n,x), axis([0 0.2 -1 1]); xlabel('n'),ylabel('x(n)') title('sawtooth sequence'); To generate a trianguular pulse A=2; t = 0:0.0005:1; x=A*sawtooth(2*pi*5*t,0.25); %5 Hertz wave with duty cycle 25% plot(t,x); grid axis([0 1 -3 3]); %%To generate a trianguular pulse fs = 10000;t = -1:1/fs:1; x1 = tripuls(t,20e-3); x2 = rectpuls(t,20e-3); subplot(211),plot(t,x1), axis([-0.1 0.1 -0.2 1.2]) xlabel('Time (sec)');ylabel('Amplitude'); title('Triangular Aperiodic Pulse') subplot(212),plot(t,x2), axis([-0.1 0.1 -0.2 1.2])
  • 9. xlabel('Time (sec)');ylabel('Amplitude'); title('Rectangular Aperiodic Pulse') set(gcf,'Color',[1 1 1]), %%To generate a rectangular pulse t=-5:0.01:5; pulse = rectpuls(t,2); %pulse of width 2 time units plot(t,pulse) axis([-5 5 -1 2]); grid
  • 10.
  • 11. % sinusoidal signal N=64; % Define Number of samples n=0:N-1; % Define vector n=0,1,2,3,...62,63 f=1000; % Define the frequency fs=8000; % Define the sampling frequency x=sin(2*pi*(f/fs)*n); % Generate x(t) plot(n,x); % Plot x(t) vs. t title('Sinewave [f=1KHz, fs=8KHz]'); xlabel('Sample Number'); ylabel('Amplitude'); % RAMP clc close all n=input('enter the length of ramp'); t=0:n; plot(t); xlabel('t');
  • 13. % sinc x = linspace(-5,5); y = sinc(x); subplot(1,2,1);plot(x,y ) xlabel(‘time’); ylabel(‘amplitude’); title(‘sinc function’); subplot(1,2,2);stem(x, y); xlabel(‘time’); ylabel(‘amplitude’); title(‘sinc function’);
  • 15.
  • 16. EXP.NO: 3 OPERATIONS ON SIGNALS AND SEQUENCES SUCH AS ADDITION, MULTIPLICATION, SCALING, SHIFTING, FOLDING, COMPUTATION OF ENERGY AND AVERAGE POWER Aim: To perform arithmetic operations different types of signals Using MATLAB Software. EQUIPMENTS: PC with windows (95/98/XP/NT/2000). MATLAB Softwar %plot the 2 Hz sine wave in the top panel t = [0:.01:1]; % independent (time) variable A = 8; % amplitude f1 = 2; % create a 2 Hz sine wave lasting 1 sec s1 = A*sin(2*pi*f1*t); f2 = 6; % create a 4 Hz sine wave lasting 1 sec s2 = A*sin(2*pi*f2*t); figure subplot(4,1,1) plot(t, s1) title('1 Hz sine wave') ylabel('Amplitude') %plot the 4 Hz sine wave in the middle panel subplot(4,1,2) plot(t, s2) title('2 Hz sine wave') ylabel('Amplitude') %plot the summed sine waves in the bottom panel subplot(4,1,3) plot(t, s1+s2) title('Summed sine waves') ylabel('Amplitude') xlabel('Time (s)') xmult=s1.*s2; subplot(4,1,4); plot(xmult); title('multiplication'); ylabel('Amplitude') xlabel('Time (s)')
  • 17. %signal folding clc; clear all t=0:0.1:10; x=0.5*t; lx=length(x); nx=0:lx-1; xf=fliplr(x); nf=-fliplr(nx); subplot(2,1,1); stem(nx,x); xlabel('nx'); ylabel('x(nx)'); title('original signal'); subplot(2,1,2); stem(nf,xf); xlabel('nf'); ylabel('xf(nf)'); title('folded signal'); 23
  • 18. %plot the 2 Hz sine wave scalling t = [0:.01:1]; % independent (time) variable A = 8; % amplitude f1 = 2; % create a 2 Hz sine wave lasting 1 sec s1 = A*sin(2*pi*f1*t); subplot(3,2,1) plot(s1); xlabel('t'); ylabel('amplitude'); s2=2*s1; subplot(3,2,2) plot(s2); xlabel('t'); ylabel('amplitude');
  • 19. s3=s1/2; subplot(3,2,3) plot(s3); xlabel('t'); ylabel('amplitude'); subplot(3,2,4) stem(s1); xlabel('t'); ylabel('amplitude'); s2=2*s1; subplot(3,2,5) stem(s2); xlabel('t'); ylabel('amplitude'); s3=s1/2; subplot(3,2,6) stem(s3); xlabel('t'); ylabel('amplitude '); Excersize questions: Sketch the following questions using MATLAB 1. x(t)= u(-t+1)
  • 20. 2. x(t)=3r(t-1) 3. x(t)=U(n+2-u(n-3) 4. x(n)=x1(n)+x2(n)where x1(n)={1,3,2,1},x2(n)={1,-2,3,2} 5. x(t)=r(t)-2r(t-1)+r(t-2) 6. x(n)=2δ(n+2)-2δ(n-4), -5≤ n ≥5. 7. X(n)={1,2,3,4,5,6,7,6,5,4,2,1} determine and plot the following sequence a. x1(n)=2x(n-5-3x(n+4)) b. x2(n)=x(3-n)+x(n)x(n- 2) CONCLUSION: Inthis experiment the various oprations on signals have been performedUsing MATLAB have been demonstrated.
  • 21. EXP.NO: 4 FINDING THE EVEN AND ODD PARTS OF SIGNAL/SEQUENCE AND REAL AND IMAGINARY PART OF SIGNAL Aim: program for finding even and odd parts of signals Using MATLAB Software. EQUIPMENTS: PC with windows (95/98/XP/NT/2000). MATLAB Software %even and odd signals program: t=-4:1:4; h=[ 2 1 1 2 0 1 2 2 3 ]; subplot(3,2,1) stem(t,h); xlabel('time'); ylabel('amplitude'); title('signal'); n=9;
  • 22. for i=1:9 x1(i)=h(n); n=n-1; end subplot(3,2,2) stem(t,x1); xlabel('time'); ylabel('amplitude'); title('folded signal'); z=h+x1 subplot(3,2,3); stem(t,z); xlabel('time'); ylabel('amplitude'); title('sum of two signal'); subplot(3,2,4); stem(t,z/2); xlabel('time'); ylabel('amplitude'); title('even signal'); a=h- x1; subplot(3,2,5); stem(t,a); xlabel('time'); ylabel('amplitude'); title('difference of two signal'); subplot(3,2,6); stem(t,a/2); xlabel('time'); ylabel('amplitude'); title('odd signal');
  • 23. % energy clc; close all; clear all; x=[1,2,3]; n=3 e=0; for i=1:n; e=e+(x(i).*x(i)); end % energy clc; close all; clear all; N=2 x=ones(1,N) for i=1:N y(i)=(1/3)^i.*x(i); end n=N; e=0; for i=1:n; e=e+(y(i).*y(i)); end
  • 24. % power clc; close all; clear all; N=2 x=ones(1, N) for i=1:N y(i)=(1/3)^i.*x(i); end n= N; e=0 ; for i=1:n; e=e+(y(i).*y(i)) ; end p=e/(2*N+ 1); % power N=input('type a value for N'); t=-N:0.0001:N; x=cos(2*pi*50*t).^2; disp('the calculated power p of the signal is'); P=sum(abs(x).^2)/length(x) plot(t,x); axis([0 0.1 0 1]); disp('the theoretical power of the signal is'); P_theory=3/8 CONCLUSION:
  • 25. EXP.NO: 5 LINEAR CONVOLUTION Aim: To find the out put with linear convolution operation Using MATLAB Software. EQUIPMENTS: PC with windows (95/98/XP/NT/2000). MATLAB Software Program: clc; close all; clear all; x=input('enter input sequence'); h=input('enter impulse response'); y=conv(x,h); subplot(3,1,1); stem(x); xlabel('n');ylabel('x(n)' ); title('input signal') subplot(3,1,2); stem(h); xlabel('n');ylabel('h(n)' ); title('impulse response') subplot(3,1,3);
  • 26. stem(y); xlabel('n');ylabel('y(n)') ; title('linear convolution') disp('The resultant signal is'); disp(y) linear convolution output: enter input sequence[1 4 3 2] enter impulse response[1 0 2 1] The resultant signal is 1 4 5 11 10 7 2
  • 28. EXP.NO: 6 6. AUTO CORRELATION AND CROSS CORRELATION BETWEEN SIGNALS AND SEQUENCES. ……………………………………………………………………………………………… Aim: To compute auto correlation and cross correlation between signals and sequences EQUIPMENTS: PC with windows (95/98/XP/NT/2000). MATLAB Software % Cross Correlation clc; close all; clear all; x=input('enter input sequence'); h=input('enter the impulse suquence'); subplot(3,1, 1); stem(x); xlabel('n'); ylabel('x(n)'); title('input signal'); subplot(3,1, 2); stem(h); xlabel('n'); ylabel('h(n)'); title('impulse signal'); y=xcorr(x,h); subplot(3,1,3); stem(y); xlabel('n'); ylabel('y(n)'); disp('the resultant signal is'); disp(y); title('correlation signal');
  • 29.
  • 30. % auto correlation clc; close all; clear all; x = [1,2,3,4,5]; y = [4,1,5,2,6]; subplot(3,1, 1); stem(x); xlabel('n'); ylabel('x(n)'); title('input signal'); subplot(3,1,2); stem(y); xlabel('n'); ylabel('y(n)'); title('input signal'); z=xcorr(x,x); subplot(3,1,3); stem(z); xlabel('n'); ylabel('z(n)'); title('resultant signal signal');
  • 31. CONCLUSION: In this experiment correlation of various signals have been performed Using MATLAB Applications:it is used to measure the degree to which the two signals are similar and it is also used for radar detection by estimating the time delay.it is also used in Digital communication, defence applications and sound navigation Excersize questions: perform convolution between the following signals 1. X(n)=[1 -1 4 ], h(n) = [ -1 2 -3 1] 2. perform convolution between the. Two periodic sequences x1(t)=e-3t{u(t)-u(t-2)} , x2(t)= e -3t for 0 ≤ t ≤ 2
  • 32. EXP.NO: 7 VERIFICATION OF LINEARITY AND TIME INVARIANCE PROPERTIES OF A GIVEN CONTINUOUS /DISCRETE SYSTEM. Aim: To compute linearity and time invariance properties of a given continuous /discrete system EQUIPMENTS: PC with windows (95/98/XP/NT/2000). MATLAB Software Program1: clc; clear all; close all; n=0:40; a=2; b=1; x1=cos(2*pi*0.1*n); x2=cos(2*pi*0.4*n); x=a*x1+b*x2; y=n.*x; y1=n.*x1; y2=n.*x2; yt=a*y1+b*y2;
  • 33. d=y-yt; d=round( d) if d disp('Given system is not satisfy linearity property'); else disp('Given system is satisfy linearity property'); end subplot(3,1,1), stem(n,y); grid subplot(3,1,2), stem(n,yt); grid subplot(3,1,3), stem(n,d); grid Program2: clc; clear all; close all; n=0:40; a=2; b=- 3; x1=cos(2*pi*0.1*n) ; x2=cos(2*pi*0.4*n) ; x=a*x1+b*x2; y=x.^2; y1=x1.^2; y2=x2.^2; yt=a*y1+b*y2 ;
  • 34. d=y-yt; d=round(d ); if d disp('Given system is not satisfy linearity property'); else disp('Given system is satisfy linearity property'); end subplot(3,1,1), stem(n,y); grid subplot(3,1,2), stem(n,yt); grid subplot(3,1,3), stem(n,d); grid Program clc; close all; clear all; x=input('enter the sequence'); N=length(x); n=0:1:N-1;
  • 35. y=xcorr(x,x); subplot(3,1, 1); stem(n,x); xlabel(' n----->');ylabel('Amplitude--->'); title('input seq'); subplot(3,1,2); N=length(y); n=0:1:N-1; stem(n,y); xlabel('n---->');ylabel('Amplitude--- -.'); title('autocorr seq for input'); disp('autocorr seq for input'); disp(y) p=fft(y,N); subplot(3,1,3 ); stem(n,p); xlabel('K----->');ylabel('Amplitude--->'); title('psd of input'); disp('the psd fun:'); disp(p) Program1: clc; close all; clear all; n=0:40;
  • 36. D=10 ; x=3*cos(2*pi*0.1*n)-2*cos(2*pi*0.4*n); xd=[zeros(1,D) x]; y=n.*xd(n+D); n1=n+D; yd=n1.*x; d=y-yd; if d disp('Given system is not satisfy time shifting property'); else disp('Given system is satisfy time shifting property'); end subplot(3,1,1),stem(y),gri d; subplot(3,1,2),stem(yd),g rid; subplot(3,1,3),stem(d),gri d;
  • 37. Program 2: clc; close all; clear all; n=0:40; D=10; x=3*cos(2*pi*0.1*n)-2*cos(2*pi*0.4*n); xd=[zeros(1,D) x]; x1=xd(n+D); y=exp(x1); n1=n+D; yd=exp(xd(n1)); d=y-yd; if d disp('Given system is not satisfy time shifting property'); else disp('Given system is satisfy time shifting property'); end subplot(3,1,1),stem(y),gri d; subplot(3,1,2),stem(yd),g rid; subplot(3,1,3),stem(d),gri d;
  • 39. EXP.NO:8 COMPUTATION OF UNIT SAMPLE, UNIT STEP AND SINUSOIDAL RESPONSE OF THE GIVEN LTI SYSTEM AND VERIFYING ITS PHYSICAL REALIZABILITY AND STABILITY PROPERTIES. Aim: To Unit Step And Sinusoidal Response Of The Given LTI System And Verifying Its Physical Realizability And Stability Properties. EQUIPMENTS: PC with windows (95/98/XP/NT/2000). MATLAB Software %calculate and plot the impulse response and step response b=[1]; a=[1,-1,.9]; x=impseq(0,-20,120); n = [-20:120]; h=filter(b,a,x); subplot(3,1,1);stem(n,h); title('impulse response'); xlabel('n');ylabel('h(n)'); =stepseq(0,-20,120); s=filter(b,a,x); s=filter(b,a,x); subplot(3,1,2); stem(n,s); title('step response'); xlabel('n');ylabel('s(n)') t=0:0.1:2*pi; x1=sin(t); %impseq(0,-20,120); n = [-20:120]; h=filter(b,a,x1); subplot(3,1,3);stem(h); title('sin response'); xlabel('n');ylabel('h(n)'); figure; zplane(b,a);
  • 40.
  • 42. EXP.NO: 9 GIBBS PHENOMENON Aim: To verify the Gibbs Phenomenon. EQUIPMENTS: PC with windows (95/98/XP/NT/2000). MATLAB Software Gibbs Phenomina Program : t=0:0.1:(pi*8); y=sin(t); subplot(5,1,1); plot(t,y); xlabel('k'); ylabel('amplitude'); title('gibbs phenomenon'); h=2; %k=3; for k=3:2:9 y=y+sin(k*t)/k; subplot(5,1,h); plot(t,y); xlabel('k'); ylabel('amplitude'); h=h+1; end
  • 43. CONCLUSION: In this experiment Gibbs phenomenon have been demonstrated Using MATLAB
  • 44. EXP.NO: 10. FINDING THE FOURIER TRANSFORM OF A GIVEN SIGNAL AND PLOTTING ITS MAGNITUDE AND PHASE SPECTRUM Aim: to find the fourier transform of a given signal and plotting its magnitude and phase spectrum EQUIPMENTS: PC with windows (95/98/XP/NT/2000). MATLAB Software EQUIPMENTS: PC with windows (95/98/XP/NT/2000).
  • 45. MATLAB Software Program: clc; close all; clear all; x=input('enter the sequence'); N=length(x); n=0:1:N-1; y=fft(x,N) subplot(2,1,1); stem(n,x); title('input sequence'); xlabel('time index n----->'); ylabel('amplitude x[n]- ---> '); subplot(2,1,2); stem(n,y); title('output sequence'); xlabel(' Frequency index K---->'); ylabel('amplitude X[k]------>');
  • 46. FFT magnitude and Phase plot: clc close all x=[1,1,1,1,zeros(1,4)]; N=8; X=fft(x,N); magX=abs(X),phase=angle(X)*180/pi; subplot(2,1,1) plot(magX); grid xlabel('k') ylabel('X(K)') subplot(2,1,2) plot(phase);
  • 48. CONCLUSION: In this experiment the fourier transform of a given signal and plotting its magnitude and phase spectrum have been demonstrated using matlab
  • 49. Exp:11 LAPLACE TRNASFORMS Aim: To perform waveform synthesis using Laplece Trnasforms of a given signal Program for Laplace Transform: f=t syms f t; f=t; laplace(f) Program for nverse Laplace Transform f(s)=24/s(s+8) invese LT syms F s F=24/(s*(s+8)); ilaplace(F) y(s)=24/s(s+8) invese LT poles and zeros
  • 50. Signal synthese using Laplace Tnasform: clear all clc t=0:1:5 s=(t); subplot(2,3,1) plot(t,s); u=ones(1,6) subplot(2,3,2) plot(t,u); f1=t.*u; subplot(2,3,3) plot(f1); s2=-2*(t-1); subplot(2,3,4); plot(s2); u1=[0 1 1 1 1 1]; f2=-2*(t-1).*u1; subplot(2,3,5); plot(f2); u2=[0 0 1 1 1 1]; f3=(t-2).*u2; subplot(2,3,6); plot(f3); f=f1+f2+f3; figure; plot(t,f); % n=exp(-t); % n=uint8(n); % f=uint8(f); % R = int(f,n,0,6) laplace(f);
  • 51.
  • 52. CONCLUSION: In this experiment the Triangular signal synthesised using Laplece Trnasforms using MATLAB
  • 53. EXP.NO: 12 LOCATING THE ZEROS AND POLES AND PLOTTING THE POLE ZERO MAPS IN S-PLANE AND Z-PLANE FOR THE GIVEN TRANSFER FUNCTION. Aim: To locating the zeros and poles and plotting the pole zero maps in s-plane and z- plane for the given transfer function EQUIPMENTS: PC with windows (95/98/XP/NT/2000). MATLAB Software clc; close all clear all; %b= input('enter the numarator cofficients') %a= input('enter the denumi cofficients') b=[1 2 3 4] a=[1 2 1 1 ] zplane(b,a); Result: :
  • 54. EXP.NO: 13 13. Gaussian noise %Estimation of Gaussian density and Distribution Functions %% Closing and Clearing all clc; clear all; close all; %% Defining the range for the Random variable dx=0.01; %delta x x=-3:dx:3; [m,n]=size(x); %% Defining the parameters of the pdf mu_x=0; % mu_x=input('Enter the value of mean'); sig_x=0.1; % sig_x=input('Enter the value of varience'); %% Computing the probability density function px1=[]; a=1/(sqrt(2*pi)*sig_x); for j=1:n px1(j)=a*exp([-((x(j)-mu_x)/sig_x)^2]/2); end %% Computing the cumulative distribution function cum_Px(1)=0; for j=2:n cum_Px(j)=cum_Px(j-1)+dx*px1(j); end %% Plotting the results figure(1) plot(x,px1);grid axis([-3 3 0 1]); title(['Gaussian pdf for mu_x=0 and sigma_x=', num2str(sig_x)]); xlabel('--> x') ylabel('--> pdf') figure(2) plot(x,cum_Px);gri d axis([-3 3 0 1]); title(['Gaussian Probability Distribution Function for mu_x=0 and sigma_x=', num2str(sig_x)]); title('ite^{omegatau} = cos(omegatau) + isin(omegatau)') xlabel('--> x') ylabel('--> PDF')
  • 55. EXP.NO: 14 14. Sampling theorem verification Aim: To detect the edge for single observed image using sobel edge detection and canny edge detection. EQUIPMENTS: PC with windows (95/98/XP/NT/2000). MATLAB Software
  • 56. Figure 2: (a) Original signal g(t) (b) Spectrum G(w) δ (t) is the sampling signal with fs = 1/T > 2fm. Figure 3: (a) sampling signal δ (t) ) (b) Spectrum δ (w) Let gs(t) be the sampled signal. Its Fourier Transform Gs(w) isgiven by Figure 4: (a) sampled signal gs(t) (b) Spectrum Gs(w)
  • 57. To recover the original signal G(w): 1. Filter with a Gate function, H2wm(w) of width 2wm Scale it by T. Figure 5: Recovery of signal by filtering with a fiter of width 2wm Aliasing { Aliasing is a phenomenon where the high frequency components of the sampled signal interfere with each other because of inadequate sampling ws < 2wm. Figure 6: Aliasing due to inadequate sampling
  • 58. Aliasing leads to distortion in recovered signal. This is the reason why sampling frequency should be atleast twice thebandwidth of the signal. Oversampling { In practice signal are oversampled, where fs is signi_cantly higher than Nyquist rate to avoid aliasing. Figure 7: Oversampled signal-avoids aliasing t=-10:.01:10; T=4; fm=1/T; x=cos(2*pi*fm*t); subplot(2,2,1); plot(t,x); xlabel('time');ylabel('x(t)') title('continous time signal') grid; n1=-4:1:4 fs1=1.6*fm; fs2=2*fm; fs3=8*fm; x1=cos(2*pi*fm/fs1*n1); subplot(2,2,2); stem(n1,x1); xlabel('time');ylabel('x(n)') title('discrete time signal with fs<2fm') hold on subplot(2,2,2); plot(n1,x1) grid; n2=-5:1:5; x2=cos(2*pi*fm/fs2*n2); subplot(2,2,3); stem(n2,x2); xlabel('time');ylabel('x(n)') title('discrete time signal with fs=2fm') hold on subplot(2,2,3); plot(n2,x2) grid; n3=-20:1:20;
  • 59.
  • 60. x3=cos(2*pi*fm/fs3*n 3); subplot(2,2,4); stem(n3,x3); xlabel('time');ylabel('x( n)') title('discrete time signal with fs>2fm') hold on subplot(2,2 ,4); plot(n3,x3) grid; CONCLUSION: In this experiment the sampling theorem have been verified Using MATLAB
  • 61.
  • 63. REMOVAL OF NOISE BY AUTO CORRELATION/CROSS CORRELATION Aim: removal of noise by auto correlation/cross correlation EQUIPMENTS: PC with windows (95/98/XP/NT/2000). MATLAB Software a)auto correlation clear all clc t=0:0.1:pi*4; s=sin(t); k=2; subplot(6,1,1) plot(s); title('signal s'); xlabel('t'); ylabel('amplitude'); n = randn([1 126]); f=s+n; subplot(6,1,2) plot(f); title('signal f=s+n'); xlabel('t'); ylabel('amplitude'); as=xcorr(s,s); subplot(6,1,3) plot(as); title('auto correlation of s'); xlabel('t'); ylabel('amplitude'); an=xcorr(n,n); subplot(6,1,4) plot(an); title('auto correlation of n'); xlabel('t'); ylabel('amplitude'); cff=xcorr(f,f); subplot(6,1,5) plot(cff); title('auto correlation of f'); xlabel('t'); ylabel('amplitude'); hh=as+an; subplot(6,1,6) plot(hh); title('addition of as+an'); xlabel('t'); ylabel('amplitude');
  • 64. B)CROSS CORRELATION : clear all clc t=0:0.1:pi*4; s=sin(t); k=2; %sk=sin(t+k);
  • 65. subplot(7,1,1) plot(s); title('signal s');xlabel('t');ylabel('amplitude'); c=cos(t); subplot(7,1,2) plot(c); title('signal c');xlabel('t');ylabel('amplitude'); n = randn([1 126]); f=s+n; subplot(7,1,3) plot(f); title('signal f=s+n');xlabel('t');ylabel('amplitude'); asc=xcorr(s,c); subplot(7,1,4) plot(asc); title('auto correlation of s and c');xlabel('t');ylabel('amplitude'); anc=xcorr(n,c); subplot(7,1,5) plot(anc); title('auto correlation of n and c');xlabel('t');ylabel('amplitude'); cfc=xcorr(f,c); subplot(7,1,6) plot(cfc); title('auto correlation of f and c');xlabel('t');ylabel('amplitude'); hh=asc+anc; subplot(7,1,7) plot(hh); title('addition of asc+anc');xlabel('t');ylabel('amplitude'); 76
  • 67.
  • 68. EXP.No:16 Program: EXTRACTION OF Clear all; close all; clc; n=256; k1=0:n-1; P x=cos(32*pi*k1/n)+sin(48*pi*k1/n); E plot(k1,x) R %Module to find period of input signl k=2; I xm=zeros(k,1); ym=zeros(k,1); hold on O for i=1:k D [xm(i) ym(i)]=ginput(1); I plot(xm(i), ym(i),'r*'); C end period=abs(xm(2)-xm(1)); rounded_p=round(period); S m=rounded_p I % Adding noise and plotting noisy signal G N A L M A y=x+randn(1,n); S figure plot(k1,y) K E D B Y N O I S E U S I N G C O R R E L A T I O N Extraction of Periodic Signal Masked By Noise Using Correlation
  • 69. % To generate impulse train with the period as that of input signal d=zeros(1,n); for i=1:n if (rem(i-1,m)==0) d(i)=1; end end %Correlating noisy signal and impulse train cir=cxcorr1(y,d); %plotting the original and reconstructed signal m1=0:n/4; figure Plot (m1,x(m1+1),'r',m1,m*cir(m1+1));
  • 70.
  • 71. CONCLUSION: In this experiment the Weiner-Khinchine Relation have been verified using MATLAB.
  • 72. EXP.No:17 VERIFICATION OF WIENER–KHINCHIN RELATION AIM: Verification of wiener–khinchine relation EQUIPMENTS: PC with windows (95/98/XP/NT/2000). MATLAB Software PROGRAM: Clc clear all; t=0:0.1:2*pi; x=sin(2*t); subplot(3,2,1); plot(x); au=xcorr(x,x); subplot(3,2,2); plot(au); v=fft(au); subplot(3,2,3); plot(abs(v)); fw=fft(x); subplot(3,2,4); plot(fw); fw2=(abs(fw)).^2; subplot(3,2,5); plot(fw2); Result:
  • 73. EXP18. CHECKING A RANDOM PROCESS FOR STATIONARITY IN WIDE SENSE. AIM: Checking a random process for stationary in wide sense. EQUIPMENTS: PC with windows (95/98/XP/NT/2000). MATLAB Software MATLAB PROGRAM: Clear all Clc y = randn([1 40]) my=round(mean(y)); z=randn([1 40]) mz=round(mean(z)); vy=round(var(y)); vz=round(var(z)); t = sym('t','real'); h0=3; x=y.*sin(h0*t)+z.*cos(h0*t); mx=round(mean(x)); k=2; xk=y.*sin(h0*(t+k))+z.*cos(h0*(t+k)); x1=sin(h0*t)*sin(h0*(t+k)); x2=cos(h0*t)*cos(h0*(t+k)); c=vy*x1+vz*x1; % if we solve “c=2*sin (3*t)*sin (3*t+6)" we get c=2cos (6) % which is a costant does not depent on variable’t’ % so it is wide sence stationary Result: