Rakshk ASP Lab
Rakshk ASP Lab
Rakshk ASP Lab
Experiment No:-[1]
EXPERIMENT: - Generate basic signals using matlab.
SOFTWARE REQUIRED: - Matlab 7.12.0.
THEORY:1) The sine wave or sinusoid is a mathematical curve that describes a smooth repetitive oscillation.
L=sin(2*pi*f*t)
2) A square wave is a non-sinusoidal periodic waveform (which can be represented as an infinite
summation of sinusoidal waves), in which the amplitude alternates at a steady frequency between
fixed minimum and maximum values, with the same duration at minimum and maximum.
3) In mathematics, a function on the real numbers is called a step function (or staircase function) if
it can be written as a finite linear combination of indicator functions of intervals. Informally
speaking, a step function is a piecewise constant function having only finitely many pieces.
4) The ramp function is a unary real function, easily computable as the mean of the independent
variable and its absolute value.
6) The sawtooth wave (or saw wave) is a kind of non-sinusoidal waveform. It is so named based on
its resemblance to the teeth of a saw.
Department of Elect. and Comm. Engg. , Dr. B R Ambedkar National Institute of Technology, Jalandhar
Department of Elect. and Comm. Engg. , Dr. B R Ambedkar National Institute of Technology, Jalandhar
CONCLUSION: - The entire basic function performed successfully using MATLAB. Basic of
signals are revised and also the command sine, repmat familiarized.
Department of Elect. and Comm. Engg. , Dr. B R Ambedkar National Institute of Technology, Jalandhar
Experiment No:-[2]
EXPERIMENT:-Perform linear convolution of two sequences.
SOFTWARE REQUIRED: - Matlab 7.12.0.
THEORY:The convolution of f and g is written f g, using a star. It is defined as the integral of the product of
the two functions after one is reversed and shifted. As such, it is a particular kind of integral
transform.
Department of Elect. and Comm. Engg. , Dr. B R Ambedkar National Institute of Technology, Jalandhar
b=1
y=1
RESULTS: - We have successfully performed linear convolution of two sequence using matlab.
CONCLUSION: - The convolution of two sequences is done using matlab and result can be shown
in the above figure.
5
Department of Elect. and Comm. Engg. , Dr. B R Ambedkar National Institute of Technology, Jalandhar
Experiment No:-[3]
EXPERIMENT: - To perform cross correlation of two sequences using matlab.
SOFTWARE REQUIRED: - Matlab 7.12.0.
THEORY:The autocorrelation function of a random signal describes the general dependence of the values of
the samples at one time on the values of the samples at another time. Consider a random process
x(t) (i.e. continuous-time), its autocorrelation function is written as:
Department of Elect. and Comm. Engg. , Dr. B R Ambedkar National Institute of Technology, Jalandhar
CONCLUSION: - The cross correlation of two sequences is done using matlab and result can be
shown in the above figure.
Department of Elect. and Comm. Engg. , Dr. B R Ambedkar National Institute of Technology, Jalandhar
Experiment No:-[4]
EXPERIMENT: - To perform fast fourier transform (FFT) and inverse fast fourier transform using
matlab.
SOFTWARE REQUIRED: - Matlab 7.12.0.
THEORY:An FFT computes the DFT and produces exactly the same result as evaluating the DFT definition
directly; the most important difference is that an FFT is much faster. (In the presence of round-off
error, many FFT algorithms are also much more accurate than evaluating the DFT definition
directly, as discussed below.)
Let x0, ...., xN-1 be complex numbers. The DFT is defined by the formula
=
MATLAB CODE:% FFT and IFFT
clear all;
close all;
clc;
x=input('enter sequence');
y=fft(x);
subplot(2,1,1);
stem(abs(y));
xlabel('Time');
ylabel('Amplitude');
title('FFT');
z=ifft(y);
subplot(2,1,2)
stem(z);
xlabel('Time');
ylabel('Amplitude');
title('IFFT');
enter sequence [1 1 0 1 1 0 1 1]
Department of Elect. and Comm. Engg. , Dr. B R Ambedkar National Institute of Technology, Jalandhar
RESULTS: - We have successfully performed fast fourier transform (FFT) and inverse fast fourier
transform using matlab.
CONCLUSION: - The fast fourier transform and inverse fast fourier transform is done using matlab
and result can be shown in the above figure.
Department of Elect. and Comm. Engg. , Dr. B R Ambedkar National Institute of Technology, Jalandhar
Experiment No:-[5]
EXPERIMENT: - To perform fast Z-transform and inverse Z-transform using matlab.
SOFTWARE REQUIRED: - Matlab 7.12.0.
THEORY:The bilateral or two-sided Z-transform of a discrete-time signal x[n] is the formal power series
X(z) defined as
X(z) = { [ ]} =
[ ]
= A(cos + jsin )
x[n] =
{X(z)} =
X(z)zn 1 dz
10
Department of Elect. and Comm. Engg. , Dr. B R Ambedkar National Institute of Technology, Jalandhar
Experiment No:-[6]
EXPERIMENT: - To perform IIR Butterworth filter using matlab.
SOFTWARE REQUIRED: - Matlab 7.12.0.
THEORY:Butterworth filters are causal in nature and of various orders, the lowest order being the best
(shortest) in the time domain, and the higher orders being better in the frequency domain.
Butterworth or maximally flat filters have a monotonic amplitude frequency response which is
maximally flat at zero frequency response and the amplitude frequency response decreases
logarithmically with increasing frequency. The Butterworth filter has minimal phase shift over the
filter's band pass when comparied to other conventional filters.
1
( ) ( )=
1+
Department of Elect. and Comm. Engg. , Dr. B R Ambedkar National Institute of Technology, Jalandhar
12
Department of Elect. and Comm. Engg. , Dr. B R Ambedkar National Institute of Technology, Jalandhar
13
Department of Elect. and Comm. Engg. , Dr. B R Ambedkar National Institute of Technology, Jalandhar
14
Department of Elect. and Comm. Engg. , Dr. B R Ambedkar National Institute of Technology, Jalandhar
15
Department of Elect. and Comm. Engg. , Dr. B R Ambedkar National Institute of Technology, Jalandhar
16
Department of Elect. and Comm. Engg. , Dr. B R Ambedkar National Institute of Technology, Jalandhar
17
Department of Elect. and Comm. Engg. , Dr. B R Ambedkar National Institute of Technology, Jalandhar
Experiment No:-[7]
EXPERIMENT: - To perform IIR Chebyshev Type I filter using matlab.
SOFTWARE REQUIRED: - Matlab 7.12.0.
THEORY:Chebyshev filters are of two types: Chebyshev I filters are all pole filters which are equiripple in the
passband and are montonic in the stopband.
The frequency response of the filter is given by
1
| ( )| =
1 + ( )(( ) )
where
|x|
Department of Elect. and Comm. Engg. , Dr. B R Ambedkar National Institute of Technology, Jalandhar
19
Department of Elect. and Comm. Engg. , Dr. B R Ambedkar National Institute of Technology, Jalandhar
20
Department of Elect. and Comm. Engg. , Dr. B R Ambedkar National Institute of Technology, Jalandhar
21
Department of Elect. and Comm. Engg. , Dr. B R Ambedkar National Institute of Technology, Jalandhar
RESULTS: - We have successfully performed IIR Chebyshev Type I filter using matlab.
CONCLUSION: - The IIR Chebyshev Type I filter is done using matlab and result can be shown in
the above figure.
22
Department of Elect. and Comm. Engg. , Dr. B R Ambedkar National Institute of Technology, Jalandhar
Experiment No:-[8]
EXPERIMENT: - To perform IIR Chebyshev Type II filter using matlab.
SOFTWARE REQUIRED: - Matlab 7.12.0.
THEORY:Chebyshev II filters contain both poles and zeros exhibiting a montonic behavior in the passband
and equi-ripple in the stopband.
The frequency response of the filter is given by
1
| ( )| =
1 + ( )(( ) )
where
|x|
Department of Elect. and Comm. Engg. , Dr. B R Ambedkar National Institute of Technology, Jalandhar
24
Department of Elect. and Comm. Engg. , Dr. B R Ambedkar National Institute of Technology, Jalandhar
25
Department of Elect. and Comm. Engg. , Dr. B R Ambedkar National Institute of Technology, Jalandhar
26
Department of Elect. and Comm. Engg. , Dr. B R Ambedkar National Institute of Technology, Jalandhar
RESULTS: - We have successfully performed IIR Chebyshev Type II filter using matlab.
CONCLUSION: - The IIR Chebyshev Type II filter is done using matlab and result can be shown
in the above figure.
27
Department of Elect. and Comm. Engg. , Dr. B R Ambedkar National Institute of Technology, Jalandhar
Experiment No:-[9]
EXPERIMENT: - To perform Low Pass Filtering of Noise Signal using matlab.
SOFTWARE REQUIRED: - Matlab 7.12.0.
THEORY:The Low Pass Filter removes higher frequency components above cut off frequency. We take sine
wave signal and for adding noise another sine wave signal add in first signal. To remove the noise
means high frequency use Low Pass Filter which removes higher frequency components above cut
off frequency.
MATLAB CODE:% Low Pass Filtering of Noise Signal
close all;
clear all;
clc;
t=0:0.001:1;
fs=200;
wc=6;
wc=2*wc/fs;
x=sin(2*pi*10*t);
y=x+sin(2*pi*50*t);
b=fir1(48,wc);
freqz(b,1,512);
a=filter(b,1,y);
subplot(3,1,1);
plot(x);
subplot(3,1,2);
plot(y);
subplot(3,1,3);
plot(a);
28
Department of Elect. and Comm. Engg. , Dr. B R Ambedkar National Institute of Technology, Jalandhar
RESULTS: - We have successfully performed Low Pass Filtering of Noise Signal using matlab.
CONCLUSION: - The done Low Pass Filtering of Noise Signal using matlab and result can be
shown in the above figure.
29
Department of Elect. and Comm. Engg. , Dr. B R Ambedkar National Institute of Technology, Jalandhar