You are on page 1of 50

M.

KUMARASAMY COLLEGE OF ENGINEERING (AUTONOMOUS),


KARUR

DEPARTMENT OF ELECTRONICS & COMMUNICATION


ENGINEERING

LABORATORY MANUAL CUM RECORD NOTEBOOK

18ECC301JL /DIGITAL SIGNAL PROCESSING LABORATORY

ACADEMIC YEAR-(2023-2024)

REGULATION 2018

III - YEAR / V - SEMESTER

B.E-ECE-BATCH (2021-2025)

18ECC301J - DIGITAL SIGNAL PROCESSING LAB


M.KUMARASAMY COLLEGE OF ENGINEERING (AUTONOMOUS),
KARUR

List of Experiments

Ex.No. Name of the Experiment CO


Computation of DFT of a signal using basic equation and FFT & power spectrum estimation using
1 CO1
DFT.

2 Spectral analysis using DFT CO1

3 Compute Convolution for longer sequence CO1

4 Design of IIR filters using Bilinear Transformation CO2


5 Design of FIR filter using windowing method CO2

6 Compute and calculate the dead band for a second order system CO3

7 Design and compute the upsampling and downsampling CO4


TMS PROGRAMS

8 Arithmetic operations using processor CO5

9 Generation of Square and saw tooth waveforms using processor CO5

Content beyond the syllabus (Additional experiments)

Ex.No. Name of the Experiment CO


10 Output quantization noise for Cascade realization CO3
11 Multistage Implementation of sampling rate conversion CO4

18ECC301J - DIGITAL SIGNAL PROCESSING LAB


M.KUMARASAMY COLLEGE OF ENGINEERING (AUTONOMOUS),
KARUR
INTRODUCTION TO SCILAB

Scilab is a scientific software package for numerical computations providing a powerful open computing
environment for engineering and scientific applications. Developed since 1990 by researchers from INRIA
(French National Institute for Research in Computer Science and Control) and ENPC (National School of
Bridges and Roads), it is now maintained and developed by Scilab Consortium since its creation in May
2003 and integrated into Digiteo Foundation in July 2008. The current version is 5.2.1 (February 2010).
Since 1994 it is distributed freely along with source code through the Internet and is currently being used in
educational and industrial environments around the world. From version 5 it is released under the GPL
compatible CeCILL license. Scilab includes hundreds of mathematical functions with the possibility to add
interactively functions from various languages (C, Fortran...). It has sophisticated data structures (including
lists, polynomials, rational functions, linear systems...), an interpreter and a high level programming
language. Scilab has been designed to be an open system where the user can define new data types and
operations on these data types by using overloading.
A number of toolboxes are available with the system:
• 2-D and 3-D graphics, animation
• Linear algebra, sparse matrices
• Polynomials and rational functions
• Simulation: ODE solver and DAE solver
• Scicos: a hybrid dynamic systems modeler and simulator
• Classic and robust control, LMI optimization
• Differentiable and non-differentiable optimization
• Signal processing
• Metanet: graphs and networks
• Parallel Scilab using PVM
• Statistics
• Interface with Computer Algebra (Maple, MuPAD)
• Interface with Tcl/Tk
• And a large number of contributions for various domains.

18ECC301J - DIGITAL SIGNAL PROCESSING LAB


M.KUMARASAMY COLLEGE OF ENGINEERING (AUTONOMOUS),
KARUR

EX.NO.1 COMPUTATION OF DFT USING BASIC EQUATION, FFT AND POWER SPECTRUM
ESTIMATION USING DFT
DATE:

AIM:
To write and execute the SCILAB programs for computation of DFT, FFT and power spectrum
estimation

APPARATUS REQUIRED:
SCILAB with PC

THEORY

Let X(ejw) be discrete time Fourier transform of the discrete time signal x(n). The discrete Fourier transform
(DFT) of x(n) is obtained by sampling one period of the discrete time Fourier transform X(e jw) at a finite
number of frequency points. Let, x(n) = Discrete time signal of length L and X(k) = DFT of x(n)

The plot of samples of magnitude sequence versus k is called magnitude spectrum and the plot of samples of
phase sequence versus k is called phase spectrum. In general, these plots are called frequency spectrum

PROGRAM:

//Program for Computing DFT and IDFT


clc;clear;
x=[1 2 1 -2 1 3 1 -3];
N= 8;
k=0:N-1;
X=clean(fft(x));
x_inv=clean(ifft(X));
disp(x,'x(n)=');
disp(X,'X(k)=');
disp(x_inv,'Inverse of X');

//Plot the input sequence


subplot(1,3,1);
plot2d3(k,x);
xlabel('n-->');
ylabel('Amplitude of x(n)');
title('Input Sequence');

18ECC301J - DIGITAL SIGNAL PROCESSING LAB


M.KUMARASAMY COLLEGE OF ENGINEERING (AUTONOMOUS),
KARUR
//Plot the magnitude Spectrum
X1=abs(X);
subplot(1,3,2);
plot2d3(k,X1);
xlabel('K-->');
ylabel('Magnitude of X(K)');
title('Magnitude Plot');

//Plot the Phase Spectrum


X2=atan(X);
subplot(1,3,3);
plot2d3(k,X2);
xlabel('K-->');
ylabel('phase of X(K)');
title('Phase Plot');

OUTPUT:

18ECC301J - DIGITAL SIGNAL PROCESSING LAB


M.KUMARASAMY COLLEGE OF ENGINEERING (AUTONOMOUS),
KARUR

RESULT :

18ECC301J - DIGITAL SIGNAL PROCESSING LAB


M.KUMARASAMY COLLEGE OF ENGINEERING (AUTONOMOUS),
KARUR
Viva – Voce Questions

1. Write the analysis and synthesis equations of DFT?

The analysis equation is the direct transform given by

K=0,1,2,3….N-1
The synthesis equation is the direct transform given by
n=0,1,2,3….N-1

2. State Sampling theorem.


A band limited signals of finite energy which has no frequency component higher than fm Hz is
uniquely determined by its value at uniform interval less than 1/2fm second apart.
fs≥2fm,where fm=modulating frequency ,fs=sampling frequency

3. What is the necessary and sufficient condition for the impulse response to be
stable? The necessary and sufficient condition for the impulse response is
given by

4.What is meant by aliasing. & What are the effects of aliasing


When a band limited signal x(t) is sampled with sampling frequency of Fs < 2Fm, then X(jΩ)is
having spectral overlapping. Ie). high frequency interferes with low frequency and appears as low
frequency then the phenomenon is called aliasing.

5. How can we improve the frequency


resolution? By zero padding
Increasing the spacing between frequency samples Δf which increases record length
tr = Δf.
Increasing the Number of points N ≥ 2fm / Δf
6. Establish the relation between DFT and Z- transform.
X(z) = X(K)/ z= ej2πk/N

7. What is Fast Fourier Transform (FFT)?


The "Fast Fourier Transform" (FFT) is an important measurement method in the science of audio
and acoustics measurement. It converts a signal into individual spectral components and thereby
provides frequency information about the signal.

18ECC301J - DIGITAL SIGNAL PROCESSING LAB


M.KUMARASAMY COLLEGE OF ENGINEERING (AUTONOMOUS),
KARUR

8. What are the applications of FFT algorithm?


The applications of FFT algorithm includes
(i) Linear filtering
(ii) Correlation and pattern recognition
(iii) Spectrum analysis
(iv) Image analysis, image filtering, image reconstruction and image compression

9.Distinguish between DFT and DTFT.


DFT
 Obtained by performing sampling operation in both the time and frequency domains.
 Discrete frequency spectrum

DTFT
 Sampling is performed only in time domain.
 Continuous function of ω

Mark Allocation
Marks Marks
Sl.No. Details
Allotted Awarded
1 Preparation 30

2 Experimental Demonstration 30

3 Verification 20

4 Result 10

5 Viva-Voce 10

Total 100

Signature of the Faculty with Date

18ECC301J - DIGITAL SIGNAL PROCESSING LAB


M.KUMARASAMY COLLEGE OF ENGINEERING (AUTONOMOUS),
KARUR

EX.NO: 2 SPECTRUM ANALYSIS USING DFT


DATE:

AIM:

To Write a SCILAB Program to analyse spectrum using DFT.

APPARATUS REQUIRED:

SCILAB With PC

THEORY:

The discrete Fourier transform (DFT) maps a nite number of discrete time-domain samples to the same
number of discrete Fourier-domain samples. Being practical to compute, it is the primary transform applied
to real-world sampled data in digital signal processing. The DFT has special relationships with the discrete-
time Fourier transform and the continuous-time Fourier transform that let it be used as a practical
approximation of them through truncation and windowing of an in nite-length signal. Di erent window
functions make various tradeo s in the spectral distortions and artifacts introduced by DFTbased spectrum
analysis.

PROGRAM:
clc;
clear;
close;
fm=10;
fs=125;
m=2;
t=0.0001:1/fs:m/fm;
x=3*cos(2*%pi*fm*t);
N=(m*fs/fm);
for k=1:N
X1(k)=0;
for n=1:length(x)
X1(k)=X1(k)+x(n).*exp((-%i).*2.*%pi.*(n-1).*(k-1)./N);
end
end
k=0:N-1
f=k*fs/N;

18ECC301J - DIGITAL SIGNAL PROCESSING LAB


M.KUMARASAMY COLLEGE OF ENGINEERING (AUTONOMOUS),
KARUR
subplot(2,2,1);
plot2d3(t,x);
xlabel('time');
ylabel('x(n)');
title('No Leakage: m=2, f=10 and Fs=125Hz');
subplot(2,2,2);
plot2d3(f,abs(X1));
xlabel('freq in Hz');
ylabel('Mag');
title('Magnitude plot');

m=10;
fs=125;
m=2.5;
t=0.0001:1/fs:m/fm;
x=3*cos(2*%pi*fm*t);
N=(m*fs/fm);
for k=1:N
X1(k)=0;
for n=1:length(x)
X1(k)=X1(k)+x(n).*exp((-%i).*2.*%pi.*(n-1).*(k-1)./N);
end
end
k=0:N-1;
f=k*fs/N;

subplot(2,2,3);
plot2d3(t,x);
xlabel ('time');
ylabel ('x(n)');
title('Spectral Leakage :m=2.5, f=10 and Fs=125Hz');

subplot(2,2,4);
plot2d3(f, abs(X1));
xlabel('freq in Hz');
ylabel('Mag');
title('Magnitude plot');

18ECC301J - DIGITAL SIGNAL PROCESSING LAB


M.KUMARASAMY COLLEGE OF ENGINEERING (AUTONOMOUS),
KARUR

OUTPUT:

RESULT:

18ECC301J - DIGITAL SIGNAL PROCESSING LAB


M.KUMARASAMY COLLEGE OF ENGINEERING (AUTONOMOUS),
KARUR
Viva – Voce Questions

1. What is zero padding? What are its uses?


Let the sequence x(n) has a length L. If we want to find the N-point DFT(N>L) of the sequence
x(n), we have to add (N-L) zeros to the sequence x(n). This is known as zero padding.
The uses of zero padding are
1) We can get better display of the frequency spectrum.
2) With zero padding the DFT can be used in linear filtering.

2. Distinguish between linear and circular convolution of two sequences.

Linear convolution Circular convolution

1.If x(n) is a sequence of L number of If x(n) is a sequence of L number of samples


samples and
and h(n) with M number of samples, after h(n) with M number of samples, after
convolution y(n) will contain N= L+M-1 convolution y(n) will contain N= Max(L,M)
samples. samples.
2. Linear convolution can be used to find Circular convolution cannot be used to find
the response of a linear filter. the response of a linear filter.

Zero padding is necessary to find the response


3. Zero padding is not necessary to find of
the response of a linear filter. a linear filter.

3. What is meant by sectioned convolution?


If the data sequence x(n) is of long duration, it is very difficult to obtain the output
sequence y(n) due to limited memory of a digital computer. Therefore, the data sequence is
divided into smaller sections. These sections are processed separately one at a time and
combined later to get the output.

4. What are the two methods used for the sectioned convolution?
The two methods used for the sectioned convolution are
(1) the overlap-add method and
(2) overlap- save method.

5. Write briefly about overlap-add method?


In this method the size of the input data block x i(n) is L. To each data block we append M-
1 zeros and perform N-point (N = L+ M-1) circular convolution of x i(n) with h(n). Since
each data block is terminated with M-1 zeros, the last M-1 points from each output block
must be overlapped and added to first M-1 points of the succeeding block. Hence, this
method is called overlap-add method.
18ECC301J - DIGITAL SIGNAL PROCESSING LAB
M.KUMARASAMY COLLEGE OF ENGINEERING (AUTONOMOUS),
KARUR

6. What is overlap-save method?


In this method the data sequence is divided into N point sections xi(n).Each section contains the last
M-1 data points of the previous section followed by L new data points to form a data sequence of
length N=L+M-1.In circular convolution of xi(n) with h(n) the first M-1 points will not agree with
the linear convolution of xi(n) and h(n) because of aliasing, the remaining points will agree with
linear convolution. Hence we discard the first (M-1) points of filtered section xi(n) N h(n). This
process is repeated for all sections and the filtered sections are abutted together.

7. Compare Overlap Add and Overlap Save method

S.No Overlap Add method Overlap Save method

1 The size of the input data block is L The size of the input data block is N=L+M-1

2 Each data block is L point and we append M-1 Each data block consists of the last M-1 data
zeros to compute N point DFT points of previous data block followed by L new
data point
3 In this no corruption due to aliasing, as linear In each output block M-1 points are corrupted
convolution is performed using circular due to aliasing, as circular convolution is
convolution. employed.
4 To get output sequence, the last M-1 points To get output sequence, the first M-1 points from
from each output block is added to first M-1 each output block is data are fitted together.
points of succeeding block.

8. What are the steps involved in calculating convolution sum?


The steps involved in calculating sum are
· Folding
· Shifting
· Multiplication
· Summation

9. What is zero padding? What are its uses?


Let the sequence x(n) has a length L. If we want to find the N-point DFT(N>L) of the sequence x(n),
we have to add (N-L) zeros to the sequence x(n). This is known as zero padding.
The uses of zero padding are
1. Get better display of the frequency spectrum.
2. With zero padding the DFT can be used in linear filtering.

10. Why the computations in FFT algorithm is said to be in place?


Once the butterfly operation is performed on a pair of complex numbers (a,b) to produce (A,B),there
is no need to save the input pair.

18ECC301J - DIGITAL SIGNAL PROCESSING LAB


M.KUMARASAMY COLLEGE OF ENGINEERING (AUTONOMOUS),
KARUR

Mark Allocation
Marks Marks
Sl.No. Details
Allotted Awarded
1 Preparation 30

2 Experimental Demonstration 30

3 Verification 20

4 Result 10

5 Viva-Voce 10

Total 100

Signature of the Faculty with Date

18ECC301J - DIGITAL SIGNAL PROCESSING LAB


M.KUMARASAMY COLLEGE OF ENGINEERING (AUTONOMOUS),
KARUR
EX.NO: 3 COMPUTE CONVOLUTION FOR LONGER SEQUENCE
DATE:
AIM:

To Write a SCILAB Program to perform convolution for longer sequence

APPARATUS REQUIRED:

SCILAB With PC

THEORY:

Suppose, the input sequence x(n) of long duration is to be processed with a system having finite duration
impulse response by convolving the two sequences. Since, the linear filtering performed via DFT involves
operation on a fixed size data block, the input sequence is divided into different fixed size data block before
processing.

The successive blocks are then processed one at a time and the results are combined to produce the net
result.

As the convolution is performed by dividing the long input sequence into different fixed size sections, it is
called sectioned convolution. A long input sequence is segmented to fixed size blocks, prior to FIR filter
processing.

PROGRAM:

clc;clear;close;
h=[1,2];
x=[1,2,-1,2,3,-2,-3,-1,1,1,2,-1];
M=length(h); //length of impulse response
L=2^M; //length of FFT/IFFT operation
N=L-M+1;
xl=length(x);
K=ceil(xl/N); //number of iterations
h=[h zeros(1,L-M)];
x=[x x(1:K*N-xl)];
H=fft(h);
y=zeros(1,M-1);
for k=0:K-1
xk=[x(k*N+1:(k+1)*N) zeros(1,M-1)];
Xk=fft(xk);
Yk=H.*Xk;
yk=ifft(Yk);
yk=clean(yk);
18ECC301J - DIGITAL SIGNAL PROCESSING LAB
M.KUMARASAMY COLLEGE OF ENGINEERING (AUTONOMOUS),
KARUR
y=[y(1:k*N) y(k*N+1:k*N+M-1)+yk(1:M-1) yk(M:L)];
disp(k+1,'Segment =');
disp(h,'h(n)=');
disp(xk,'xk(n)=');
disp(yk,'yk(n)=');
end
y=y(1:xl+M-1);
disp(y,'Output Sequence is y(n): ');

OUTPUT:

RESULT:

18ECC301J - DIGITAL SIGNAL PROCESSING LAB


M.KUMARASAMY COLLEGE OF ENGINEERING (AUTONOMOUS),
KARUR
Viva – Voce Questions

1. What are the methods to compute the convolution sum of two sequences?
The methods to compute the convolution sum of two sequences
are:
Graphical method
Tabular array method
Tabular method
Matrices method
Sum-by-column method
The flip, shift, multiply and sum method.

2. What are the methods of finding deconvolution?


Deconvolution may be found using the following methods:
Polynomial division method
Recursion method
Tabular method.

3. What are the methods of finding circular convolution?


The methods of finding circular convolution are:
Concentric circle method (Graphical method)
Tabular array method
Matrices method
DFT method

3. How do you obtain a periodic extension of a non-periodic signal?


For finite-length sequences, one way of finding one period of the periodic extension is to wrap-
around N-sample sections of x(n) and add them all up. If x(n) is shorter than N, one period of its
periodic extension is obtained simply by padding x(n) with enough zeros to increase its length to N.
5. What is correlation?
Correlation is a measure of similarity between two signals and is found using a process similar to
convolution. The correlation of two signals is equal to the convolution of one signal with the flipped
version of the second signal.

6. What is cross-correlation?
The correlation of two different signals is called cross-correlation.

7. What is the use of correlation?


Correlation is an effective method of detecting signals buried in noise.

8. Where does the autocorrelation function attain its maximum value?


The autocorrelation function attains its maximum value at the origin, i.e. at n = 0.

9. What is autocorrelation?
18ECC301J - DIGITAL SIGNAL PROCESSING LAB
M.KUMARASAMY COLLEGE OF ENGINEERING (AUTONOMOUS),
KARUR
The correlation of a signal with itself is called autocorrelation. It gives a measure of similarity
between a sequence and its shifted version.

10. What is discrete convolution?


The convolution of discrete-time signals is called discrete convolution.
Discrete-time convolution is a method of finding the zero-state response of relaxed linear time-
invariant systems.

Mark Allocation
Marks Marks
Sl.No. Details
Allotted Awarded
1 Preparation 30

2 Experimental Demonstration 30

3 Verification 20

4 Result 10

5 Viva-Voce 10

Total 100

Signature of the Faculty with Date


18ECC301J - DIGITAL SIGNAL PROCESSING LAB
M.KUMARASAMY COLLEGE OF ENGINEERING (AUTONOMOUS),
KARUR

EX.NO: 4 DESIGN OF IIR FILTERS USING BILINEAR TRANSFORMATION


DATE:
AIM:

To write an SCILAB program to design of IIR filters using bilinear transformation

APPARATUS REQUIRED:

SCILAB With PC

THEORY
The infinite impulse response is a type of digital filter that is used in Digital Signal Processing applications.
A filter’s job is to allow certain types of signals to pass and block the rest. The infinite impulse response
filter is unique because it uses a feedback mechanism. It requires current as well as past output data. Though
they are harder to design, IIR filters are computationally efficient and generally cheaper.

Methods to design an Infinite Impulse Response filter

1. Direct method – Designing analog filters and then converting them to digital.
2. Approximation of derivatives method – Approximating a differential equation (continuous-time
(d/dt)) by an equivalent difference equation. We have covered the approximation of derivatives
method to design IIR filters here.
3. Impulse invariance method – simple s-plane to z-plane mapping. The impulse invariance method to
design IIR filters is covered here.
4. Bilinear Transformation method (BLT) – An improvement over the impulse invariance method. We
have covered the Bilinear transform method to design IIR filters here.
5. Approximation of standard analog filters – Butterworth, Chebyshev, and Elliptic analog filter
designs can be approximated as IIR filters. These analog filters have an infinite response too.
6. Spectral transformation – We can create different types of digital IIR filters using a digital IIR low
pass filter via the spectral transformation method.

18ECC301J - DIGITAL SIGNAL PROCESSING LAB


M.KUMARASAMY COLLEGE OF ENGINEERING (AUTONOMOUS),
KARUR
PROGRAM:
clc;clear;close;
rp=0.9 //passband ripple
rs=0.2 //stopband ripple wp=
%pi/2; //passband frequency
ws=3*%pi/4; //stopband frequency
T=1;
fp=2/T*tan(wp/2);
fs=2/T*tan(ws/2);
s=poly(0,'s');
z=poly(0,'z');
hs=1;
//Calculating the order of filter
num=log((rs^-2 -1)/(rp^-2 -1));
den=2*log(fs/fp);
disp(' order of filter');
N=ceil(num/den)
//Calculation of cut-off frequency
fc=fp/(rp^-2 -1)^(0.5/N);

//Calculating filter response


if modulo(N,2)==1 then
hs=hs*fc/(s+fc);
end
for k=1:N/2
b=2*sin((2*k-1)*%pi/(2*N));
hs=hs*fc^2/(s^2+b*fc*s+fc^2);
end
hs=clean(hs);
sys=syslin('c',hs);
disp(hs, ' Analog Transfer Function H(s):');
hz=ss2tf(cls2dls(tf2ss(sys),T)); //converting H(s) to H(z)

//Displaying filter response


[hzm,fr]=frmag(hz,256);
disp(hz,'Filter Transfer function H(Z):
'); plot(fr,hzm);
title('Lowpass Butterworth Filter
Response'); ylabel('Amplitude-->');
xlabel('Normalised frequency f/fs-->');

18ECC301J - DIGITAL SIGNAL PROCESSING LAB


M.KUMARASAMY COLLEGE OF ENGINEERING (AUTONOMOUS),
KARUR

OUTPUT

RESULT:

18ECC301J - DIGITAL SIGNAL PROCESSING LAB


M.KUMARASAMY COLLEGE OF ENGINEERING (AUTONOMOUS),
KARUR
Viva – Voce Questions

1. What are the different types of filter based on impulse response?


1. IIR-infinite impulse response 2. FIR-finite impulse response
2. Distinguish between FIR & IIR?
FIR IIR
i) Easily designed to have perfect linear phase. These filter do not have linear phase.

ii) FIR filter can be realized in both recursive & non- IIR filter are easily realized with recursive structure.
recursive structure.
iii) Greater flexibility to control the shape of their Less flexibility, limited to specific kind of filter.
magnitude response.
iv)Error due to round off noise are less severe in FIR Round off noise is more.
filters, mainly because feedback is not used.
3. What are the different types of filters based on frequency
response? Based on frequency response the filters can be classified as
1. Lowpass filter
2. Highpass filter
3. Bandpass filter
4. Bandreject filter

4. Give any two properties of butterworth filters?


 The magnitude response of the butterworth filter decreases monotonically as frequency 
increases from 0 to .
 The magnitude response is closely approximates the ideal response as the order N increases.
 The poles of the filter lie on a circle.

5. What are the properties of chebyshev filter?


 The magnitude response of the chebyshev filter exhibits ripples either in pass band or in stop
band according to type. Ripples in pass band are type I filter. Ripples in stop band are type II
filter.
 The poles of the chebyshev filter lies on an ellipse.

6. Distinguish between butterworth & chebyshev filter?


Butterworth filter Chebyshev filter

The magnitude response decreases monotonically as The magnitude response exhibits ripples in pass
frequency  increases band & monotonically decreases in stop band.(type
I)
Transition band is more Transition band is less
Poles lies on a circle Poles lies on ellipse.
Order is more for same specification Order is less .

18ECC301J - DIGITAL SIGNAL PROCESSING LAB


M.KUMARASAMY COLLEGE OF ENGINEERING (AUTONOMOUS),
KARUR
7. Mention any two procedures for digitizing the transfer function of a analog filter?
5. Impulse invariance method.
6. Bilinear transformation.

8. Define bilinear transformation?


Bilinear transformation is a conformal mapping that transforms the jΩ axis into the unit circle in the
z plane only once, thus avoiding aliasing of frequency components.

9. Why impulse invariant method is not preferred in design of IIR filter other than Low pass filter? Or What
are the demerits of impulse invariant method?
In impulse invariant method, the mapping from s plane to z plane is many to one ie. All poles in the
splane between the intervals (2k-1)∏/ T (for k=0,1,2…) maps into the entire z plane. Thus, there are an
infinite number of poles that maps to the same location in the z plane, producing aliasing effect. Due to
spectrum aliasing the impulse invariant methods is not preferred in designing other than LPF.

Mark Allocation
Marks Marks
Sl.No. Details
Allotted Awarded
1 Preparation 30

2 Experimental Demonstration 30

3 Verification 20

4 Result 10

5 Viva-Voce 10

Total 100

Signature of the Faculty with Date

18ECC301J - DIGITAL SIGNAL PROCESSING LAB


M.KUMARASAMY COLLEGE OF ENGINEERING (AUTONOMOUS),
KARUR

EX.NO: 5 FIR FILTER DESIGN USING WINDOW TECHNIQUES


DATE:

AIM:

To write a SCILAB program to plot magnitude response and phase response of digital FIR filter.

APPARATUS REQUIRED:

SCILAB With PC

THEORY

The term FIR abbreviation is “Finite Impulse Response” and it is one of two main types of digital filters
used in DSP applications. Filters are signal conditioners and function of each filter is, it allows an AC
components and blocks DC components. The best example of the filter is a phone line, which acts as a filter.
Because, it limits frequencies to a rage significantly smaller than the range of human beings can hear
frequencies.

Transfer Function of FIR Filter

The Frequency Response Formula for an FIR Filter

DC Gain of an FIR filter is

PROGRAM

clear;
clc ;
close ;
N=7;
U=4;
h_Rect=window('re',N);

18ECC301J - DIGITAL SIGNAL PROCESSING LAB


M.KUMARASAMY COLLEGE OF ENGINEERING (AUTONOMOUS),
KARUR

for n=-3+U:1:3+U
if n==4
hd(n)=0.4;
else
hd(n)=(sin(2*%pi*(n-U)/5))/(%pi*(n-U));
end
h(n)=hd(n)*h_Rect(n);
end
[hzm ,fr ]= frmag (h ,256) ;
hzm_dB = 20* log10 (hzm)./ max ( hzm );
figure
plot (2*fr , hzm_dB )
a= gca ();
xlabel ('Frequency w*pi');
ylabel ('Magnitude in dB');
title ('Frequency Response of FIR LPF with
N=7'); xgrid (2)
disp(h,"Filter Coefficients,h(n)=");

OUTPUT

RESULT:-

18ECC301J - DIGITAL SIGNAL PROCESSING LAB


M.KUMARASAMY COLLEGE OF ENGINEERING (AUTONOMOUS),
KARUR
Viva – Voce Questions

1. What are desirable & undesirable features/ Characteristics of FIR filter? Or what are advantages &
disadvantages of FIR filter?
Advantage:
i) FIR filter have exact linear phase.
ii) FIR filter are always stable. since all its poles of the filter are at the origin.
iii) FIR filter can be realized in both recursive & non-recursive structure.
iv) Filters with any arbitrary magnitude response can be tackled using
FIR.sequency. Disadvantage:
i) For the same filter specification the order of FIR filter design can be as high as 5 to 10 times that in a
IIR design.
ii) Large storage requirements needed.
iii) Powerful computational facilities required for the implementation.
2. What are the design techniques of FIR filter?
Fourier series method (not used frequently)
Window method
Frequency sampling method
Optimal filter design
3.What is meant by FIR filter and why is it stable?
The filters whose impulse response is finite are referred as FIR filters.These are usually implemented
using nonrecursive structures.
FIR filter is always stable since all of its poles are at the origin.
4. What are the conditions to be satisfied for constant phase delay in linear phase FIR filter? (symm
condition).
The conditions for constant phase delay are
Phase delay,  = N-1/2 (i.e., phase delay is constant)
Impulse response, h(n)=h(N-1-n) (ie,impulse response is symmetric).
5. Define signal flow graph.
A signal flow graph is a graphical representation of the relationships between the variables of a set of
linear difference equations.
6. Define ripples in a filter?
The limits of the tolerance in the magnitude of passband and stopband are called ripples.The
tolorance in passband is denoted as p and that in stopband is denoted as s.
7. What is meant by prewarping & how it is done?
Prewarping: The effect of the non-linear compression at high frequencies can be compensated. When
the desired magnitude response is piece-wise constant over frequency, this compression can be
compensated by introducing a suitable pre-scaling, or pre-warping the critical frequencies by using
the formula.
8. What are the advantages & disadvantages of bilinear
transformation? Advantages:
o The bilinear transformation provides one-to-one mapping.
o Stable continuous systems can be mapped into realizable, stable digital systems.

18ECC301J - DIGITAL SIGNAL PROCESSING LAB


M.KUMARASAMY COLLEGE OF ENGINEERING (AUTONOMOUS),
KARUR
o There is no
aliasing. Disadvantage:
o The mapping is highly non-linear producing frequency, compression at high frequencies.
o Neither the impulse response nor the phase response of the analog filter is preserved in a
digital filter obtained by bilinear transformation.
9. What are the Advantages & disadvantages of FIR
FILTER Adv: Linear phase FIR filter can be easily
designed .
Efficient realization of FIR filter exists as both recursive and non-recursive
structures.
FIR filter realized non-recursively stable.
Disadvantage: The duration of impulse response should be large to realize sharp cutoff filters.
The non integral delay can lead to problems in some signal processing applications.
10. What is Gibb’s phenomenon?
One possible way of finding an FIR filter that approximates H d(ej) would be to truncate the infinite
Fourier series at n=(N-1)/2. Abrupt truncation of the series will lead to oscillation both in pass band & in
stop band. This phenomenon is called Gibb’s phenomenon.

Mark Allocation
Marks Marks
Sl.No. Details
Allotted Awarded
1 Preparation 30

2 Experimental Demonstration 30

3 Verification 20

4 Result 10

5 Viva-Voce 10

Total 100

Signature of the Faculty with Date

18ECC301J - DIGITAL SIGNAL PROCESSING LAB


M.KUMARASAMY COLLEGE OF ENGINEERING (AUTONOMOUS),
KARUR
EX.NO.6 COMPUTE AND CALCULATE THE DEAD BAND FOR A SECOND ORDER SYSTEM
DATE:

AIM:
To write a SCILAB program to Compute and calculate the dead band for a second order system

APPARATUS REQUIRED:

SCILAB With PC

THEORY
In a limit cycle the amplitudes of the output are confined to a range of values, which is called the dead band
of the filter. For a first-order system described by the equation, y(n) = a y(n–1) + x(n), the dead band is
given by,
where, B = Number of binary bits (including sign bit) used to represent the product.

For a second-order system described by the equation, y(n) = a1 y(n – 1) + a2 y(n – 2) + x(n), the dead
band of the filter is given by,
PROGRAM:
clc; clear;
//y(n)=0.9y(n-1)+x(n)
//Input x(n)=0
n=-1;y=12; //Initial Condition y(-1)=12
flag=1;
while n<8
n=n+1;
y=[y 0.9*y(n+1)];
yr=round(y);
end
disp(n,'n=');
disp(y,'y(n)-exact');
disp(yr,'y(n)-rounded');
disp([-yr(n+2) yr(n+2)],'Deadband interval ')

18ECC301J - DIGITAL SIGNAL PROCESSING LAB


M.KUMARASAMY COLLEGE OF ENGINEERING (AUTONOMOUS),
KARUR

OUTPUT

RESULT:

18ECC301J - DIGITAL SIGNAL PROCESSING LAB


M.KUMARASAMY COLLEGE OF ENGINEERING (AUTONOMOUS),
KARUR
Viva – Voce Questions
1. Define “dead band” of the filter.
The quantization effect in multiplication makes filter to lock in unstable mode in which limit cycle
occur. The amplitudes of the output during a limit cycle are confined to a range of values called the dead
band of the filter.
Here [-k,+k] is known as dead band , b= number of quantization bits.

2. What are the different types of arithmetic in digital


systems? There are three types of arithmetic used in digital
systems
Fixed point arithmetic
Floating point arithmetic
Block Floating arithmetic

3. What is the purpose of a deadband?


A deadband is a temperature range in which neither heating nor cooling system turns on. The
deadband prevents the thermostat from activating heat and cooling in rapid succession. This
conserves energy by providing a range of temperatures requiring no energy consumption.

4. What is a deadband compensator?


The Output Deadband is the amount added or subtracted from the Control Output to compensate for
a "deadband" in the system. Valves with overlapped spools, and some drives do not react to small
changes in output; this effect is termed "dead band". Deadband compensation can be performed in
closed-loop control only.

5. What is hysteresis and deadband?


It's my understanding that Dead Band is the range for your process variable in which zero action is
taken. Whereas hysteresis range is where the output based on a given input is path dependent, in
other words you can have different outputs for the same process variable value depending on how it
arrived there.

6. What do you mean by hysteresis?


As a general term, hysteresis means a lag between input and output in a system upon a change in
direction. Hysteresis is something that happens with magnetic materials so that, if a varying
magnetizing signal is applied, the resulting magnetism that is created follows the applied signal, but
with a delay.

7. What are dead band instruments?


In process instrumentation, the dead band is the range through which an input signal may vary, upon
reversal of direction, without initiating an observable change in output signal.

8. What is a fixed deadband?


18ECC301J - DIGITAL SIGNAL PROCESSING LAB
M.KUMARASAMY COLLEGE OF ENGINEERING (AUTONOMOUS),
KARUR
Switches often have a fixed deadband that cannot be changed and is listed in the specifications. Or
the switch can have adjustable deadband that can be changed over the range of the switch. Digital
switches and controllers can have the deadband set to any value.

9. How do I find a dead band?


Slowly decrease pressure until movement of the valve stem is detected and note this pressure (P2).
Subtract pressure in step 2 above from that in step 1. The difference between these two pressures is
the deadband, in psi.

Mark Allocation
Marks Marks
Sl.No. Details
Allotted Awarded
1 Preparation 30

2 Experimental Demonstration 30

3 Verification 20

4 Result 10

5 Viva-Voce 10

Total 100

18ECC301J - DIGITAL SIGNAL PROCESSING LAB


M.KUMARASAMY COLLEGE OF ENGINEERING (AUTONOMOUS),
KARUR
Signature of the Faculty with Date

18ECC301J - DIGITAL SIGNAL PROCESSING LAB


M.KUMARASAMY COLLEGE OF ENGINEERING (AUTONOMOUS),
KARUR

EX.NO.7 DESIGN AND COMPUTE THE UPSAMPLING AND DOWNSAMPLING


DATE:

AIM:
To write a SCILAB program to design and compute the upsampling and downsampling

APPARATUS REQUIRED
SCILAB with PC

THEORY
Downsampling or decimation is the process of reducing the sampling rate by an integer N factor D.
Upsampling or interpolation is the process of increasing the sampling rate by an integer factor I.

Downsampling (or decimation) is the process of reducing the samples of the discrete time signal. Let, x(n) =
Discrete time signal D = Sampling rate reduction factor (and D is an integer) Now, x(Dn) = Downsampled
version of x(n) The device which performs the process of downsampling is called a downsampler (or
decimator).

The upsampling (or interpolation) is the process of increasing the samples of the discrete time signal. Let,
x(n) = Discrete time signal I = Sampling rate multiplication factor (and I is an integer).
Now, x( n/ I ) = Upsampled version of x(n).
The device which perform the process of upsampling is called upsampler (or interpolator).

PROGRAM:
(i) DECIMATION
clc;clear;

function [N,R]=func(Fs,Fp,Ft,Fti,dp,ds,M)
dF=(Fs-Fp)/Ft; //Normalised transition bandwidth
N=round((-20*log10(sqroot(dp*ds))-13)/(14.6*dF)); //FIR Filter length
R=N*Fti/M; //Number of Multiplications per second
endfunction

Ft=20000; //Sampling rate of input signal


Fp=40; //Passband frequency

18ECC301J - DIGITAL SIGNAL PROCESSING LAB


M.KUMARASAMY COLLEGE OF ENGINEERING (AUTONOMOUS),
KARUR
Fs=50; //Stopband frequency
dp=0.01; //Passband ripple
ds=0.002; //Stopband ripple
M=100; //Decimation Factor
Fti=Ft; //Input sampling rate
//Single stage implementation
[N1,R1]=func(Fs,Fp,Ft,Fti,dp,ds,M);

//Two stage implementation


//Stage 1 F(z) with decimation factor 50
Fpf=Fp; //Passband frequency
Fsf=190; //Stopband frequency
dpf=0.005; //Passband ripple
dsf=0.002; //Stopband ripple
Mf=50; //Decimation Factor
Fti=Ft; //Input sampling rate
[N2f,R2f]=func(Fsf,Fpf,Ft,Fti,dpf,dsf,Mf);

//Stage 2 G(z) with decimation factor 2


Fpg=50*Fp; //Passband frequency
Fsg=50*Fs; //Stopband frequency
dpg=0.005; //Passband ripple
dsg=0.002; //Stopband ripple
Mg=2; //Decimation Factor
Fti=Ft/50; //Input sampling rate
[N2g,R2g]=func(Fsg,Fpg,Ft,Fti,dpg,dsg,Mg);
N2=N2f+50*N2g+2; //Total filter length
R2=R2f+R2g; //Total Number of Multiplications per second
disp(R1,'Number of Multiplications per second =',N1,'FIR filter length =','For Single stage implementation:');
disp('For Two stage implementation:');
disp(R2f,'Number of Multiplications per second =',N2f,'FIR filter length =','For F(z):');
disp(R2g,'Number of Multiplications per second =',N2g,'FIR filter length =','For G(z):');
disp(R2,'Total Number of Multiplications per second =',N2,'Overall FIR filter length =');

OUTPUT

18ECC301J - DIGITAL SIGNAL PROCESSING LAB


M.KUMARASAMY COLLEGE OF ENGINEERING (AUTONOMOUS),
KARUR

ii) INTERPOLATION
clc;clear;close;
x=0:5;
y=[];
for i=1:length(x)
y(1,2*i)=x(i);
end
disp(x,'Input signal x(n)=');
disp(y,'Output signal of interpolation process with factor two y(n)');
subplot(2,1,1);
plot2d3(x);title('Input signal x(n)');
subplot(2,1,2);
plot2d3(y);title('Output signal y(n)');

OUTPUT

RESULT:

18ECC301J - DIGITAL SIGNAL PROCESSING LAB


M.KUMARASAMY COLLEGE OF ENGINEERING (AUTONOMOUS),
KARUR

Viva – Voce Questions

1. What is the difference between upsampling and downsampling?


Downsampling, which is also sometimes called decimation, reduces the sampling rate. Upsampling,
or interpolation, increases the sampling rate.

2. What is the purpose of upsampling?


The purpose of Upsampling is to manipulate a signal in order to artificially increase the sampling
rate.

3. What is the purpose of downsampling?


To make a digital audio signal smaller by lowering its sampling rate or sample size (bits per sample).
Downsampling is done to decrease the bit rate when transmitting over a limited bandwidth or to
convert to a more limited audio format.

4. What is the process of upsampling called?


“Interpolation”, in the DSP sense, is the process of upsampling followed by filtering.

5. What do you mean by down sampling and upsampling?


 The process of reducing the sampling rate by the integer factor M is called as down
sampling. Ie it considers Mth samples and discards only M-1 samples between of its samples.
This combined operation of filtering and downsampling is called decimation.
 The process of increasing the sampling rate by the integer factor L is called as up sampling.
The upsampling is a process of inserting L-1 zero-valued samples between original samples
to increase the sampling rate. (This is called "zero-stuffing"). The combination of upsampling
and filtering is called interpolator.

6. Why in a sampling rate conversion interpolation is performed first than decimation?


When interpolation or upsampling is performed first and the decimation or down sampling is
performed second is to preserve the spectral characteritics of input signal x(n).

7. . What is the need for anti aliasing filter prior to down sampling?
The spectra obtained after down sampling a signal by a factor M is the sum of all the uniformly
shifted and stretched version of original spectrum scaled by the factor 1/M. if thespectrum is not
bandlimited to π/M, then down sampling will cause aliasing. In order to avaoid aliasing the signal
x(n) is to be bandlimited to ± π/M. This can be done by filtering the signal x(n) with a low pass filter
with a cutoff frequency of π/M. this filter is known as anti aliasing filter

8. What is the "decimation factor"?


The decimation factor is simply the ratio of the input rate to the output rate. It is usually symbolized
by "M", so input rate / output rate=M

18ECC301J - DIGITAL SIGNAL PROCESSING LAB


M.KUMARASAMY COLLEGE OF ENGINEERING (AUTONOMOUS),
KARUR

9. Why decimate?
The most immediate reason to decimate is simply to reduce the sampling rate at the output of one
system so a system operating at a lower sampling rate can input the signal. But a much more
common motivation for decimation is to reduce the cost of processing: the calculation and/or
memory required to implement a DSP system generally is proportional to the sampling rate, so the
use of a lower sampling rate usually results in a cheaper implementation

10. Which signals can be downsampled?


A signal can be downsampled (without doing any filtering) whenever it is "oversampled", that is,
when a sampling rate was used that was greater than the Nyquist criteria required. Specifically, the
signal's highest frequency must be less than half the post-decimation sampling rate.

Mark Allocation
Marks Marks
Sl.No. Details
Allotted Awarded
1 Preparation 30

2 Experimental Demonstration 30

3 Verification 20

4 Result 10

5 Viva-Voce 10

Total 100

18ECC301J - DIGITAL SIGNAL PROCESSING LAB


M.KUMARASAMY COLLEGE OF ENGINEERING (AUTONOMOUS),
KARUR
Signature of the Faculty with Date

TMS 320C54XX EXPERIMENTS

EX.NO: 8a ADDITION USING DIRECT ADDRESSING MODE


DATE

AIM:

To write a assembly language program to perform Addition of two numbers using Direct addressing
mode.

APPARATUS REQUIRED:

1.Personal Computer
2.RS232C interface cable
3.TMS320C5416 DSP Processor

ALGORITHM:

1. Set the data memory locations of Input 1,Input 2 and output .

2. Start the program

3. Initialize the data memory page.

4. Reset the Compiler mode (CPL) bit.

5. Delay is given by NOP (No Operation).

6. The data which is in data memory (A000H) is loaded to Accumulator A.

7. The data which is in data memory (A001H) is added with accumulator A.

8. Accumulator A Result is stored at A002H.

9. Halt the program.

PROGRAM:

INP1 .SET 0H
INP2 .SET 1H
OUT .SET 2H
.MMREGS
.TEXT
18ECC301J - DIGITAL SIGNAL PROCESSING LAB
M.KUMARASAMY COLLEGE OF ENGINEERING (AUTONOMOUS),
KARUR
START:
LD #140H,DP

RSBX CPL
NOP
NOP
NOP
NOP
LD INP1,A
ADD INP2,A
STL A ,OUT
HLT: B HLT

OUTPUT:

RESULT:

Mark Allocation
Marks Marks
Sl.No. Details
Allotted Awarded
1 Preparation 30

2 Experimental Demonstration 30

3 Verification 20

4 Result 10

5 Viva-Voce 10

Total 100

Signature of the Faculty with Date

18ECC301J - DIGITAL SIGNAL PROCESSING LAB


M.KUMARASAMY COLLEGE OF ENGINEERING (AUTONOMOUS),
KARUR

EX.NO: 8b SUBTRACTION USING INDIRECT ADDRESSING MODE


DATE

AIM:

To write a assembly language program to perform Subtraction of two numbers using Indirect
addressing mode.

APPARATUS REQUIRED:

1. Personal Computer
2. RS232C interface cable
3. TMS320C5416 Processor

ALGORITHM:

1. Start the program.


2. Clear the Accumulator A.
3. Indirect address 1000H is assigned to auxiliary register AR4.
4. Indirect address 1000H is assigned to auxiliary register AR5.
5. Indirect address 3000H is assigned to auxiliary register AR6
6. Data which is in 1000H is loaded to Accumulator A.
7. Data which is in 2000H is subtracted with Accumulator A .
8. Result in Accumulator A is stored at 3000H.
9. Halt the program.

PROGRAM:

.MMREGS
.TEXT
START:
LD #00H,A
STM #1000H,AR4
STM #2000H,AR5
STM #3000H,AR6
LD *AR4,A
SUB*AR5,A
STL A,*AR6+
HLT: B HLT

18ECC301J - DIGITAL SIGNAL PROCESSING LAB


M.KUMARASAMY COLLEGE OF ENGINEERING (AUTONOMOUS),
KARUR

OUTPUT:

RESULT:

Mark Allocation
Marks Marks
Sl.No. Details
Allotted Awarded
1 Preparation 30

2 Experimental Demonstration 30

3 Verification 20

4 Result 10

5 Viva-Voce 10

Total 100

Signature of the Faculty with Date

18ECC301J - DIGITAL SIGNAL PROCESSING LAB


M.KUMARASAMY COLLEGE OF ENGINEERING (AUTONOMOUS),
KARUR
EX.NO: 9 GENERATION OF SQUARE AND SAW TOOTH WAVEFORMS USING PROCESSOR

DATE

AIM:
To write a assembly language program to generate square and saw tooth waveform using processor

APPARATUS REQUIRED:

1. Personal Computer
2. RS232C interface cable
3. TMS320C5416 Processor

PROCEDURE

1. Start the program.


2. Load the amplitude of the input signal of 5 volts.
3. Load the frequency of the input signal.
4. Observe the waveform by using CRO.
5. Stop the program

PROGRAM
a) Program for Generation of Square Waveform
.MMREGS
.TEXT
START: LDP #100H
LACC #0FFFH ; change this value for amplitude.
LOOP: SACL 0
RPT #0FFH ; change this value for
frequency.OUT 0,04H ; address for DAC.
CMPL
B LOOP
.END

b) Program for Generation of Sawtooth Waveform

.MMREGS
.TEXT
START: LDP #120H
LACC #0H ; change lower amplitudeSACL 0

18ECC301J - DIGITAL SIGNAL PROCESSING LAB


M.KUMARASAMY COLLEGE OF ENGINEERING (AUTONOMOUS),
KARUR

LOOP: LACC 0 OUT


0,04H
ADD #05h ; change frequencySACL
0
SUB #0FFFh ; change upper
amplitudeBCND LOOP, LEQ
B START
.END

OBSERVATION

Name of
S.No Waveforms Time Period (msec) Amplitude(Volts)

1 Square Wave

2 Saw tooth Wave

RESULT:

18ECC301J - DIGITAL SIGNAL PROCESSING LAB


M.KUMARASAMY COLLEGE OF ENGINEERING (AUTONOMOUS),
KARUR
Viva – Voce Questions

TMS PROGRAMS
8. Arithmetic operations using processor
9. Generation of Square and saw tooth waveforms using processor
1. What are the differences between a microprocessor and a DSP processor?
DSP processors are featured to support high performance and repeatitive and intensive tasks whereas
microprocessors are not application specific and they are designed to process control-oriented tasks.

2. What are the factors that influence selection of DSPs?


Architectural features , Execution speed, Type of arithmetic , Word length
3.What are the classification digital signal processors?
The digital signal processors are classified as
(i) General purpose digital signal processors. (ii) Special purpose digital signal processors

4. What is Von Neumann Architecture?


In von Neumann Architecture, a single address bus ,a single data bus and a control bus for accessing
program as well as data memory area used. The CPU can be either reading an instruction or
reading/writing data from/to the memory. Both cannot occur at the same time since the instruction
and data use the same signal pathways and memory.

5. What is meant by Harvard Architecture?


In Harvard architecture, separate memories for their instructions and data, requiring dedicated buses
for each of them. Instruction and operands can be fetched simultaneously. Since it possess two
independent bus systems, Harvard architecture is capable of simultaneously reading an instruction
code and reading or writing a memory or peripheral as part of the execution of the previous
instruction.

6. What is Modified Harvard Architecture?


In Modified Harvard Architecture,Separate bus systems for program memory and data memory and
input/output peripherals.it may also have multiple bus system for program memory alone or for data
memory alone.

7. What are the applications of Programmable Digital Signal Processor.


Digital cell phones, automated inspection, voicemail, motor control, video conferencing, noise
cancellation, medical imaging, speech synthesis, satellite communication etc.

8. Give some examples for fixed point DSPs & floating point DSPs
TM32OC50, TMS320C54, TMS320C55, ADSP-219x, ADSP-219xx - fixed point DSPs
TMS320C3x, TMS320C67x, ADSP-21xxx -- floating point DSPs

9. What is pipelining? What is pipeline depth?


Pipelining a processor means breaking down its instruction into a series of discrete pipeline stages
which can be completed in sequence by specialized hardware.The number of pipeline stages is
18ECC301J - DIGITAL SIGNAL PROCESSING LAB
M.KUMARASAMY COLLEGE OF ENGINEERING (AUTONOMOUS),
KARUR
referred to as the pipeline depth.

10 What are the advantages of VLIW architecture?


Advantages of VLIW architecture
a. Increased performance
b. Better compiler targets
c. Potentially easier to program
d. Potentially scalable.

Mark Allocation
Marks Marks
Sl.No. Details
Allotted Awarded
1 Preparation 30

2 Experimental Demonstration 30

3 Verification 20

4 Result 10

5 Viva-Voce 10

Total 100

Signature of the Faculty with Date

18ECC301J - DIGITAL SIGNAL PROCESSING LAB


M.KUMARASAMY COLLEGE OF ENGINEERING (AUTONOMOUS),
KARUR

CONTENT BEYOND SYLLABUS

Ex.No.10 OUTPUT QUANTIZATION NOISE FOR CASCADE REALIZATION


Date:
AIM
To verify the Output Quantization Noise for Cascade Realization

APPARATUS REQUIRED

 SCILAB with PC

THEORY
The Product quantization model is realized with the following assumption:
1. The error e(n) is uniformly distributed over the range –q/2 to q/2, whose mean value is zero and constant
variance

S e2 = 2-2B/12
2. The error e(n) is uncorrelated with the signal x(n)

The Total output noise due to product quantization errors depends on the type of realization structure and point
at which the results are quantized

PROGRAM

clc;clear;close;
x=poly(0,'x'); //x=2^-2B
z=poly(0,'z');
H1=1/(1-0.9/z);
H2=1/(1-0.8/z);
H=H1*H2;
pn=x/12; //Input Noise power

//Calculation of output noise for H1(z)


X1=H*horner(H,1/z)/z;
r1=roots(denom(X1));
rc1=coeff(denom(X1));
q1=[];s1=[];
for n=1:length(r1) //Loop to separate poles inside the unit circle
if (abs(r1(n))<1) then
q1=[q1 r1(n)];
else
s1=[s1 r1(n)];
end
18ECC301J - DIGITAL SIGNAL PROCESSING LAB
M.KUMARASAMY COLLEGE OF ENGINEERING (AUTONOMOUS),
KARUR
end
P1=numer(X1)/rc1(length(rc1));
Q1=poly(q1,'z');
S1=poly(s1,'z');
I1=abs(residu(P1,Q1,S1)); //Residue Calculation
po1=pn*I1; //Output Noise power

//Calculation of output noise for H2(z)


X2=H2*horner(H2,1/z)/z;
r2=roots(denom(X2));
rc2=coeff(denom(X2));
q2=[];s2=[];
for n=1:length(r2) //Loop to separate poles inside the unit circle
if (abs(r2(n))<1) then
q2=[q2 r2(n)];
else
s2=[s2 r2(n)];
end
end
P2=numer(X2)/rc2(length(rc2));
Q2=poly(q2,'z');
S2=poly(s2,'z');
I2=abs(residu(P2,Q2,S2)); //Residue Calculation
po2=pn*I2; //Output Noise power

po=po1+po2;
disp(pn,'Input Noise power');
disp(I1,'I1=');disp(I2,'I2=');
disp(po1,'Output Noise power for H1(z)');
disp(po2,'Output Noise power for H2(z)');
disp(po,'Total Output Noise power');

OUTPUT

18ECC301J - DIGITAL SIGNAL PROCESSING LAB


M.KUMARASAMY COLLEGE OF ENGINEERING (AUTONOMOUS),
KARUR

RESULT:
Thus the output quantization Noise for Cascade Realization is executed and verified the
output.

Mark Allocation
Marks Marks
Sl.No. Details
Allotted Awarded
1 Preparation 30

2 Experimental Demonstration 30

3 Verification 20

4 Result 10

5 Viva-Voce 10

Total 100

Signature of the Faculty with Date

18ECC301J - DIGITAL SIGNAL PROCESSING LAB


M.KUMARASAMY COLLEGE OF ENGINEERING (AUTONOMOUS),
KARUR

Ex.No. 11 MULTISTAGE IMPLEMENTATION OF SAMPLING RATE CONVERSION


Date:
AIM
To verify the Multistage Implementation of Sampling Rate Conversion (Time

APPARATUS REQUIRED

 SCILAB with PC
THEORY
In sampling rate conversion, when the sampling rate conversion factor I or D is very large then the
multistage sampling rate conversion will be a computationally efficient realization. In interpolation, if
sampling rate multiplication factor, I is very large then I can be expressed as a product of positive integer

Now, the interpolation by sampling rate multiplication factors I1 , I2 , ......IL are implemented separately
and then overall interpolation is obtained by cascading the L-stages of interpolation. In cascading of
interpolators, the anti-imaging filters are introduced at the output of each stage of interpolation in order to
eliminate the images introduced due to upsampling in that stage.
In decimation, if sampling rate reduction factor, D is very large then D can be expressed as a product of
positive integers.

Now, the decimation by sampling rate reduction factors D1 , D2 , DL are implemented separately and
then overall decimation is obtained by cascading the L-stages of decimation. In cascading of decimators, the
anti-aliasing filters are introduced at the input of each stage to limit the bandwidth of the input signal to
decimator in order to avoid aliasing due to decimation in the spectrum of the output signal of that stage.

PROGRAM

clc;clear;close;
x=[0:6 0:6];
y=x(1:3:length(x));
disp(x,'Input signal x(n)=');
disp(y,'Output signal of decimation process by factor three y(n)');
subplot(2,1,1);
plot2d3(x);title('Input signal x(n)');
subplot(2,1,2);
plot2d3(y);title('Output signal y(n)');

18ECC301J - DIGITAL SIGNAL PROCESSING LAB


M.KUMARASAMY COLLEGE OF ENGINEERING (AUTONOMOUS),
KARUR
OUTPUT

RESULT:
Thus the multi stage implementation of sampling rate conversion is executed and verified
output.

Mark Allocation
Marks Marks
Sl.No. Details
Allotted Awarded
1 Preparation 30

2 Experimental Demonstration 30

3 Verification 20

4 Result 10

5 Viva-Voce 10

Total 100

Signature of the Faculty with Date


18ECC301J - DIGITAL SIGNAL PROCESSING LAB

You might also like