DSP Lab Manual 2018-19 PrintCopy MANU
DSP Lab Manual 2018-19 PrintCopy MANU
DSP Lab Manual 2018-19 PrintCopy MANU
LABORATORY MANUAL
1
DSP LAB MANUAL Dept of ECE
INSTITUTE VISION:
To establish as an ideal academic institutions in the service of the nation, the world
and the humanity by graduating talented engineers to be ethically strong, globally
competent by conducting high quality research, developing breakthrough technologies,
and disseminating and preserving technical knowledge.
INSTITUTE MISSION:
To fulfill the promised vision through the following strategic characteristics and
aspirations:
2
DSP LAB MANUAL Dept of ECE
DEPARTMENT VISION:
Imparting quality technical education through research, innovation and team work for a
lasting technology development in the area of Electronics and Communication
Engineering.
MISSION:
To develop a strong centre of excellence for education and research with excellent
infrastructure and well qualified faculties to instill in them a passion for knowledge.
1. Establish a unique learning environment to enable the students to face the challenges
of the Electronics and Communication Engineering field.
2. Promote the establishment of centre of excellence in niche technology areas to nurture
the spirit of innovation and creativity among faculty and students.
3. Provide ethical and value based education by promoting activities addressing the
societal needs.
4. Enable students to develop skills to solve complex technological problems of current
times and also provide a framework for promoting collaborative and multidisciplinary
activities.
3
DSP LAB MANUAL Dept of ECE
PROGRAM OUTCOMES
a An ability to apply knowledge of Science, Mathematics, Engineering & Computing
fundamentals for the solutions of Complex Engineering problems
b An ability to identify, formulates, research literature and analyze complex engineering
problems using first principles of mathematics and engineering sciences.
c An ability to design solutions to complex process or program to meet desired needs.
d Ability to use research-based knowledge and research methods including design of
experiments to provide valid conclusions.
e An ability to use appropriate techniques, skills and tools necessary for computing practice.
f Ability to apply reasoning informed by the contextual knowledge to assess social issues,
consequences & responsibilities relevant to the professional engineering practice.
g Ability to understand the impact of engineering solutions in a global, economic,
environmental, and societal context with sustainability.
h An understanding of professional, ethical, Social issues and responsibilities.
PSO1 Analyze and design analog & digital circuits or systems for a given specification and function.
Implement functional blocks of hardware-software co-designs for signal processing and
PSO2
communication applications.
4
DSP LAB MANUAL Dept of ECE
5
DSP LAB MANUAL Dept of ECE
List of Experiments:
6
DSP LAB MANUAL Dept of ECE
3. While coming to the lab bring the lab manual cum observation book, record etc.
4. Take only the lab manual, calculator (if needed) and a pen or pencil to the work area.
5. Before coming to the lab, prepare the pre-lab questions. Read through the lab
experiment to familiarize yourself with the components and assembly sequence.
6. Utilize 3 hours time properly to perform the experiment (both in software and
hardware) and note down the readings properly. Do the calculations, draw the graph
and take signature from the instructor.
7. If the experiment is not completed in the prescribed time, the pending work has to be
done in the leisure hour or extended hours.
8. You have to submit the completed record book according to the deadlines set up by
your instructor.
9. For practical subjects there shall be a continuous evaluation during the semester for 25
sessional marks and 50 end examination marks.
10. Of the 25 marks for internal, 15 marks shall be awarded for day-to-day work and 10
marks to be awarded by conducting an internal laboratory test.
INDEX
7
DSP LAB MANUAL Dept of ECE
EXPERMENT NO-1
AIM: -
8
DSP LAB MANUAL Dept of ECE
To write a MATLAB program for generating a sinusoidal signal based on recursive difference
equation.
SOFTWARE REQURIED:-
1. MATLAB R2010a.
2. Windows XP SP2.
THEORY:-
A recursive system is one whose present output depends on present and past values. A non
recursive system output depends only on the present input. A recursive discrete system can be
used to generate a sinusoidal signal. A signal in general phenomena is a physical quantity that
changes with an independent variable and carries information. In standard, it is defined as a
mathematical function of one or more independent variable. There are certain parameters that
are common to all the signals and those parameters are called basic characteristics of the
signal. They are amplitude, frequency, phase, energy, power, and bandwidth. The process of
finding the above six parameters of the given signal is called Signal Analysis. This can be
accomplished by representing the signal in either Time-domain or Frequency-domain. Those
parameters which are difficult to be found in time domain can be determined in frequency
domain.
PROCEDURE:-
Open MATLAB
Open new M-file
Type the program
Save in current directory
Compile and Run the program
For the output see command window\ Figure window
PROGRAM:-
clc;
clear all;
close all;
f_hz=400;
9
DSP LAB MANUAL Dept of ECE
fs=8000;
f0=2*pi*f_hz/fs;
a1=2*cos(f0); a2=-1;
b1=sin(f0);
xnm1=1; ynm1=0; ynm2=0;
y1=zeros(1,200);
for i=1:200
y1(i)=b1*xnm1+a1*ynm1+a2*ynm2;
ynm2=ynm1;
ynm1=y1(i);
end
plot(1:length(y1),y1);
xlabel('Time in ms-----> ');
ylabel('Amplitude in volts-----> ');
title(['Sinusoidal Signal of frequency ', num2str(f_hz), ' Hz']);
RESULT:-
Sinusoidal Signal of frequency 400 Hz
7
5
Amplitude in volts----->
-1
0 20 40 60 80 100 120 140 160 180 200
Time in ms----->
because they help model orbital motions. Polar coordinates express a position on a two-
dimensional plane using an angle from a fixed direction and a distance from a fixed point.
Polar coordinates can be converted to Cartesian coordinates- the coordinate plane that we are
used to seeing, and have been seeing since elementary. Polar coordinates can be converted to
the Cartesian coordinates (x,y) by using sine and cosine functions. By multiplying the polar
coordinates by cosine, the x coordinate can be obtained. By multiplying the polar coordinates
by sine the y coordinate can be found. If a trumpet sounds at 440 Hz, at various amplitudes,
the summation of sine waves or in other words Fourier series will be 440 Hz, 880 Hz, 1, 320
Hz, 1,760Hz.
As we know sound travels in waves and frequencies.A French scientist and mathematician by
the name of Jean Baptiste Fourier proved that any waveform that repeats itself after a period
of time (such as a musical sound) can be expressed as the sum of an infinite set of sine curves.
As we know sound travels in waves and frequencies. Ballisic trajectories rely on sin/cos.
EXERCISE PROGRAMS:-
Y=exp (-2*∏*f*t)+exp(-8*∏*f*)
Y= ((exp (-1.56∏f)*Sin(2∏f)+cos(2∏f)?
5. Write a mat lab program for generating u(n)-u(n-1)?
6. Write program to get Discrete time co-Sinusoidal Signal?
7. Write program to get Discrete time saw tooth Signal?
8. Write program to get Discrete time triangular Signal?
9. Write program to get addition of two sinusoidal sequences?
10. Write program to get exponential sequence?
11. Write program to get Discrete time Co-Sinusoidal Signal?
12. Write program to get Fourier Transform of Co-Sinusoidal Signal?
13. Write program to get Inverse Fourier Transform of Co-Sinusoidal Signal?
14. Write program to get exponential decaying sequence?
15. Write program to get exponential growing sequence?
16. Write program to get exponential decaying sequence?
17. Write program to get complex exponential sequence?
18. Write a mat lab program for generating sinc function?
19. Write a mat lab program for generating signum function?
20. Write a program to generate negative ramp signal
11
DSP LAB MANUAL Dept of ECE
VIVA QUESTIONS:-
1. Define Signal?
2. Define determistic and Random Signal?
3. Define Delta Function?
4. What is Signal Modeling?
5. Define Periodic and a periodic Signal?
6. Represent impulse signal in terms of unit step signal
7. Define Unit step signal
8. Define ramp signal
9. Define continuous time signal
10. Define discrete time signal.
11. Define impulse signal.
12. Define ramp signal
13. Define unit step signal
14. Define exponent ional signal
15. Define sinusoidal signal
16. Define C.T.S
17. Define D.T.S.
18. Compare C.T.S & D.T.S
19. Define Stem, Plot, Plot3,fplot, ezplot, linspace, flyplr, grid,mesh and legend.
20. Draw the C.T.S & D.T.S diagrams.
21. Define signal and signal processing
22. Differentiate digital and analog signals?
23. How the DSP processor will differ from conventional processors?
24. Expand the abbreviation TMS320C 5X/6X
25. What kind of processor is DSP processor?
26. What are the main building
27. blocks of DSP processor?
28. What is the main function of MAC unit?
29. Explain VLIW architecture?
30. What is meant by circular buffer?
EXPERMENT NO:2
AIM: -
12
DSP LAB MANUAL Dept of ECE
SOFTWARE REQURIED:-
1.MATLAB R2010a.
2.Windows XP SP2.
THEORY:-
In random variable or random process if all the samples are clustered at center value,
then it is Gaussian distribution. Instead, if all the samples are equally repeated then it is called
uniform distribution. The histogram is analogous to probability density function. It plots the
sample values with their iteration number. The Gaussian and uniform distributions differ in
statistical averages such as mean, variance, standard deviation, skew, kurtosis, etc.,.
PROCEDURE:-
Open MATLAB
Open new M-file
Type the program
Save in current directory
Compile and Run the program
For the output see command window\ Figure window
PROGRAM:-
clc;
clear all;
close all;
x=randn(1,2000);
13
DSP LAB MANUAL Dept of ECE
y=rand(1,2000);
hist(x);
xlabel('Sample value');
ylabel('Probability density');
title('Gaussian pdf');
figure;
hist(y);
xlabel('Sample value');
ylabel('Probability density');
title('Uniform pdf');
mx1=mean(x); display(mx1);
my1=mean(y); display(my1);
ux2=var(x); display(ux2);
uy2=var(y); display(uy2);
ux3=skewness(x); display(ux3);
uy3=skewness(y); display(uy3);
ux4=kurtosis(x); display(ux4);
uy4=kurtosis(y); display(uy4);
OUTPUT:-
mx1 =
0.0220
my1 =
0.5042
ux2 =
1.0159
uy2 =
0.0832
ux3 =
-0.0329
uy3 =
-0.0071
ux4 =
3.1472
uy4 =
1.8301
14
DSP LAB MANUAL Dept of ECE
Gaussian pdf
600
500
400
Probability density
300
200
100
0
-4 -3 -2 -1 0 1 2 3 4
sample value
Uniform pdf
250
200
Probability density
150
100
50
0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Sample value
VIVA QUESTIONS:-
1.What is a noise ?
2.What is gaussion noise?
3.What is correlation ?
4.State Paeseval’s energy theorem for a periodic signal?
5.What is Signum function?
6. How many types of correlation are there?
7. how many types of noises are there?
15
DSP LAB MANUAL Dept of ECE
16
DSP LAB MANUAL Dept of ECE
EXERCISE PROGRAMS
Realtime Applications:
• Stream processing
• Block processing
• Vector processing
• Digital processing applications
17
DSP LAB MANUAL Dept of ECE
EXPERMENT NO-3
AIM:-
To find the DFT& IDFT of a sequence without using the inbuilt functions.
SOFTWARE REQURIED:-
1. MATLAB R2010a.
2. Windows XP SP2.
THEORY:-
The sequence f(n) can be calculated from F(k) using the Inverse Discrete Fourier Transform
(IDFT):
The DFT is the most important discrete transform, used to perform Fourier analysis in
many practical applications.[1] In digital signal processing, the function is any quantity or
signal that varies over time, such as the pressure of a sound wave, a radio signal, or daily
temperature readings, sampled over a finite time interval (often defined by a window
function). In image processing, the samples can be the values of pixels along a row or column
of a raster image. The DFT is also used to efficiently solve partial differential equations, and
to perform other operations such as convolutions or multiplying large integers.
18
DSP LAB MANUAL Dept of ECE
PROCEDURE:-
Open MATLAB
Open new M-file
Type the program
Save in current directory
Compile and Run the program
For the output see command window\ Figure window
PROGRAM:-
%DFT%
clc;
clear all;
close all;
a=input ('enter the input sequence');
N=length(a);
disp('length of input sequence is ');
N
for k=1:N;
x(k)=0;
for i=1:N;
x(k)=x(k)+a(i)*exp((-j*pi*2/N)*((i-1)*(k-1)));
end;
end;
k=1:N;
disp('the output is');
x(k)
subplot(2,1,1);
stem(k,abs(x(k)));
grid;
xlabel ('discrete frequency');
ylabel('magnitude');
title('magnitude response of dft');
subplot(2,1,2);
stem(angle(x(k))*180/(pi));
grid;
xlabel('discrete frequency');
ylabel('phase angle');
title('phase response of dft');
19
DSP LAB MANUAL Dept of ECE
%IDFT%
clc;
clear all;
close all;
a=input('enter the input sequence');
disp('the length of input sequence is');
N=length(a);
N
for n=1:N;
x(n)=0;
for k=1:N;
x(n)=x(n)+a(k)*exp((j*pi*2*(n-1)*(k-1)/N));
end;
end;
n=1:N;
x=1/N*x(n);
disp('the output is');
x(n)
stem(n,abs(x));
grid;
xlabel('discrete time');
ylabel('magnitude');
title('magnitude response of the idft');
grid;
20
DSP LAB MANUAL Dept of ECE
OUTPUT:-
enter the input sequence[1 2 3 4]
length of input sequence is
N=
the output is
ans =
N= 4
the output is
3.5
2.5
magnitude
1.5
0.5
0
1 1.5 2 2.5 3 3.5 4
discrete time
21
DSP LAB MANUAL Dept of ECE
RESULT:-
DFT&IDFT of a given discrete time signal are executed using mat lab software.
EXERCISE PROGRAM:-
22
DSP LAB MANUAL Dept of ECE
VIVA QUESTIONS:-
Realtime Applications:
The Discrete Fourier Transform (DFT) is one of the most important tools in
Digital Signal Processing. First, the DFT can calculate a signal's frequency spectrum. This is a
direct examination of information encoded in the frequency, phase, and amplitude of the
component sinusoids. For example, human speech and hearing use signals with this type of
encoding. Second, the DFT can find a system's frequency response from the system's impulse
response, and vice versa. This allows systems to be analyzed in the frequency domain, just as
convolution allows systems to be analyzed in the time domain. Third, the DFT can be used as
an intermediate step in more elaborate signal processing techniques. The classic example of
this is FFT convolution, an algorithm for convolving signals that is hundreds of times faster
than conventional methods.
23
DSP LAB MANUAL Dept of ECE
EXPERMENT NO-4
AIM: -
To study frequency response of second order system using MATLAB.
SOFTWARE REQURIED:-
1. MATLAB R2010a.
2. Windows XP SP2.
THEORY:-
Second order systems are the systems or networks which contain two or
more storage elements and have describing equations that are second order
differential equations.
24
DSP LAB MANUAL Dept of ECE
A second order filter is a circuit that has a transfer function of the form:
PROCEDURE:-
Open MATLAB
Open new M-file
Type the program
Save in current directory
Compile and Run the program
For the output see command window\ Figure window
PROGRAM:-
clc ;
clear all;
b=[1,4];
a=[1,-5];
w=-2*pi:pi/8:2*pi;
[h]=freqz(b,a,w);
subplot(2,1,1);
stem(w,abs(h));
xlabel('freq/w');
ylabel('magnitude');
grid;
title('magnitude response of diffenrtial equataion');
subplot(2,1,2);
stem(w,angle(h));
25
DSP LAB MANUAL Dept of ECE
xlabel('freq/w');
ylabel('phase in rad');
grid;
title('phase response of diffenrtial equataion');
OUTPUT:-
26
DSP LAB MANUAL Dept of ECE
magnitude 1
0.5
0
-8 -6 -4 -2 0 2 4 6 8
freq/w
phase response of diffenrtial equataion
4
2
phase in rad
-2
-4
-8 -6 -4 -2 0 2 4 6 8
freq/w
RESULT:-
EXERCISE PROGRAM:-
27
DSP LAB MANUAL Dept of ECE
1. Write a matlab program to find the frequency response of the following difference
equation y(n)-7y(n-1)+9y(n-2)=3x(n)-2x(n-1)?
2. Write a matlab program to find the frequency response of the following difference
equation 3y(n)+5y(n-1)=9x(n)?
3. Write a matlab program to find the frequency response of the following difference
equation 9 y(n)-2y(n-1)+7y(n-2)-3y(n-3)=6x(n)+x(n-1)?
4. Write a matlab program to find the frequency response of the following difference
equation 8y(n)+6y(n-1)=4x(n)+2x(n-1)?
5. Write a matlab program to find the frequency response of the following difference
equation 3y(n)-8y(n-1)+9y(n-2)=9x(n)+5x(n-1) ?
6. Write a matlab program to find the frequency response of the following difference
equation 6y(n)-5y(n-1)=9x(n)+5x(n-1) -7x(n-2)?
7. Write a matlab program to find the frequency response of the following difference
equation 9y(n)-8y(n-1)+2y(n-2)=9x(n)-3x(n-1) ?
8. Write a matlab program to find the frequency response of the following difference
equation 2y(n)-8y(n-1)=9x(n)+5x(n-1) ?
9. Write a matlab program to find the frequency response of the following difference
equation 9y(n)-8y(n-1)+9y(n-2)=9x(n)+5x(n-1)-x(n-2) ?
10. Write a matlab program to find the frequency response of the following difference
equation 3y(n)-8y(n-1)=7x(n)-3x(n-1) ?
11. Write a matlab program to find the frequency response of the following difference
equation 11y(n-2)-5y(n-4)=6x(n)+5x(n-3) -9x(n-7)?
12. Write a matlab program to find the frequency response of the following difference
equation 9y(n-1)-8y(n-5)+2y(n-7)=5x(n-1)-1x(n-3) ?
13. Write a matlab program to find the frequency response of the following difference
equation y(n-3)-8y(n-7)=5x(n-1)+3x(n-5) ?
14. Write a matlab program to find the frequency response of the following difference
equation 9y(n-2)-8y(n-4)+9y(n-6)=9x(n-1)+9x(n-3)-x(n-5) ?
15. Write a matlab program to find the frequency response of the following difference
equation 3y(n+2)-8y(n+4)=7x(n-5)-3x(n-9) ?
16. Write a matlab program to find the frequency response of the following difference
equation 11y(n-2)-5y(n-4)=6x(n-2)+5x(n-3) -9x(n-7)?
17. Write a matlab program to find the frequency response of the following difference
equation 9y(n-1)-8y(n-4)+2y(n-7)=5x(n-1)-1x(n-3) ?
18. Write a matlab program to find the frequency response of the following difference
equation y(n-2)-8y(n-7)=5x(n-1)+3x(n-5) ?
19. Write a matlab program to find the frequency response of the following difference
equation 9y(n-2)-8y(n-4)+9y(n-6)=9x(n+1)+9x(n-3)-x(n-5) ?
20. Write a matlab program to find the frequency response of the following difference
equation 3y(n+2)-8y(n+4)=7x(n+5)-3x(n-9) ?
VIVA QUESTIONS:-
28
DSP LAB MANUAL Dept of ECE
Realtime Applications
In electronics this stimulus would be an input signal. In the audible range it is usually
referred to in connection with electronic amplifiers, microphones and loudspeakers. Radio
spectrum frequency response can refer to measurements of coaxial cable, twisted-pair cable,
video switching equipment, wireless communications devices, and antenna systems.
Infrasonic frequency response measurements include earthquakes and electroencephalography
(brain waves).Frequency response requirements differ depending on the application. In high
fidelity audio, an amplifier requires a frequency response of at least 20–20,000 Hz, with a
tolerance as tight as ±0.1 dB in the mid-range frequencies around 1000 Hz, however, in
telephony, a frequency response of 400–4,000 Hz, with a tolerance of ±1 dB is sufficient for
intelligibility of speech.
Experiment 5
29
DSP LAB MANUAL Dept of ECE
Aim: To write a MATLAB program for obtaining Fourier series coefficients by formula and
using Fast Fourier Transform algorithm, to verify the same in Code composer studio, and to
plot all the corresponding graphs.
Software Required: MATLAB 7.0 with signal processing, communications, control systems,
and statistics tool boxes.
Theory:
The fast Fourier transform represents a given signal in frequency domain by reducing the
number of complex multiplication to (N/2)log2N and complex additions to Nlog2N in DFT
algorithm. The time taken by fft to find Fourier transform is lesser than dft. It is implemented
in decimation in time (DIT FFT) and decimation in frequency (DIF FFT) by using radix based
butterfly structures.
MATLAB Program:
lc;
close all;
clear acll;
n =0:0.075:1;
x=cos(2*pi*0.5*n);
N=length(x);
for k=1:N
y=0;
for n=1:N
y=y+x(n).*exp(-j*2*pi*(k-1)*(n-1)/N);
end
C1(k)=y/N ;
end
display(C1);
C2=ifft(x);
m1=abs(C1);
m2=abs(C2);
display(C1);
subplot(3,1,1);
stem(x);
xlabel('Discrete Time')
ylabel('Amplitude')
title('Time Domain Signal')
subplot(3,1,2)
stem(m1);
xlabel('k')
ylabel('ck')
title('Fourier Series Coefficients using Formula');
30
DSP LAB MANUAL Dept of ECE
subplot(3,1,3);
stem(m2);
xlabel('k')
ylabel('Ck')
title('Fourier Series Coefficients using FFT');
Output:
C1 =
Columns 1 through 4
0.0238 0.0893 - 0.4314i 0.0747 - 0.1591i 0.0727 - 0.0923i
Columns 5 through 8
0.0721 - 0.0579i 0.0718 - 0.0348i 0.0717 - 0.0164i 0.0717 + 0.0000i
Columns 9 through 12
0.0717 + 0.0164i 0.0718 + 0.0348i 0.0721 + 0.0579i 0.0727 + 0.0923i
Columns 13 through 14
0.0747 + 0.1591i 0.0893 + 0.4314i
C1 =
Columns 1 through 4
0.0238 0.0893 - 0.4314i 0.0747 - 0.1591i 0.0727 - 0.0923i
Columns 5 through 8
0.0721 - 0.0579i 0.0718 - 0.0348i 0.0717 - 0.0164i 0.0717 + 0.0000i
Columns 9 through 12
0.0717 + 0.0164i 0.0718 + 0.0348i 0.0721 + 0.0579i 0.0727 + 0.0923i
Columns 13 through 14
0.0747 + 0.1591i 0.0893 + 0.4314i
-1
0 2 4 6 8 10 12 14
Discrete Time
Fourier Series Coefficients using Formula
0.5
ck
0
0 2 4 6 8 10 12 14
k
Fourier Series Coefficients using FFT
0.5
Ck
0
0 2 4 6 8 10 12 14
k
Result: The MATLAB program for obtaining Fourier series coefficients by formula and
using Fast Fourier Transform algorithm has been written, the same is verified.
31
DSP LAB MANUAL Dept of ECE
EXERCISE PROGRAM:-
1. Determine the Fourier series coefficients ak for x1(t) shown below. x1(t)= x1(t + 10) ?
2. Determine the Fourier series coefficients bk for x2(t) shown below. x2(t)= x2(t + 10) ?
3. Determine the Fourier series coefficients ck for x3(t) shown below. x3(t)= x3(t + 10)?
4. Determine the Fourier series coefficients for a cos wave by using formula method?
5. Determine the Fourier series coefficients for a cosine wave using FFT ?
6. Determine the Fourier series coefficients of the following signal
x(t) = 1+cos(2πt)
x(t) = [1+cos(2πt)] [sin(10πt+π/6)] ?
9. Find the Fourier series for (periodic extension of) f(t) = ½ 1, t ∈ [0, 2); −1, t ∈ [2, 4). ?
10. Determine the Fourier series coefficients for a given even signal f(t)=2cosπt ?
11. Determine the Fourier series coefficients for a odd function l f(t) = sin t ?
12. Determine the Fourier series coefficients for a Saw-tooth Wave ?
14. Determine the Fourier series coefficients ck for xn(t) shown below. xn(t)= xn(t + 50)?
15. Determine the Fourier series coefficients of the following signal
x(t) = 1+cos(2πt)
x(t) = [1+sin(2πt)] [cos(10πt+π/6)] ?
16. Find the Fourier series coefficients for (periodic extension of)
f(t) = 1+t 2 , t ∈ [1, 2] ?
17. Find the cosine Fourier series coefficients for (periodic extension of)
f(t) = 2/31, t ∈ [0, 1); 0, t ∈ [1, 4). ?
18. Determine the Fourier series coefficients ck for xn(t) shown below.
xn(t)= xn(t+ 350)?
VIVA QUESTIONS:-
32
DSP LAB MANUAL Dept of ECE
Realtime Applications:
Fourier series are of great importance in both theoretical and applied mathematics. For
orthonormal families of complexvalued functions {φn}, Fourier Series are sums of the φn that
can approximate periodic, complexvalued functions with arbitrary precision. This paper will
focus on the Fourier Series of the complex exponentials. Of the many possible methods of
estimating complexvalued functions, Fourier series are especially attractive because uniform
convergence of the Fourier series (as more terms are added) is guaranteed for continuous,
bounded functions. Furthermore, the Fourier coefficients are designed to minimize the square
of the error from the actual function. Finally, complex exponentials are relatively simple to
deal with and ubiquitous in physical phenomena. This paper first defines generalized Fourier
series, with an emphasis on the series with complex exponentials. Then, important properties.
EXPERMENT NO-6
33
DSP LAB MANUAL Dept of ECE
AIM: -
SOFTWARE REQURIED:-
1. MATLAB R2010a.
2. Windows XP SP2.
THEORY:-
PROCEDURE:-
Open MATLAB
Open new M-file
Type the program
Save in current directory
Compile and Run the program
For the output see command window\ Figure window
PROGRAM:-
%fft%
clc;
clear all;
close all;
xn=input('enter the input sequence');
N=input('enter the number of samples');
n=0:1:N-1;
xk=fft(xn,N);
k=0:1:N-1;
subplot(2,1,1);
stem(k,abs(xk));
xlabel('frq/w');
ylabel('magnitude');
title('magnitude response of fft');
subplot(2,1,2);
stem(k,angle(xk));
xlabel('frq/w');
ylabel('phase');
34
DSP LAB MANUAL Dept of ECE
OUTPUT:-
0
0 1 2 3 4 5 6 7
frq/w
phase response of fft
4
2
phase
-2
-4
0 1 2 3 4 5 6 7
frq/w
RESULT:-
Hence the FFT of a given input sequence is performed & executed by using
MATLAB.
EXERCISE PROGRAM:-
35
DSP LAB MANUAL Dept of ECE
36
DSP LAB MANUAL Dept of ECE
VIVA QUESTIONS:-
37
DSP LAB MANUAL Dept of ECE
The Discrete Fourier Transform (DFT) is one of the most important tools in Digital Signal
Processing. First, the DFT can calculate a signal's frequency spectrum. This is a direct
examination of information encoded in the frequency, phase, and amplitude of the component
sinusoids. For example, human speech and hearing use signals with this type of encoding.
Second, the DFT can find a system's frequency response from the system's impulse response,
and vice versa. This allows systems to be analyzed in the frequency domain, just as
convolution allows systems to be analyzed in the time domain. Third, the DFT can be used as
an intermediate step in more elaborate signal processing techniques. The classic example of
this is FFT convolution, an algorithm for convolving signals that is hundreds of times faster
than conventional methods.
38
DSP LAB MANUAL Dept of ECE
EXPERMENT NO-7
SOFTWARE REQURIED:-
1. MATLAB R2010a.
THEORY:-
The power spectrum of a time-series x(t) describes how the variance of the data x(t) is
distributed over the frequency components into which x(t) may be decomposed. This
distribution of the variance may be described either by a measure µ or by a statistical
cumulative distribution function S(f) = the power contributed by frequencies from 0 up to f.
PROCEDURE:-
Open MATLAB
Open new M-file
Type the program
Save in current directory
Compile and Run the program
For the output see command window\ Figure window
PROGRAM:-
% power spectrum %
clc;
clear all;
close all;
f1=input('enter the first frequencey f1=');
f2=input('enter the second frequencey f2=');
fs=input('enter the sampling frequencey fs=');
t=0:1/fs:1;
x=2*sin(2*pi*f1*t)+3*sin(2*pi*f2*t)+rand(size(t));
psd1=abs(fft(x).^2);
subplot(2,1,1);
plot(t*fs,10*log(psd1));
xlabel('frequency');
ylabel('magnitude');
title('psd using square magnitude method');
psd2=abs(fft(xcorr(x),length(t)));
subplot(2,1,2);
plot(t*fs,10*log(psd2));
39
DSP LAB MANUAL Dept of ECE
xlabel('frequency');
ylabel('magnitude');
title('psd using auto corelation method');
OUTPUT:-
100
50
0
0 100 200 300 400 500 600 700 800 900 1000
frequency
psd using auto corelation method
140
magnitude
120
100
80
0 100 200 300 400 500 600 700 800 900 1000
frequency
RESULT:-
Hence the power spectral density is performed & executed by using MATLAB.
40
DSP LAB MANUAL Dept of ECE
EXERCISE PROGRAM:-
1. Write a matlab program for power spectrum estimate using Welch method?
2. Write a matlab program to plot the frequency response of a first order system?
3. Write a matlab program to plot the frequency response of the system?
4. Write a matlab program to generate the periodic sequence?
5. Write a matlab program to generate the aperiodic sequence?
6. Write a matlab program to demonstrate the property of digital frequency?
7. Write a matlab program to illustrate the concept of aliasing?
8. Write a matlab program to plot magnitude and phase response of first order lowpass
filter?
9. Write a matlab program to plot magnitude and phase response of first order highpass
filter?
10. Write a matlab program to plot magnitude and phase response of second order
bandpass filter?
11. Write a matlab program to plot magnitude and phase response of second order
bandstop filter?
12. Write a matlab program to plot magnitude and phase response of second order lowpass
filter?
13. Write a matlab program to plot magnitude and phase response of second order
highpass filter?
14. Write a matlab program to plot magnitude and phase response of first order bandpass
filter?
15. Write a matlab program to plot magnitude and phase response of first order bandstop
filter?
16. Write a matlab program to plot the frequency response of a first order system?
17. Write a matlab program to plot the frequency response of the system?
18. Write a matlab program to generate the periodic sinusoidal sequence?
19. Write a matlab program to generate the a periodic sinusoidal sequence?
20. Write a matlab program to demonstrate the property of digital signal?
VIVA QUESTIONS:-
10. What is Auto Regressive Model? How is the order of auto regressive model is
decided?
11. Differentiate between linear and circular convolution.
12. Determine the unit step response of the linear time invariant system with impulse
response h(n)=a nu(n) a<1&-a<1
13. Determine the range of values of the parameter a for which linear time invariant
system with impulse response h(n)=a u(n) is stable.
14. Consider the special case of a finite duration sequence given as X(n)={2 4 0 3},
resolve the sequence x(n) into a sum of weighted sequences.
15. Describe impulse response of a function?
16. Where to use command filter or impz, and what is the difference between these two?
17. How to calculate output of DFT using MATLAB?
18. Where DFT is used?
19. What is the difference between DFT and IDFT?
20. Explain the function of twiddle factor? List some a dvantages of digital filters over
analog filters.
21. Write some differences between FIR and IIR filters
22. What are the different methods to design IIR filters.
23. Why IIR filters are not reliable What are different applications of IIR filters
24. What are advantages of IIR filters.
25. What are disadvantages of IIR filters.
26. Differentiate Butterworth and Chebyshev approximations.
27. What is meant by impulse response.
28. What is the importance of impulse response to calculate the o/p response of the filter?
29. Describe impulse response of a function?
30. Where to use command filter or impz, and what is the difference between these two?
Applications:
It and the cumulative spectral density are very useful for identifying periodic components in
time series. For instance, say you want to study weather cycles or even something like daily
sales figures data for cycles. Cycles will show up pretty nicely as spikes in the PSD or CSD.
You can also use the PSD or CSD to help diagnose whether your model fits well. If the spikes
at identified frequencies are gone that’s a sign that you have identified the periodic
components.
42
DSP LAB MANUAL Dept of ECE
EXPERMENT NO-8
AIM: -
SOFTWARE REQURIED:-
1. MATLAB R2010a.
2.Windows XP SP2.
THEORY:-
In this equation, x(k) and y(n) represent the input to and output from the filter at time n. h(n-
k) is the transversal filter coefficients at time n. These coefficients are generated by using
FDS (Filter Design Software or Digital filter design package).
FIR – filter is a finite impulse response filter. Order of the filter should be specified.
Infinite response is truncated to get finite impulse response. Placing a window of finite length
does this. Types of windows available are Rectangular, Barlett, Hamming, Hanning,
Blackmann window etc. This FIR filter is an all zero filter.
PROCEDURE:-
Open MATLAB
Open new M-file
Type the program
Save in current directory
Compile and Run the program
For the output see command window\ Figure window
43
DSP LAB MANUAL Dept of ECE
PROGRAM:-
clc;
clear all;
close all;
rp=input('enter the pass band ripple:rp=');
rs=input('enter the stop band ripple:rs=');
fp=input('enter the pass band freq :fp=');
fs=input('enter the stop band freq:fp=');
f=input('enter the sampling freq:f=');
wp=2*fp/f;
ws=2*fs/f;
num=-20*log10(sqrt(rp*rs))-13;
den=14.6*(fs-fp)/f;
n=ceil(num/den);
n1=n+1;
if(rem(n,2)~=0);
n1=n;
n=n-1;
end;
c=input('enter the type of window function 1.rectangular 2.trangular 3.kaiser:n=');
if(c==1);
y=rectwin(n1);
disp('rectangular window filter response');
end;
if(c==2);
y=triang(n1);
disp('triangular window filter response');
end;
if(c==3);
y=kaiser(n1);
disp('kaiser window filter response');
end;
% low pass filter %
b=fir1(n,wp,y);
[n,o]=freqz(b,1,256);
m=20*log10(abs(n));
plot(o/pi,m);
xlabel('normalised freq output i');
ylabel('gain in db');
title('low pass filter');
44
DSP LAB MANUAL Dept of ECE
OUTPUT:-
-10
-20
-30
gain in db
-40
-50
-60
-70
-80
-90
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
normalised freq output i
45
DSP LAB MANUAL Dept of ECE
-5
-10
-15
gain in db
-20
-25
-30
-35
-40
-45
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
normalised freq output i
46
DSP LAB MANUAL Dept of ECE
-10
-20
-30
gain in db
-40
-50
-60
-70
-80
-90
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
normalised freq output i
RESULT:-
47
DSP LAB MANUAL Dept of ECE
EXERCISE PROGRAM:-
1. Write a matlab program to design FIR low pass filter using hamming/hanning
window?
2. Write a matlab program to design FIR low pass filter using hamming& blackman
window?
3. Write a matlab program to design FIR low pass filter with cutoff frequency .5pi using
frequency sampling method?
4. Write a matlab program to plot the frequency response of low pass filter using Kaiser
window for different values of beeta?
5. Write a matlab program to design FIR low pass filter for the given specifications using
Kaiser window?
6. Write a matlab program to design a 25-tap Hilbert transformer using Bartlett and
hamming windows and plot their frequency response?
7. Write a matlab program to design a 25-tap lowpass filter with cutoff frequency .5pi
radians using rectangular and hamming windows and plot their frequency response?
8. Write a matlab program to design a 25-tap highpass filter with cutoff frequency .5pi
radians using rectangular and Blackman windows and plot their frequency response?
9. Write a matlab program to design a 25-tap bandpass filter with cutoff frequency .25pi
& .75pi radians using rectangular and hamming windows and plot their frequency
response?
10. Write a matlab program to design a 25-tap bandstop filter with cutoff frequency .25pi
& .75pi radians using rectangular and hamming windows and plot their frequency
response?
11. Write a matlab program to design a 25-tap Hilbert transformer using Bartlett window
and plot the frequency response?
12. Write a matlab program to design a 25-tap Hilbert transformer using hamming window
and plot the frequency response?
13. Write a matlab program to design FIR low pass filter using hamming window?
14. Write a matlab program to design FIR low pass filter using blackman window?
15. Write a matlab program to design FIR high pass filter using blackman window?
16. Write a matlab program to design FIR high pass filter with cutoff frequency .5pi using
frequency sampling method?
17. Write a matlab program to plot the frequency response of high pass filter using Kaiser
window for different values of beeta?
18. Write a matlab program to design FIR high pass filter for the given specifications
using Kaiser window?
19. Write a matlab program to design a 25-tap Hilbert transformer using Bartlett and
hamming windows and plot their frequency response?
20. Write a matlab program to design a 25-tap high pass filter with cutoff frequency .5pi
radians using rectangular and hamming windows and plot their frequency response?
48
DSP LAB MANUAL Dept of ECE
VIVA QUESTIONS:-
1. Give the expression for finding the magnitude & phase response of FIR filter?
2. Compare different windows & their characteristics?
3. How FIR filters are designed using rectangular window?
4. What is Gibbs phenomenon? How it can be reduced?
5. Compare FIR&IIR filters?
6. What is "decimation-in-time" versus "decimation-in-frequency"?
7. What is "bit reversal"?
8. What do you mean by phase spectrum and magnitude spectrum/ give comparison?
9. How do you reduce spectral leakage?
10. What do you mean by spectral resolution?
11. What is FIR and IIR filter define, and distinguish between these two?
12. What is window method? How you will design an FIR filter using window method?
13. What are low-pass and band-pass filter and what is the difference between these two?
14. What is the matlab command for Hamming window? Explain.
15. What do you mean by built in function ‘abs’ and where it is used?
16. Explain how the FIR filter are stable?
17. Why is the impulse response "finite"?
18. What does "FIR" mean?
19. What are the advantages of FIR Filters (compared to IIR filters)?
20. What are the disadvantages of FIR Filters (compared to IIR filters)?
21. Define Gibb’s phenomena
22. What is meant by ringing effect?
23. Why do we need to represent a signal in frequency domain?
24. Why Fourier Series converges only for periodic signals?
25. How the ringing effect can be rectified?
26. What are the different forms of Fourier series?
27. What are the limitations of Fourier series?
28. Write few applications of Fourier series.
29. Explain the MATLAB functions ‘tic’ and ‘toc’
30. Explain the MATLAB function ‘legend’
The calculation of the digital filter function (DSP) is done by the CPU. For that a FIR
algorithm of Infineon's TriLib is used. The coefficients for the filter can be calculated with an
appropriate software program. For this application note the program "ScopeFIR" was used.
Finally the GPTA of the TC1775 generates a PWM signal with the digital filtered.
49
DSP LAB MANUAL Dept of ECE
EXPERMENT NO 9
SOFTWARE REQURIED:-
1. MATLAB R2010a.
2. Windows XP SP2.
THEORY:-
PROCEDURE:-
Open MATLAB
Open new M-file
Type the program
Save in current directory
Compile and Run the program
For the output see command window\ Figure window
PROGRAM:-
clc;
clear all;
close all;
disp('enter the sepecifications of iir filter');
rp=input('enter the pass band ripple:rp=');
rs=input('enter the stop band ripple:rs=');
wp=input('enter the pass band freq:wp=');
ws=input('enter the stop band freq:ws=');
fs=input('enter the sampling freq fs=');
w1=2*wp/fs;
w2=2*ws/fs;
[N,wc]=buttord(w1,w2,rp,rs,'s');
disp('freq resp of iir high pass filter is:');
[b,a]=butter(N,wc,'high','s');
w=0:0.001:pi;
50
DSP LAB MANUAL Dept of ECE
[n,omega]=freqs(b,a,w);
m=20*log10(abs(n));
subplot(2,1,1);
plot(omega/pi,m);
xlabel('normalised freq');
ylabel('gain');
title('magnitude response');
subplot(2,1,2);
plot(angle(n));
xlabel('normalised freq');
ylabel('phase');
title('phase response');
OUTPUT:-
51
DSP LAB MANUAL Dept of ECE
magnitude response
500
0
gain
-500
-1000
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
normalised freq
phase response
4
2
phase
-2
-4
0 500 1000 1500 2000 2500 3000 3500
normalised freq
RESULT:-
EXERCISE PROGRAM:-
15. Write a matlab program to design a Butterworth highpass filter for the specifications?
16. Write a matlab program to design a Butterworth bandreject filter for the
specifications?
17. Write a matlab program to design a chebyshev -I lowpass filter for the specifications?
18. Write a matlab program to design a chebyshev -II lowpass filter for the specifications?
19. Write a matlab program to design a chebyshev -I bandpass filter for the specifications?
20. Write a matlab program to design a chebyshev -II bandpass filter for the
specifications?
VIVA QUESTIONS:-
53
DSP LAB MANUAL Dept of ECE
EXPERMENT NO-10
AIM: -
Generation of Sine Wave & Illustration of the Sampling Process in the Time Domain.
SOFTWARE REQURIED:-
1. MATLAB R2010a.
2. Windows XP SP2.
THEORY:-
The sine wave or sinusoid is a mathematical function that describes a smooth repetitive
oscillation. It occurs often in pure mathematics, as well as physics, signal processing,
electrical engineering and many other fields. Its most basic form as a function of time (t)
where:
• A, the amplitude, is the peak deviation of the function from its center position.
• ω, the angular frequency, specifies how many oscillations occur in a unit time
interval, in radians per second
• φ, the phase, specifies where in its cycle the oscillation begins at t = 0.
A sampled sinusoid may be written as:
PROCEDURE:-
Open MATLAB
Open new M-file
Type the program
Save in current directory
Compile and Run the program
For the output see command window\ Figure window
54
DSP LAB MANUAL Dept of ECE
PROGRAM:-
clc;
t=0:0.0005:1;
a = 10
f = 13;
xa=a*sin(2*pi*f*t)
subplot(2,1,1)
plot(t,xa);
grid
xlabel('Time,msec')
;ylabel('Amplitude'
);
title('Continuous-time signal axis([01-
10.2 10.2])
subplot(2,1,2
); T = 0.01;
n = 0:T:1;
xs=a*sin(2*pi*f*n)
; k = 0:length(n)-1;
stem(k,xs);
grid
xlabel('Time index n');
ylabel('Amplitude');
title('Discrete-time signal
x[n]'); axis([0 (length(n)-1)
10.2 10.2])
55
DSP LAB MANUAL Dept of ECE
OUTPUT:-
RESULT:-
56
DSP LAB MANUAL Dept of ECE
EXERCISE PROGRAM:-
VIVA QUESTIONS:-
Realtime Applications
Detection of QRS complexes in ECG signals is required to determine heart rate, and it
is an important step in the study of cardiac disorders. ECG signals are usually affected by
noise of low and high frequency. To improve the accuracy of QRS detectors several methods
have been proposed to filter out the noise and detect the characteristic pattern of QRS
complex. Most of the existing methods are at a disadvantage from relatively high
computational complexity or high resource needs making them less optimized for its
implementation on portable embedded systems, wearable devices or ultra-low power chips.
We present a new method to detect the QRS signal in a simple way with minimal
computational cost and resource needs using a novel non-linear filter.
58
DSP LAB MANUAL Dept of ECE
EXPERMENT NO-11
AIM: -
The objective of this program is To Generate Dual Tone Multiple Frequency (DTMF)
Signals.
SOFTWARE REQURIED:-
1. MATLAB R2010a.
2. Windows XP SP2.
THEORY:-
PROCEDURE:-
Open MATLAB
Open new M-file
Type the program
Save in current directory
Compile and Run the program
For the output see command window\ Figure window
PROGRAM:-
clc;
clearall;
closeall;
59
DSP LAB MANUAL Dept of ECE
ty=[sin(y(1)*t),sin(y(2)*t),sin(y(3)*t),sin(y(4)*t)
]/2; for k=1:length(number)
switch
number(k)
case '1'
tone =
tx(:,1)+ty(:,1);
sound(tone);
stem(tone);
case '2'
tone =
tx(:,1)+ty(:,2);
sound(tone);
stem(tone);
case '3'
tone =
tx(:,1)+ty(:,3);
sound(tone);
stem(tone);
case '4'
60
DSP LAB MANUAL Dept of ECE
end;
OUTPUT:-
Input: 01234
61
DSP LAB MANUAL Dept of ECE
62
DSP LAB MANUAL Dept of ECE
RESULT:-
Dual Tone Multiple Frequency (DTMF) Signals are generated by using MAT LAB.
EXERCISE PROGRAM:-
1. Write a matlab program to generate a sine wave with amplitude = 3, frequency 20Hz?
2. Write a matlab program to generate a cos wave with amplitude = 3, frequency 20Hz?
3. Write a matlab program to generate a triangular wave with amplitude = 8, frequency
10Hz?
4. Write a matlab program to generate a square wave with amplitude = 2, frequency
10kHz?
5. Write a matlab program to generate a sinc wave with amplitude = -8, frequency5Khz?
6. Write a matlab program to generate a sine wave with amplitude = 7, frequency 29Hz.
7. Write a matlab program to generate a cos wave with amplitude = 9, frequency 50Hz.
8. Write a matlab program to generate a triangular wave with amplitude = 24, frequency
100Hz.
63
DSP LAB MANUAL Dept of ECE
9. Write a matlab program to generate a square wave with amplitude = 12, frequency
10kHz.
10. Write a matlab program to generate a sinc wave with amplitude = 5, frequency5Khz.
11. Write a matlab program to generate a sine wave with amplitude = 17, frequency
29kHz.
12. Write a matlab program to generate a cos wave with amplitude = 19,
frequency600kHz.
13. Write a matlab program to generate a triangular wave with amplitude = 24, frequency
100Hz.
14. Write a matlab program to generate a sawtooth wave with amplitude = 20, frequency
15kHz.
15. Write a matlab program to generate a sinc wave with amplitude = 8, frequency85Khz.
16. Write a matlab program to generate a triangular wave with amplitude = 10, frequency
20Hz?
17. Write a matlab program to generate a square wave with amplitude = 8, frequency
1kHz?
18. Write a matlab program to generate a sinc wave with amplitude = frequency5Khz?
19. Write a matlab program to generate a sine wave with amplitude = 7, frequency 29Hz?
20. Write a matlab program to generate a cos wave with amplitude = 9, frequency 50Hz?
VIVA QUESTIONS:-
1. Define Signal?
2. Define determistic and Random Signal?
3. Define Delta Function?
4. What is Signal Modeling?
5. Define Periodic and a periodic Signal?
6. Define impulse response.
7. Give me one example for impulse response.
8. Write the Formula for impulse response.
9. What are major role in order & length?
10. Define power spectral Density?
11.What is the need for spectral estimation?
12.Determine the power spectrum density?
13. What is the relation between auto correlation & spectral density?
14. Give the estimation of auto correlation function & power density for random Signals?
15. Explain power spectrum estimation using the Bartlett window?
16. Give the formula for PSD.
17. What is filter?
18. What do you mean by phase spectrum and magnitude spectrum/ give comparison?
19. How do you reduce spectral leakage?
20. What do you mean by spectral resolution?
21. Define sinusoidal signal
22. Define C.T.S .
23. Define D.T.S.
24. Compare C.T.S & D.T.S.
64
DSP LAB MANUAL Dept of ECE
25. Define Stem, Plot, Plot3,fplot, ezplot, linspace, flyplr, grid,mesh and legend.
26. Draw the C.T.S & D.T.S diagrams.
27. Define signal and signal processing.
28. Differentiate digital and analog signals?
29. How the DSP processor will differ from conventional processors?
30. Expand the abbreviation TMS320C 5X/6X
Realtime Applications
65
DSP LAB MANUAL Dept of ECE
EXPERMENT NO-12
AIM: -
The objective of this program is To Perform Decimation on the Given Input Sequence.
SOFTWARE REQURIED:-
1. MATLAB R2010a.
2. Windows XP SP2.
THEORY:-
In digital signal processing, decimation is the process of reducing the sampling rate of
a signal. Complementary to interpolation, which increases sampling rate, it is a specific case
of sample rate conversion in a multi-rate digital signal processing system. Decimation utilizes
filtering to mitigate aliasing distortion, which can occur when simply down sampling a signal.
A system component that performs decimation is called a decimator.
PROCEDURE:-
Open MATLAB
Open new M-file
Type the program
Save in current directory
Compile and Run the program
For the output see command window\ Figure window
PROGRAM:-
%decimation%
clc;
clear all;
close all;
N=input('enter sample value');
n=0:N-1;
m=input('enter down sampling factor');
x=sin(2*pi*0.043*n)+sin(2*pi*0.031*n);
y=decimate(x,m,'fir');
subplot(2,1,1);
stem(n,x(1:N));
xlabel('time');
ylabel('amp');
title('input sequence');
66
DSP LAB MANUAL Dept of ECE
t=0:(N/m)-1;
subplot(2,1,2);
stem(t,y(1:N/m));
xlabel('time');
ylabel('amp');
title('output sequence');
OUTPUT:-
input sequence
2
1
amp
-1
-2
0 10 20 30 40 50 60 70
time
output sequence
2
1
amp
-1
-2
0 2 4 6 8 10 12 14 16 18 20
time
RESULT:-
This MATLAB program has been written to perform Decimation on the Given
Input Sequence.
67
DSP LAB MANUAL Dept of ECE
EXERCISE PROGRAM:-
VIVA QUESTIONS:-
1. Define decimation?
2. Define multi rate signal processing?
3. What are the effects of coefficient quantization in FIR filters?
4. What is quantization process?
5. What is transmultiplexer? What is its use?
6. What is the DC gain of a FIR filter?
7. What do you mean by cut-off frequency?
8. Give the difference between analog and digital filter?
9. What is the difference between type 1 and type 2 filter structure?
10. what is the role of delay element in filter design?
11. Explain how the frequency is filter in filters?
12. Differences between Butterworth chebyshev filters?
68
DSP LAB MANUAL Dept of ECE
13. Can IIR filters be Linear phase? how to make it linear Phase?
14. What is the special about minimum phase filter?
15. What is the special about maximum phase filter?
16. In signal processing, why we are much more interested in orthogonal transform?
17. How is the non-periodic nature of the input signal handled?
18. If a have two vectors how will i check the orthogonality of those vectors.
19. What is the importance of decimation for a given signal/sequence?
20. What do you mean Aliasing? What is the condition to avoid aliasing for sampling?
21. Define impulse response.
22. Give me one example for impulse response.
23. Write the Formula for impulse response.
24. What are major role in order & length?
25. Define power spectral Density?
26. What is the need for spectral estimation?
27. Determine the power spectrum density?
28. What is the relation between auto correlation & spectral density?
29. Give the estimation of auto correlation function & power density for random Signals?
30. Explain power spectrum estimation using the Bartlett window?
REAL TIMEAPPLICATIONS:
It was originally developed for processing broadband, low frequency geophysical data in
real time using a small digital processor. Sine and Cosine transforms are applied to sequences
of data produced by successively applying a low pass digital filter and decimation by two
operator to the original data. The resulting spectra are the average of estimates which are
independent in time and represent constant percentage bandwidths. Thus, the technique is
particularly well suited to applications where it is desireable to reject intervals of bad data or
those which are naturally expressed on a log-frequency scale.
69
DSP LAB MANUAL Dept of ECE
EXPERMENT NO-13
AIM: -
The objective of this program is To Perform up sampling on the given Input Sequence.
SOFTWARE REQURIED:-
1. MATLAB R2010a.
2. Windows XP SP2.
THEORY:-
PROCEDURE:-
Open MATLAB
Open new M-file
Type the program
Save in current directory
Compile and Run the program
For the output see command window\ Figure window
PROGRAM:-
%interpolation%
clc;
clear all;
close all;
N=input('enter sample value');
n=0:N-1;
L=input('enter up sampling factor');
x=sin(2*pi*0.043*n)+sin(2*pi*0.031*n);
y=interp(x,L);
subplot(2,1,1);
stem(n,x(1:N));
xlabel('time');
ylabel('amp');
title('input sequence');
70
DSP LAB MANUAL Dept of ECE
t=0:(N*L)-1;
subplot(2,1,2);
stem(t,y(1:N*L));
xlabel('time');
ylabel('amp');
title('output sequence');
OUTPUT:-
input sequence
2
1
amp
-1
-2
0 5 10 15 20 25 30 35 40 45 50
time
output sequence
2
1
amp
-1
-2
0 50 100 150 200 250
time
RESULT:-
This MATLAB program has been written to perform interpolation on the Given
Input Sequence.
71
DSP LAB MANUAL Dept of ECE
EXERCISE PROGRAM:-
VIVA QUESTIONS:-
11. What happens if I violate the Nyquist criteria in down sampling or decimating?
12. Can we do decimate in multiple stages?
13. What are "decimation" and "downsampling"?
14. What is the "decimation factor
15. How does poly phase filtering save computations in an interpolation filter?
16. Why do we need I&Q signals?
17. What is Interpolation and decimation filters and why we need it?
18. What are "up sampling" and "interpolation"?
19. Why interpolate, needed for any signal/sequence?
20. What is the "interpolation factor"?
21. What kind of processor is DSP processor?
22. What are the main building
23. blocks of DSP processor?
24. What is the main function of MAC unit?
25. Explain VLIW architecture?
26. Explain the significance of convolution.
27. Define linear convolution.
28. Why linear convolution is called as a periodic convolution?
29. Why zero padding is used in linear convolution?
30. What are the four steps to find linear convolution?
APPLICATIONS:
Interpolation is a technique for obtaining new unknown data points within the range of
discrete known data points and is often used to recover an image from its downsampled
version, or to simply perform image expansion.
73
DSP LAB MANUAL Dept of ECE
EXPERMENT NO-14
AIM: -
SOFTWARE REQURIED:-
1. MATLAB R2010a.
2. Windows XP SP2.
THEORY:-
PROCEDURE:-
Open MATLAB
Open new M-file
Type the program
Save in current directory
Compile and Run the program
For the output see command window\ Figure window
PROGRAM:-
% interpolation/dismation sampling %
74
DSP LAB MANUAL Dept of ECE
x=sin(2*pi*0.043*n)+sin(2*pi*0.03*n);
y=resample(x,l,m);
subplot(2,1,1);
stem(n,x(1:N));
xlabel('time');
ylabel('amplitude');
title('input sequence');
t=0:(N*l/m)-1;
subplot(2,1,2);
stem(t,y(1:N*l/m));
xlabel('time');
ylabel('amplitude');
title('input sampling sequence');
OUTPUT:-
input sequence
2
1
amplitude
-1
-2
0 5 10 15 20 25 30
time
input sampling sequence
2
1
amplitude
-1
-2
0 20 40 60 80 100 120
time
75
DSP LAB MANUAL Dept of ECE
RESULT:-
EXERCISE PROGRAM:-
76
DSP LAB MANUAL Dept of ECE
VIVA QUESTIONS:-
Interpolation is a technique for obtaining new unknown data points within the range of
discrete known data points and is often used to recover an image from its downsampled
version, or to simply perform image expansion.
It was originally developed for processing broadband, low frequency geophysical data in
real time using a small digital processor. Sine and Cosine transforms are applied to sequences
of data produced by successively applying a low pass digital filter and decimation by two
operator to the original data. The resulting spectra are the average of estimates which are
independent in time and represent constant percentage bandwidths. Thus, the technique is
77
DSP LAB MANUAL Dept of ECE
particularly well suited to applications where it is desireable to reject intervals of bad data or
those which are naturally expressed on a log-frequency scale.
EXPERMENT NO-15
AIM: -
SOFTWARE REQURIED:-
1.MATLAB R2010a.
2.Windows XP SP2.
THEORY:-
Second order systems are the systems or networks which contain two or
more storage elements and have describing equations that are second order
differential equations.
PROCEDURE:-
Open MATLAB
Open new M-file
Type the program
Save in current directory
Compile and Run the program
For the output see command window\ Figure window
PROGRAM:-
78
DSP LAB MANUAL Dept of ECE
h=impz(b,a,N);
n=0:N-1;
subplot(2,1,1);
stem(n,h);
xlabel('discrete time');
ylabel('amplitude');
title('Impulse Response');
subplot(2,1,2);
zplane(b,a);
xlabel('real axis');
ylabel('imaginary axis');
title('pole zero in z-plane');
OUTPUT:-
Impulse Response
1
amplitude
0.5
0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
discrete time
pole zero in z-plane
1
imaginary axis
0.5
2
0
-0.5
-1
-3 -2 -1 0 1 2 3
real axis
79
DSP LAB MANUAL Dept of ECE
RESULT:-
EXERCISE PROGRAM:-
1. Write a matlab program to find the frequency response of the following difference
equation y(n)-7y(n-1)+9y(n-2)=3x(n)-2x(n-1)?
2. Write a matlab program to find the frequency response of the following difference
equation 3y(n)+5y(n-1)=9x(n)?
3. Write a matlab program to find the frequency response of the following difference
equation 9 y(n)-2y(n-1)+7y(n-2)-3y(n-3)=6x(n)+x(n-1)?
4. Write a matlab program to find the frequency response of the following difference
equation 8y(n)+6y(n-1)=4x(n)+2x(n-1)?
5. Write a matlab program to find the frequency response of the following difference
equation 3y(n)-8y(n-1)+9y(n-2)=9x(n)+5x(n-1) ?
6. Write a matlab program to find the frequency response of the following difference
equation 6y(n)-5y(n-1)=9x(n)+5x(n-1) -7x(n-2)?
7. Write a matlab program to find the frequency response of the following difference
equation 9y(n)-8y(n-1)+2y(n-2)=9x(n)-3x(n-1) ?
8. Write a matlab program to find the frequency response of the following difference
equation 2y(n)-8y(n-1)=9x(n)+5x(n-1) ?
9. Write a matlab program to find the frequency response of the following difference
equation 9y(n)-8y(n-1)+9y(n-2)=9x(n)+5x(n-1)-x(n-2) ?
10. Write a matlab program to find the frequency response of the following difference
equation 3y(n)-8y(n-1)=7x(n)-3x(n-1) ?
VIVA QUESTIONS:-
APPLICATIONS:
In practical systems, it is not possible to produce a perfect impulse to serve as input for testing;
therefore, a brief pulse is sometimes used as an approximation of an impulse. Provided that the
pulse is short enough compared to the impulse response, the result will be close to the true,
theoretical, impulse response. In many systems, however, driving with a very short strong pulse
may drive the system into a nonlinear regime, so instead the system is driven with a pseudo-
random sequence, and the impulse response is computed from the input and output signals..
81