Académique Documents
Professionnel Documents
Culture Documents
THEORY:
5. Unit Matrix: A=[aij]mxn such that aij=1 for i=j aij=0 for i≠j then A is called
unit matrix.
Ex:
SSIT Dept. of
ECE
BS LAB 2
SSIT Dept. of
ECE
BS LAB 3
6. Null Matrix: A=[aij]mxn such that aij=0 i and j then A is called zero or Null
matrix.
Ex:
SSIT Dept. of
ECE
BS LAB 4
OBSERVATIONS:
SSIT Dept. of
ECE
BS LAB 5
Triangular Matrix: In a square matrix all the elements below the principle
diagonal are zero then it is upper triangular matrix and if the element above the
diagonal is zero then that is lower triangular matrix.
Symmetric Matrix: If a matrix A=[aij] said to be symmetric if a ij=aij for every i
and thus A=AT
Skew Matrix: If a matrix A=[aij] and aij=-aij then that matrix is called skew
symmetric matrix .
Pi % Getting pi value.
Program (b):
SSIT Dept. of
ECE
BS LAB 6
OBSERVATIONS:
SSIT Dept. of
ECE
BS LAB 7
Program (f):
RESULT:
SSIT Dept. of
ECE
BS LAB 8
SSIT Dept. of
ECE
BS LAB 9
SSIT Dept. of
ECE
BS LAB 10
THEORY:
Square signal: It is just like a rectangular signal. But the width of the positive and
negative half cycles is same for square wave.
Saw tooth Signal: It is just like a sine wave. It has amplitude and angular
frequency.
Triangular Signal: It is similar to sawtooth. If the amplitude of sawtooth occur at
the middle of the cycle. It becomes triangular signal.
Rectangular Pulse: the unit rectangular pulse is centered about the y-axis i.e
about t=0.
Mathematically it is represented as
Rect(t)= 1 for -1/2≤t≤1/2 [unit amplitude and unit duration]
0 otherwise
SSIT Dept. of
ECE
BS LAB 11
SSIT Dept. of
ECE
BS LAB 12
Signum :
Mathematically it is representation
Ramp signal:
Mathematically it is representation
Unit impulse or delta Function: Due to unity area it is called as a unit impulse
function.
Mathematically it is representation
= 1 for t=0
0 for t≠0
Unit step signal: It has unit amplitude for zero or positive values of time t, and for
negative values of time amplitude is zero.
MODELWAVE FORMS:
SSIT Dept. of
ECE
BS LAB 13
OBSERVATIONS:
clc;
clear all;
close all;
t=0:0.01:2;
x=sin(2*pi*t);
subplot(2,1,1);
plot(t,x,'g');
xlabel('time');
ylabel('amplitude');
title('sinusoidal signal');
SSIT Dept. of
ECE
BS LAB 14
subplot(2,1,2);
stem(t,x,'r');
xlabel('time');
ylabel('amplitude');
title('sinusoidal sequence');
MODELWAVE FORMS:
OBSERVATIONS:
clc;
clear all;
close all;
t=0:0.01:2;
x=cos(2*pi*t);
SSIT Dept. of
ECE
BS LAB 15
subplot(2,1,1);
plot(t,x,'g');
xlabel('time');
ylabel('amplitude');
title('Cosine signal');
subplot(2,1,2);
stem(t,x,'r');
xlabel('time');
ylabel('amplitude');
title('Cosine sequence');
MODELWAVE FORMS:
OBSERVATIONS:
SSIT Dept. of
ECE
BS LAB 16
clc;
clear all;
close all;
t=0:0.01:2;
x=square(2*pi*t);
subplot(2,1,1);
plot(t,x,'g');
xlabel('time');
ylabel('amplitude');
title('square signal');
subplot(2,1,2);
stem(t,x,'r');
xlabel('time');
ylabel('amplitude');
title('square sequence');
MODELWAVE FORMS:
SSIT Dept. of
ECE
BS LAB 17
clc;
clear all;
close all;
t=0:0.01:2;
x=sawtooth(2*pi*5*t);
subplot(2,1,1);
plot(t,x,'g');
xlabel('time');
ylabel('amplitude');
title('sawtooth signal');
subplot(2,1,2);
stem(t,x,'r');
xlabel('time');
ylabel('amplitude');
title('sawtooth sequence');
MODELWAVE FORMS:
SSIT Dept. of
ECE
BS LAB 18
OBSERVATIONS:
clc;
clear all;
close all;
t=0:0.01:2;
x=sawtooth(2*pi*5*t,0.5);
subplot(2,1,1);
plot(t,x);
xlabel('time');
ylabel('amplitude');
title('trianguler signal');
subplot(2,1,2);
stem(t,x);
xlabel('time');
ylabel('amplitude');
title('trianguler sequence');
MODELWAVE FORMS:
SSIT Dept. of
ECE
BS LAB 19
OBSERVATIONS:
PROGRAM: GENERATION OF RECTANGULAR WAVE.
Amp=5;
t=-5:0.1:5;
Y=Amp*rectpuls(t,5);
subplot(3,3,1);
plot(t,Y);
xlabel ('time');
ylabel ('amplitude');
Amp=5;
t=-5:0.1:5;
Y=Amp*sign(t);
subplot(3,3,1);
plot(t,Y);
xlabel ('time');
ylabel ('amplitude');
MODELWAVE FORMS:
SSIT Dept. of
ECE
BS LAB 20
OBSERVATIONS:
PROGRAM: GENERATION OF A SINC FUNCTION.
Amp=5;
t=-5:0.1:5;
Y=Amp*sinc(t);
subplot(3,3,1);
plot(t,Y);
xlabel ('time');
ylabel ('amplitude');
SSIT Dept. of
ECE
BS LAB 21
n=input('RAMP');
t=0:5;
y=n*t;
subplot(3,3,1);
stem(y);
ylabel ('amplitude');
MODELWAVE FORMS:
OBSERVATIONS:
PROGRAM: GENERATION OF A IMPULSE FUNCTION.
k1=-5;
SSIT Dept. of
ECE
BS LAB 22
k2=5;
k=k1:k2;
y= (k==0)
Stem(y);
ylabel ('amplitude');
k1=-5;
k2=5;
k=k1:k2;
y= (k>=0)
Stem(y);
ylabel ('amplitude');
RESULT:
SSIT Dept. of
ECE
BS LAB 23
THEORY:
Sine wave:
A geometric wave form that oscillates periodically and in other words it is an s-
shaped smooth wave that oscillates above and below zero. It occurs often in
pure mathematics as well as physics, signal processing, electrical engineering.
It is represented as
x (t)=A sin( ]
t=0
The sine wave is important in physics. Because it retains its wave shapes when
added to another sine wave of the same frequency and arbitrary phase.
It is only the periodic wave form that has this property. This property leads
to its importance in Fourier analysis and make its acoustically unique. In
continuous-time sine wave representation
X (t) =A sin ( )
Where A=Amplitude
ω=Angular frequency
ω Here =frequency
X (t) =A sin
SSIT Dept. of
ECE
BS LAB 24
MODELWAVE FORMS:
OBSERVATIONS:
SSIT Dept. of
ECE
BS LAB 25
amp=5;
fre=5;
angf=2*pi*fre;
t=0:0.005:0.2;
X=amp*sin (angf*t);
subplot (3,3,1);
plot (t,X);
xlabel ('time');
ylabel ('amplitude');
title ('First sine wave');
Y=amp*sin (angf*t);
subplot (3,3,2);
plot (t,Y);
xlabel ('time');
ylabel ('amplitude');
title ('Second sine wave');
Z=X+Y;
subplot (3,3,3);
plot (t,Z);
xlabel ('time');
ylabel ('amplitude');
title ('Addition of two sine waves');
S=X-Y;
subplot (3,3,4);
plot (t,S);
xlabel ('time');
ylabel ('amplitude');
title ('Subtration of two sine waves');
M=X.*Y;
subplot (3,3,5);
plot (t,M);
xlabel ('time');
ylabel ('amplitude');
title ('Multiplication of two sine waves');
D=X/Y;
subplot (3,3,6);
plot (t,D);
xlabel ('time');
ylabel ('amplitude');
SSIT Dept. of
ECE
BS LAB 26
RESULT:
SSIT Dept. of
ECE
BS LAB 27
THEORY:
Time delay and Time advancing: Usually we represent time delay and advancing
by using step signal. We can represent time delay/advancing in both continuous
and discrete form.
Time compression: The axis is compressed. For example y(t)=x(2t), y(t) will be
compressed in time. That means the original signal is y(t)=x(t) so if we want to
get x(t) exactly we should reduce the time axis in case of y(t)=x(2t)
In continuous form:
Ex: y(t)=x(t)
if x(t)=x(2)
in case of y(t)=x(2t)
we get x(2) by taking as 1 so the time axis reduced from 2 to 1
In discrete form:
Ex: y(n)=x(2n)
Then we have
n=0 =>y(0)=x(0)=0
n=1 =>y(1)=x(2)=1
n=2 =>y(2)=x(4)=2
SSIT Dept. of
ECE
BS LAB 28
Thus the signal is compressed. Alternate samples of x(n) are skipped. This is also
called sub sampling.
Time Expansion: Time axis is expanded. For example y(t)=x(t/2). Here y(t) will be
expanded in time axis.
In continuous form:
Let us consider y(t)=x(t/2) the given signal is y(t)=x(t) for getting x(t) we
expand the time axis.
SSIT Dept. of
ECE
BS LAB 29
In discrete form:
Let us consider y(n)=x(n/2)
then we get y(0)=x(0)
y(2)=x(2/2)=x(1)
y(4)=x(4/2)=x(2) By increasing n values from 0 to A we
get the original values of given signal.
Amplitude Scaling:
Time folding: Time folding used in convolution. Let us consider the continuous
time signal x(t). Then its time folded signal is obtained by replacing t with –t
i.e y(t)=x(-t)
Let us consider a discrete time signal y(n)=x(-n) then n is replaced with –n gives
time folding of y(n)
y(n)=x(-n)
Important Rules for Time shifting and Time scaling
1. If a signal is given as x (t) =x (-at+b).
2. First we apply shifting operation.
3. Next apply scaling operation.
4. Next apply folding operation.
SSIT Dept. of
ECE
BS LAB 30
MODELWAVE FORMS:
OBSERVATIONS:
SSIT Dept. of
ECE
BS LAB 31
amp=5;
fre=5;
angf=2*pi*fre;
t=0:0.005:0.4;
X=amp*sin(angf*t);
subplot(3,3,1);
plot(t,X);
xlabel('time');
ylabel('amplitude');
title('original signal');
subplot(3,3,2);
plot(t-10,X);
xlabel('time');
ylabel('amplitude');
title('time right shift operation');
subplot(3,3,3);
plot(t+10,X);
xlabel('time');
ylabel('amplitude');
title('time left shift operation');
subplot(3,3,4);
plot(2*t,X);
xlabel('time');
ylabel('amplitude');
title('time expansion');
subplot(3,3,5);
SSIT Dept. of
ECE
BS LAB 32
plot(t/2,X);
xlabel('time');
ylabel('amplitude');
title('time compression');
MODELWAVE FORMS:
OBSERVATIONS:
SSIT Dept. of
ECE
BS LAB 33
amp=5;
fre=5;
angf=2*pi*fre;
t=0:0.005:0.4;
X=amp*sin(angf*t);
subplot(3,3,1);
plot(t,X);
xlabel('time');
ylabel('amplitude');
title('original signal');
subplot(3,3,2);
plot(t,2*X);
xlabel('time');
ylabel('amplitude');
title('amplitude expansion');
subplot(3,3,3);
plot(t,X/2);
xlabel('time');
ylabel('amplitude');
title('amplitude compression');
subplot(3,3,4);
SSIT Dept. of
ECE
BS LAB 34
plot(-t,X);
xlabel('time');
ylabel('amplitude');
title('time folding');
RESULT:
SSIT Dept. of
ECE
BS LAB 35
THEORY:
SSIT Dept. of
ECE
BS LAB 36
MODEL WAVEFORMS:
OBSERVATIONS:
SSIT Dept. of
ECE
BS LAB 37
PROGRAM:
amp=4;
f=1;
angf=2*pi*f;
t=0:0.005:2;
x=sin(angf*t)+cos(angf*t);
subplot(2,2,1);
plot(t,x);
xlabel('time');
ylabel('amplitude');
title('original signal');
y=sin(angf*-t)+cos(angf*-t);
subplot(2,2,2);
plot(t,y);
xlabel('time');
ylabel('amplitude');
title('original signal replace by -t');
z=(x+y)/2;
subplot(2,2,3);
plot(t,z);
xlabel('time');
ylabel('amplitude');
title('even part of the signal');
o=(x-y)/2;
subplot(2,2,4);
plot(t,o);
xlabel('time');
ylabel('amplitude');
title('odd part of the signal');
RESULT:
SSIT Dept. of
ECE
BS LAB 38
SSIT Dept. of
ECE
BS LAB 39
THEORY:
x1(t)*x2(t)= d
1. Folding
2. Multiplication
3. Addition
4. Shifting
SSIT Dept. of
ECE
BS LAB 40
MODEL WAVEFORMS:
OBSERVATIONS:
SSIT Dept. of
ECE
BS LAB 41
PROGRAM:
%Convolution of two signals%
clc;
clear all;
close all;
t=0:0.001:10;
x=sin(t);
h=square(t);
subplot(3,1,1);
plot(t,x,'g');
xlabel('time');
ylabel('amplitude');
title('sinusoidal signal');
subplot(3,1,2);
plot(t,h,'r');
xlabel('time');
ylabel('amplitude');
title('square function');
y=conv(x,h);
subplot(3,1,3);
plot(y);
xlabel('time');
ylabel('amplitude');
title('convolution signal');
%Convolution of two sequences%
clc;
clear all;
close all;
L=input('enter the length of 1st sequence');
M=input('enter the length of 2nd sequence');
x=input('enter the first sequence:x(n)=');
h=input('enter the second sequence:y(n)=');
N=0:(L+M-1);
y=conv(x,h);
subplot(3,1,1);
stem(x,'g');
xlabel('discrete time');
ylabel('x(n)');
title('1st sequence');
subplot(3,1,2);
stem(h,'r');
xlabel('discrete time');
ylabel('h(n)');
title('second sequence');
subplot(3,1,3);
stem(y);
xlabel('discrete time');
SSIT Dept. of
ECE
BS LAB 42
ylabel('y(n)');
title('convolution of two sequences');
RESULT:
SSIT Dept. of
ECE
BS LAB 43
THEORY:
Auto correlation:
Autocorrelation is the cross-correlation of a signal with itself. It is mathematical
tool for finding repeating patterns, such as the presence of periodic signal which
has been buried under noise, or identifying the missing fundamental frequency
in a signal implied by its harmonic frequencies. It is often used in signal
processing for analyzing functions or series of values such as time domain
signals.
SSIT Dept. of
ECE
BS LAB 44
MODEL WAVEFORMS:
OBSERVATIONS:
SSIT Dept. of
ECE
BS LAB 45
PROGRAM:-
clc;
clear all;
close all;
t=0:0.001:1;
x=cos(2*pi*3*t);
a=xcorr(x);
subplot(2,1,1);
plot(t,x,'g');
xlabel('time');
ylabel('amplitude');
title('input signal');
subplot(2,1,2);
plot(a,'r');
xlabel('time');
ylabel('amplitude');
title('auto correlation signal');
%cross correlation for a signal%
clc;
clear all;
close all;
t=0:0.001:1;
x=cos(2*pi*3*t);
y=cos(2*pi*5*t);
a=xcorr(x,y);
subplot(3,1,1);
plot(t,x,'g');
xlabel('time');
ylabel('amplitude');
title('1st signal');
subplot(3,1,2);
plot(t,y,'r');
xlabel('time');
ylabel('amplitude');
title('2nd signal');
subplot(3,1,3);
plot(a,'r');
xlabel('time');
ylabel('amplitude');
title('cross correlation signal');
SSIT Dept. of
ECE
BS LAB 46
x= 1 2 3 4
OBSERVATIONS:
SSIT Dept. of
ECE
BS LAB 47
RESULT:
SSIT Dept. of
ECE
BS LAB 48
SSIT Dept. of
ECE
BS LAB 49
i) y(t)=t*x(t)
ii) y(t)=x^2(t)
iii) y(t)=x(t^2)
THEORY:
Non linear system: For any nonlinear system, the principle of superposition
does not hold true and the equations.
f(a1x1(t)+ a2x2(t)≠ a1y1(t)+a2y2(t)
SSIT Dept. of
ECE
BS LAB 50
SSIT Dept. of
ECE
BS LAB 51
A system is time invariant if the input-output relationship does not vary with
time. This means that a system is time-invariant if its behavior and input-output
characteristics do not change with time. For time-invariant system, the time
shifting in the input signal results in corresponding time shifting in the output.
Mathematically
Let y(t)=f(x(t))
The equation means y(t) is response for x(t), if x(t) is delayed by time t 1, then
output y(t) will also be delayed by the same time
i.e f(x(t-t1))=y(t-t1)
For discrete time system this property is called shift invariance.
f(x(n-k))=y(n-k)
If any system does not satisfy the above equations then it is called time-variant
system.
Thus, if the input-output characteristics of a system changes with the time
then the system is known as the time varying system.
SSIT Dept. of
ECE
BS LAB 52
OBSERVATIONS:
i) z1 =
z2 =
SSIT Dept. of
ECE
BS LAB 53
PROGRAM:
y(t)=t*x(t)
a=4;
b=6;
t=1;
x(t)=0.5;
x1(t)=x(t);
x2(t)=x(t);
y1(t)=t*x1(t);
y2(t)=t*x2(t);
z1(t)=a*y1(t)+b*y2(t)
z2(t)=t*(a*x1(t)+b*x2(t))
if(z1==z2)
else
end;
SSIT Dept. of
ECE
BS LAB 54
OBSERVATIONS:
ii) z1 =
z2 =
SSIT Dept. of
ECE
BS LAB 55
PROGRAM:
y(t)=x^2(t)
a=2;
b=3;
t=1;
x(t)=0.5;
x1(t)=x(t)*x(t);
x2(t)=x(t)*x(t);
y1(t)=x1(t)*x1(t);
y2(t)=x2(t)*x2(t);
z1(t)=a*y1(t)+b*y2(t)
z2(t)=a*x1(t)+b*x2(t)
if(z1==z2)
else
end;
SSIT Dept. of
ECE
BS LAB 56
OBSERVATIONS:
iii) z1 =
z2 =
SSIT Dept. of
ECE
BS LAB 57
PROGRAM:
y(t)=x(t^2)
a=2;
b=3;
t=1;
x(t)=0.5;
x1(t)=x(t*t);
x2(t)=x(t*t);
y1(t)=x1(t*t);
y2(t)=x2(t*t);
z1(t)=a*y1(t)+b*y2(t)
z2 (t)=a*x1(t)+b*x2(t)
if (z1==z2)
else
end;
SSIT Dept. of
ECE
BS LAB 58
SSIT Dept. of
ECE
BS LAB 59
MODEL WAVEFORMS:
OBSERVATIONS:
SSIT Dept. of
ECE
BS LAB 60
SSIT Dept. of
ECE
BS LAB 61
SSIT Dept. of
ECE
BS LAB 62
THEORY:
LTI systems must satisfy two general properties, time invariance and linearity
1. x[n − k ] ↦−→ y [n − k ].
The step response of a discrete-time LTI system is the convolution of the unit
step with the impulse response:-
s[n]=u[n]*h[n].
That means s[n] is the response to the input h[n] of a discrete-time LTI system
with unit impulse response u[n].
The impulse response h[n] of an LTI system is just the response to an impulse:
SSIT Dept. of
ECE
BS LAB 63
MODEL WAVEFORMS:
OBSERVATIONS:
SSIT Dept. of
ECE
BS LAB 64
PROGRAM:
b=[1];
a=[1,-1,.9];
x=impulse(0,-20,120);
n = [-20:120];
h=filter(b,a,x);
subplot(3,1,1);
stem(h);
title('impulse response');
xlabel('n');
ylabel('h(n)');
step(0,-20,120);
s=filter(b,a,x);
s=filter(b,a,x);
subplot(3,1,2);
stem(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);
RESULT:
SSIT Dept. of
ECE
BS LAB 65
SSIT Dept. of
ECE
BS LAB 66
9. GIBBS PHENOMENON
AIM: To Write a MATLAB Program to demonstrate the Gibbs Phenomenon.
THEORY:
The Gibbs phenomenon involves both the fact that Fourier sums
overshoot at a jump discontinuity, and that this overshoot does not die
out as the frequency increases.
SSIT Dept. of
ECE
BS LAB 67
MODEL WAVEFORMS:
No. of Harmonics: 5
OBSERVATIONS:
SSIT Dept. of
ECE
BS LAB 68
PROGRAM:
clc;
clear all;
close all;
t=0:0.01:1;
N=input('enter no of harmonics');
x=square(2*pi*t);
plot(t,x);
hold on;
gp=0;
for n=1:2:N;
gp=gp+(4/(n*pi))*sin(2*pi*n*t);
end;
plot(t,gp);
hold off;
xlabel('time');
ylabel('amplitude');
title('gibbs phenomenon');
RESULT:
SSIT Dept. of
ECE
BS LAB 69
SSIT Dept. of
ECE
BS LAB 70
THEORY:
By definition
SSIT Dept. of
ECE
BS LAB 71
MODEL WAVEFORMS:-
Fourier Transform
Y= 1/(2+w*i)
Z= Heaviside(x)/exp(2*x)
OBSERVATIONS:
SSIT Dept. of
ECE
BS LAB 72
PROGRAM:-
%Fourier Transform%
clc
clear all;
close all;
syms t;
x=exp(-2*t)*heaviside(t);
subplot(3,1,1);
ezplot(x);
y=fourier(x);
disp('Fourier Transform of input signal');
y
z=ifourier(y);
disp('Inverse Fourier Transform of input signal');
z
mg=abs(y);
subplot(3,1,2);
ezplot(mg);
xlabel('time');
ylabel('amplitude');
title('magnitude spectrum of a input signal');
grid;
pha=atan(imag(y)/real(y));
subplot(3,1,3);
ezplot(pha);
xlabel('time');
ylabel('amplitude');
title('phasespectrum of a input signal');
grid;
RESULT:
SSIT Dept. of
ECE
BS LAB 73
SSIT Dept. of
ECE
BS LAB 74
THEORY:
SSIT Dept. of
ECE
BS LAB 75
OBSERVATIONS:
Laplace Transform
Y= 1/(s+2)
Z=1/exp(2*t)
SSIT Dept. of
ECE
BS LAB 76
PROGRAM:-
%Laplace Transform%
clc
clear all;
close all;
syms t;
x=exp(-2*t)*heaviside(t);
y=laplace(x);
z=ilaplace(y);
RESULT:
SSIT Dept. of
ECE
BS LAB 77
SSIT Dept. of
ECE
BS LAB 78
AIM: To write a MATLAB program to locating the zeros and poles and
plotting the pole zero maps in s-plane and z-plane for the given transfer
function.
THEORY:
Zeros:
The value(s) for z where the numerator of the transfer function
equals zero
The complex frequencies that make the overall gain of the filter
transfer function zero.
Poles:
SSIT Dept. of
ECE
BS LAB 79
SSIT Dept. of
ECE
BS LAB 80
Z-transforms
Bilateral Z-transform
Unilateral Z-transform
SSIT Dept. of
ECE
BS LAB 81
MODEL GRAPHS:
SSIT Dept. of
ECE
BS LAB 82
OBSERVATIONS:
PROGRAM:-
%locating poles of zero on s-plane%
clc;
clear all;
close all;
num=input('enter numerator co-efficients');
den=input('enter denominator co-efficients');
h=tf(num,den);
poles=roots(den);
zeros=roots(num);
sgrid;
pzmap(h);
grid on;
title('locating poles of zeros on s-plane');
RESULT:
SSIT Dept. of
ECE
BS LAB 83
SSIT Dept. of
ECE
BS LAB 84
THEORY:
SSIT Dept. of
ECE
BS LAB 85
MODEL WAVEFORMS:
OBSERVATIONS:
SSIT Dept. of
ECE
BS LAB 86
PROGRAM:
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);
grid
axis([-3 3 0 1]);
title(['Gaussian Probability Distribution Function for mu_x=0 and sigma_x=',
num2str(sig_x)]);
title('\ite^{\omega\tau} = cos(\omega\tau) + isin(\omega\tau)')
xlabel('--> x')
ylabel('--> PDF')
SSIT Dept. of
ECE
BS LAB 87
RESULT:
SSIT Dept. of
ECE
BS LAB 88
THEORY:
The signals we use in the real world, such as our voices, are called "analog"
signals. To process these signals in computers, we need to convert the signals
to "digital" form. While an analog signal is continuous in both time and
amplitude, a digital signal is discrete in both time and amplitude. To convert a
signal from continuous time to discrete time, a process called sampling is used.
The value of the signal is measured at certain intervals in time. Each
measurement is referred to as a sample.
If the signal contains high frequency components, we will need to sample
at a higher rate to avoid losing information that is in the signal. In general, to
preserve the full information in the signal, it is necessary to sample at twice the
maximum frequency of the signal. This is known as the Nyquist rate. The
Sampling Theorem states that a signal can be exactly reproduced if it is sampled
at a frequency F, where F is greater than twice the maximum frequency in the
signal.
When the signal is converted back into a continuous time signal, it will exhibit a
phenomenon called “Aliasing”. Aliasing is the presence of unwanted
components in the reconstructed signal. These components were not present
when the original signal was sampled. In addition, some of the frequencies in
the original signal may be lost in the reconstructed signal. Aliasing occurs
because signal frequencies can overlap if the sampling frequency is too low.
Frequencies "fold" around half the sampling frequency - which is why this
frequency is often referred to as the folding frequency.
A band limited signal x(t) with X(jΩ)=0 for |Ω|>Ωm is uniquely determined)=0 for |Ω|>Ωm is uniquely determinedΩ)=0 for |Ω|>Ωm is uniquely determined|Ω|>Ωm is uniquely determined>Ω)=0 for |Ω|>Ωm is uniquely determinedm is uniquely determined
from its samples x(nT),if the sampling frequency fs >= 2fm, i.e., sampling
frequency must be at least twice highest frequency present in the signal.
SSIT Dept. of
ECE
BS LAB 89
Nyquist rate: the minimum rate at which the signal can be sampled and still be
reconstructed from its samples is called nyquist rate. it is always equal to 2fm
where fm is the maximum frequency component present in the signal.
A signal sampled at greater than the nyquist rate is said to be “over
sampled”, a signal sampled at less than the nyquist rate is said to be “under
sampled”.
MODEL WAVEFORMS:
OBSERVATIONS:
SSIT Dept. of
ECE
BS LAB 90
PROGRAM:
close all;
clear all;
t=-10:0.01:10;
T=8;
fm=1/T;
x=cos(2*pi*fm*t);
fs1=1.2*fm;
fs2=2*fm;
fs3=8*fm;
n1=-4:1:4;
xn1=cos(2*pi*n1*fm/fs1);
subplot(221)
plot(t,x);
xlabel('time in seconds');
ylabel('x(t)');
title('continous time signal');
subplot(222)
stem(n1,xn1);
hold on;
plot(n1,xn1);
xlabel('n');
ylabel('x(n)');
title('discrete time signal with fs<2fm');
n2=-5:1:5;
xn2=cos(2*pi*n2*fm/fs2);
subplot(223)
stem(n2,xn2);
hold on;
plot(n2,xn2);
xlabel('n');
ylabel('x(n)');
title('discrete time signal with fs=2fm');
n3=-20:1:20;
xn3=cos(2*pi*n3*fm/fs3);
subplot(224)
stem(n3,xn3);
SSIT Dept. of
ECE
BS LAB 91
hold on;
plot(n3,xn3);
xlabel('n');
ylabel('x(n)');
title('discrete time signal with fs>2fm');
RESULT:
SSIT Dept. of
ECE
BS LAB 92
THEORY:
for all T
SSIT Dept. of
ECE
BS LAB 93
= Qss(T)+Qnn(T)+Qsn(T)+Qns(T)
The periodic signal s(t) and noise signal n(t) are uncorrelated
SSIT Dept. of
ECE
BS LAB 94
f(t)=s(t)+n(t)
= Qsc(T)+Qnc(T)
C(t) is periodic function and uncorrelated with the random noise signal
n(t). Hence Qnc(T0=0) Therefore Qfc(T)=Qsc(T)
SSIT Dept. of
ECE
BS LAB 95
MODEL WAVEFORMS:
AUTO CORRELATION
OBSERVATIONS:
SSIT Dept. of
ECE
BS LAB 96
PROGRAM:-
%AUTO CORRELATION%
clc;
clear all;
close all;
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');
SSIT Dept. of
ECE
BS LAB 97
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');
CROSS CORRELATION
OBSERVATIONS:
SSIT Dept. of
ECE
BS LAB 98
%CROSS CORRELATION %
clc;
clear all;
close all;
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);
SSIT Dept. of
ECE
BS LAB 99
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');
RESULT:
SSIT Dept. of
ECE
BS LAB
100
SSIT Dept. of
ECE
BS LAB
101
spectrum of the input times the power transfer function. This corollary is
used in the parametric method for power spectrum estimation.
MODEL WAVEFORMS:
SSIT Dept. of
ECE
BS LAB
102
OBSERVATIONS:
PROGRAM:-
clc;
clear all;
close all;
n=256;
k1=0:n-1;
x=cos(32*pi*k1/n)+sin(48*pi*k1/n);
plot(k1,x);
%Module to find period of input signal
k=2;
xm=zeros(k,1);
ym=zeros(k,1);
hold on;
for i=1:k
[xm(i) ym(i)]=ginput(1);
plot(xm(i), ym(i),'r*');
end;
period=abs(xm(2)-xm(1));
rounded_p=round(period);
m=rounded p;
SSIT Dept. of
ECE
BS LAB
103
figure;
plot(k1,y);
%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;
RESULT:
SSIT Dept. of
ECE
BS LAB
104
THEORY:
The Wiener‒Khinchin theorem (also known as the Wiener‒Khintchine
theorem and sometimes as the Wiener‒Khinchin‒Einstein theorem or the
Khinchin‒Kolmogorov theorem) states that the power spectral density of a
wide-sense-stationary random process is the Fourier transform of the
corresponding autocorrelation function. Continuous case:
Where
SSIT Dept. of
ECE
BS LAB
105
Discrete case:
Where
and is the power spectral density of the function with discrete values .
Being a sampled and discrete-time sequence, the spectral density is
periodic in the frequency domain.
MODEL WAVEFORMS:
Wiener‒khinchine relation
SSIT Dept. of
ECE
BS LAB
106
OBSERVATIONS:
PROGRAM:-
SSIT Dept. of
ECE
BS LAB
107
%wiener‒khinchine relation%
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:
SSIT Dept. of
ECE