Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
KL University, Vaddeswaram
Dept. of ECE
B. Tech (All branches), IInd year, Sem-1
Signal Processing-13-ES205: 2015-16
Prepared by
Dr. M. Venu Gopala Rao
Professor
Dept. of ECE
Dr. M. Venu Gopala Rao, Professor, Dept. of ECE, KL University, A.P., India.
PROJECT BASED LABSINTEGRATING THEORY WITH PRACTICE
Introduction
Project-based learning introduces students to a discipline through the process of
conceiving, designing, and implementing activities which integrate theory with practice.
This project focuses on technology-enabled learning spaces that are optimized for interpersonal small group interaction as well as for using practical tools to implement project
work. Project Based Learning is a transformative teaching method for engaging all
students in meaningful learning and developing the competencies of critical
thinking/problem solving, collaboration, creativity and communication.
The need to move towards project based labs is due to the following reasons:
Todays students, more than ever, often find college to be boring and
meaningless. In Project Based Learning, students are active, not passive. A
project engages their hearts and minds, and provides real-world relevance for
learning.
After completing a project, students remember what they practice rather than
learn and retain it for a longer period. Because of this, students who gain content
knowledge with Project Based Learning are better able to apply what they know
and can do to new situations.
In the 21st century workplace, success requires more than basic knowledge and
skills. In Project Based Learning, students not only understand content more
deeply but also learn how to solve problems, work collaboratively, communicate
ideas, and be creative innovators.
The Common Core and other present-day standards emphasize real-world
application of knowledge and skills, and the development of the 21st century
competencies such as critical thinking, communication in a variety of media, and
collaboration. Project Based Learning provides an effective way to address such
standards.
Modern technology which students use so much in their lives is a perfect fit
with project based lab. With technology, teachers and students can connect with
experts, partners, and audiences around the world, and use tech tools to find
resources and information, create products, and collaborate more effectively.
Dr. M. Venu Gopala Rao, Professor, Dept. of ECE, KL University, A.P., India.
Project Based Learning allows teachers to work more closely with active,
engaged students doing high-quality, meaningful work, and in many cases to
rediscover the joy of learning alongside their students.
In Project Based Learning, students go through an extended process of inquiry in
response to a complex question, problem, or challenge. Essential requirements of
PROJECT BASED LAB include:
Significant Content - At its core, the project should be focused on teaching students
important knowledge and skills, derived from standards and key concepts at the
heart of academic subjects.
Competencies - Students should build competencies valuable for todays world,
such as critical thinking/problem solving, collaboration, and communication, and
creativity/ innovation, which are taught and assessed.
In-Depth Inquiry - Students should be engaged in a rigorous, extended process of
asking questions, using resources, and developing answers.
Driving Question - Project work should be focused on an open-ended question that
students understand and find intriguing, which captures their task or frames their
exploration.
Need to Know - Students should see the need to gain knowledge, understand
concepts, and apply skills in order to answer the Driving Question and create project
products, beginning with an Entry Event that generates interest and curiosity.
Voice and Choice - Students are allowed to make some choices about the products
to be created, how they work, and how they use their time, guided by the teacher.
Revision and Reflection - The project should include processes for students to use
feedback to consider additions and changes that lead to high-quality products, and
think about what and how they are learning.
Public Audience - Students should be able to present their work to other people,
beyond their classmates and teacher.
Execution Of Project Based Lab In K L University:
Every B. Tech program will be designed to achieve certain outcomes that Map to
Program Education Objectives that are set for all the B. Tech programs taken together.
Some of the outcomes that are set for the B. Tech programs in KLU are to be achieved
through the Project Based Lab component. The execution of project based lab occurs in
two phases:
3
Dr. M. Venu Gopala Rao, Professor, Dept. of ECE, KL University, A.P., India.
Phase I: Experiments Based: First six weeks student need work out and execute the
list of programs /experiments as decided by the instructor. These lists of programs
/Experiments must cover all the basics required to implement any project in the
concerned course lines.
Phase II: Project Based: After six weeks student needs to work out on the project on
the concerned course designed by faculty or he may be allowed to do implement his
own idea in the concerned course.
Dr. M. Venu Gopala Rao, Professor, Dept. of ECE, KL University, A.P., India.
Page No.
1.
8-9
2.
10
3.
11-12
4.
13-15
5.
16
6.
7.
17
18
8.
19-20
9.
21-22
10.
23-24
11.
25-26
12.
27-28
13.
29-30
14.
31-32
15.
33-34
16.
35-36
17.
37-38
18.
39-40
19.
41
20.
42-43
21.
44-46
22.
47-49
23.
50-52
24.
53-54
25.
Estimating the Time Delay using Correlation for Audio Signals and its
Echoes.
55
Dr. M. Venu Gopala Rao, Professor, Dept. of ECE, KL University, A.P., India.
Additional Recommended Projects
26. Cepstral Analysis of Speech signals.
27. Linear Prediction Analysis.
28. Identifying a vowels in the speech signal.
29. Cepstral-Based Formant Estimation
30. Design and implementation of Anti-aliasing filter.
31. Log Harmonic Product Spectrum Pitch Detector
32. LPC-Based Pitch Detector
33. LPC-Based Formant Estimation
34. Filter the Speech Signal in Order to Eliminate Extraneous Low and High Frequency
Components
35. Eliminating the Frequency Conversion Components in Analog Signals using Digital
FIR Filter.
36. Short Term Frequency domain Processing of Speech signals.
37. Wideband and narrowband speech spectrograms for a user-designated speech file
38. Simulation of ECG signal
39. Spectral Smoothing
40. Autocorrelation Estimates for speech signals
41. Sampling Rate Conversion Between Typical Speech and Audio Rates
42. Correlation Techniques to Process Noise-Corrupted Signals
43. Echo and Reverberation.
44. Time-domain scrambling of audio signals
45. Non-Stationary Nature of Speech Signal.
46. Response of Composite Discrete-Time LTI Systems.
47. Even and Odd Components of Spectrum for an Arbitrary Sequence.
48. Real and Imaginary Components of Spectrum for an Arbitrary Sequences.
49. Frequency Response of Composite DT Systems with Time Reversal Sequences.
50. Sampling and Reconstruction of Analog Signals with Aliasing.
51. Response of LTI systems for a Weighted and Delayed Input Sequences
Dr. M. Venu Gopala Rao, Professor, Dept. of ECE, KL University, A.P., India.
References:
1. John G. Proakis and Dimitris G. Manalakis, Digital Signal Processing, principles,
algorithms and applications, Pearson Prentice Hall, 2011.
2. Alan V. Oppenheim, Ronald W. Schafer, Discrete-Time Signal Processing, Pearson
Education Signal Processing Series, 2002.
3. Vinay K. Ingle and John G. Proakis, Essentials of Digital Signal Processing Using
MATLAB,Third Edition 2012, Cengage Learning.
5. Li Tan, Digital Signal Processing, Academic Press, Elsevier Inc, 2008.
6. Sanjit H. Mitra, Digital Signal Processing, A computer based approach, Third edition,
Tata McGraw-Hill Publishing Company Limited, 2010.
7. Rabiner, Digital Processing of Speech Signals Prentice-Hall Signal Processing Series:
Pearson Education, India.
8. E. S. Gopi,Digital Speech Processing Using Matlab, Springer, India, 2014,
ISBN: 978-81-322-1676-6.
9. http://cronos.rutgers.edu/~lrr/
10. www.mathworks.in/matlabcentral/fileexchange/
11. http://cvsp.cs.ntua.gr/~nassos/resources/speech_course_2004/
12. Voicebox Toolbox.
Dr. M. Venu Gopala Rao, Professor, Dept. of ECE, KL University, A.P., India.
SP Project-1
ya (t ) axa (t td ) va (t )
and, va (t ) is additive random noise. The signals xa (t ) and ya (t ) are sampled in the
receiver, according to the sampling theorem, and are processed digitally to determine
the time delay and hence the distance of the object. The resulting discrete-time signals
are
8
Dr. M. Venu Gopala Rao, Professor, Dept. of ECE, KL University, A.P., India.
x[n] xa (nT )
y[n] ya (nT ) axa (nT td ) va (nT )
ax[n D] v[n]
Task1: Explain how we can measure the delay D by computing the auto-correlation
rxy (l ) .
Task2: Let x[n] be the 13-point Barker sequence:
30 l 30 . Use the plot to estimate the value of the delay D in both cases and
compare and comment.
Task4: Repeat parts (b) and (c) for 2 0.1 and 2 1 .
Task5: If x[n] is 32 pseudo random noise m-sequence and given by
x[n] [1,-1,-1,1,-1,1,1,-1,-1,1,1,1,1,1,-1,-1,-1,1,1,-1,1,1,1,-1,1,-1,1,-1,-1,-1,-1,-1]
and the received y[n] is given by
y[n] =[ 0.4923 0.6947 0.9727 0.3278 0.8378 0.7391 0.9542 0.0319 0.3569 0.6627
1.2815 -0.7696 -0.2889 1.6246 -0.4094 1.6604 1.0476 -0.6512 -0.5487 1.2409
1.7150 1.8562 1.2815 1.7311 -0.8622 -0.1633 -0.8614 1.5882 1.3662 -0.1932
1.5038 1.4896 1.8770 -0.6469 1.4494 -0.0365 1.0423 -0.0270 -0.8108 -0.3329
-0.4136 -0.3249 0.3610 0.6203 0.8112 0.0193 0.0839 0.9748 0.6513 0.2312
0.4035 0.1220 0.2684 0.2578 0.3317 0.1522 0.3480 0.1217 0.8842 0.0943]
Plot the cross-correlation function rxy (l ) and from the plot find the time delay. If the
sampling frequency is 1 MHz, Find the distance between the object and the radar.
Reference:
Page 116 and 144, John G. Proakis and Dimitris G. Manolakis. Digital Signal
Processing, Principles, Algorithms and Applibations, Fourth edition, Pearson Prentice
Hall, 2007.
Dr. M. Venu Gopala Rao, Professor, Dept. of ECE, KL University, A.P., India.
SP Project-2
Task2: Consider Fig (a). Determine x[n] , y[n] and y1(t ) . Plot x[n] , y[n] , y1(t ) using
Sync interpolation filter and their spectrum for two cases Fs 50 Hz and Fs 30 Hz.
10
Dr. M. Venu Gopala Rao, Professor, Dept. of ECE, KL University, A.P., India.
SP Project-3
Task2: Add a 50 Hz sinusoidal frequency to the ECG signal to produce distorted ECG
signal xw (t ) . Plot xw (t ) and its spectrum.
Task3: Design a second order FIR Notch filter to remove power line interference. The
transfer function of such a filter is defined as H [ z ] b0[1 2cos 0 z 1 z 2 ] , where 0
is frequency to be suppressed. Choose b0 so that | H [e j ] | 1 for 0 . Plot impulse
response, xa (t ) and their spectrum.
Task4: Design a second order pole-zero Notch filter to remove power line interference.
The transfer function of such a filter is defined as
H [ z ] b0
1 2cos 0 z 1 z 2
,
1 2r cos 0 z 1 r 2 z 2
11
Dr. M. Venu Gopala Rao, Professor, Dept. of ECE, KL University, A.P., India.
where 0 is frequency to be suppressed and r is a constant. Consider r for two cases
(i) r 0.85 , and (ii) r 0.95 . Choose b0 so that | H [e j ] | 1 for 0 . Plot impulse
response, xa (t ) and their spectrum.
Reference: Page 339, 376 problem 5.52, John G. Proakis and Dimitris G. Manolakis.
Digital Signal Processing, Principles, Algorithms and Applibations, Fourth edition,
Pearson Prentice Hall, 2007.
12
Dr. M. Venu Gopala Rao, Professor, Dept. of ECE, KL University, A.P., India.
SP Project-4
13
Dr. M. Venu Gopala Rao, Professor, Dept. of ECE, KL University, A.P., India.
b b z 1 b2 z 2
H [ z] 0 1
1 a1z 1 a2 z 2
that has zeros at the selected frequencies and corresponding poles. The zeros should
be e j 2 f n and the poles should be re j 2 f n , where r is slightly less than 1, and f n
is normalized frequency (cycles/sample); this should be a number between zero and one
half. Verify different values of r .
Task4: Repeat Task2 for your `no' signal.
Based on the spectra that you compute, what is the pitch frequency of your speech?
(The pitch frequency is the fundamental frequency of the quasi-periodic voiced speech
signal.)
Task5: Plot the pole-zero diagram of your filter (use the Matlab command zplane) in
Matlab. Verify that the poles and zero match where they were designed to be.
Task6: Plot the frequency response magnitude of your filter | H [ f ] | versus physical
frequency (the frequency axis should go from zero to half the sampling frequency). You
can use the Matlab command freqz to compute the frequency response. Verify that the
frequency response has a null at the intended frequency.
Task7: Plot the impulse response h[n] of your filter. You can create an impulse signal
and then use the Matlab command filter to apply your filter to the impulse signal.
Task8: Apply your filter to your speech signal (use Matlab command filter). Extract a
short segment of your speech signal before and after filtering. Plot both the original
speech waveform x[n] and filtered speech waveform y[n] (you might try to plot them on
the same axis). Also plot the difference between these two waveforms d[n] = y(n) - x[n]
What do you expect the signal d[n] to look like?
For the short segment you extract from the original and filtered speech waveforms,
compute and plot the spectrum. Were you able to eliminate the spectral peak that you
intended to?
14
Dr. M. Venu Gopala Rao, Professor, Dept. of ECE, KL University, A.P., India.
15
Dr. M. Venu Gopala Rao, Professor, Dept. of ECE, KL University, A.P., India.
SP Project-5
analog
signals
from
discrete-time
sequences
using
various
interpolation filters
(c) Study the effect of phase on reconstruction signals.
(d) Design a filter to remove noise.
/ 3 and / 2
Task2: This analog signal is sampled at Ts 0.05 sec intervals to obtain x[n] Compute
x[n] from xa (t ) for all the phase values. Plot x[n] and their spectrum.
Task3: Reconstruct the analog signal ya (t ) from the samples x[n] using (a) Sync
(b) Cubic Spline interpolation filters. Use t 0.001 sec.
Task4: Observe the resultant construction in each case that has the correct frequency
but a different amplitude. Explain these observations. Comment on the role of phase of
Reference : Vinay K. Ingle and John G. Proakis, Digital Signal Processing Using
MATLAB, Third Edition 2012, 2007 Cengage Learning.
16
Dr. M. Venu Gopala Rao, Professor, Dept. of ECE, KL University, A.P., India.
SP Project-6
Reference : Vinay K. Ingle and John G. Proakis, Digital Signal Processing Using
MATLAB, Third Edition 2012, 2007 Cengage Learning.
17
Dr. M. Venu Gopala Rao, Professor, Dept. of ECE, KL University, A.P., India.
SP Project-7
Digital Processing of Speech Signals using the preemphasis filter and Band-pass Filter
Objectives:
(a) Load, store display and manipulations of Speech signals.
(b) Plot the speech signals in time domain and frequency domain.
(c) Design of Pre-emphasis filter and Band-pass filters.
(d) Compute and display the response of Pre-emphasis and Band-pass filters.
18
Dr. M. Venu Gopala Rao, Professor, Dept. of ECE, KL University, A.P., India.
SP Project-8
Objectives
(a) Load, display and manipulating of ECG signals
(b) Design notch filters both in FIR and IIR for 50 Hz and 100 Hz respectively.
(c) Design a band pass filter to eliminate muscle noise.
(d) Plot the spectrum of the designed filters.
(e) Display the corrupted and filtered ECG signals and their spectrum.
Task1: Load an ECG signal. add a 50 Hz, and 100 Hz frequency sinusoidal signals to
this ECG signals. Plot the original ECG signal, corrupted ECG signal and their spectrum.
Task2: Design two notch filters with the following specifications.
19
Dr. M. Venu Gopala Rao, Professor, Dept. of ECE, KL University, A.P., India.
Notch Filters:
Frequencies to be suppressed : 50 Hz and 100 Hz.
3 dB bandwidth for each filter : 4 Hz.
Sampling rate
: 600 Hz
Design methods
Bandpass Filter:
Passband frequency range
: 0.25 40 Hz.
Passband ripple
: 0.5 dB
Sampling rate
: 600 Hz
Filter type
Design method
: Bilinear transformation
References:
DSP by Proakis, pp339,
Dr. M. Venu Gopala Rao, Professor, Dept. of ECE, KL University, A.P., India.
SP Project-9
Objectives:
(a) Load, display and manipulating of speech signals
(b) Design notch filters both in FIR and IIR for 360 Hz and 1080 Hz respectively.
(c) Plot the spectrum of the designed filters.
(d) Display the corrupted and filtered speech signals and their spectrum.
Task1: A speech sampled at 8000 Hz is corrupted by a sine wave of 360 Hz. Design a
notch filter to eliminate the unwanted interference signal.
Load a speech signal sampled at 8000 Hz. Add a 360 Hz frequency sinusoidal signals to
this speech signals. Plot the original speech signal, corrupted speech signal and their
spectrum.
Task2: Design a notch filter with the following specifications.
Notch Filters:
Type of Notch filter
: Chebyshev filter
Center frequency
: 360 Hz
Bandwidth
: 60 Hz.
Passband ripple
: 0.5 dB
Stopband attenuation
Determine the transfer function and difference equation. Plot the filtered signal and its
spectrum.
Task3: Assume that the speech signal is corrupted by a sine wave of 360 Hz and its
third harmonic. Design two notch filters that are cascaded to remove noise signals. The
possible specifications are given as below.
21
Dr. M. Venu Gopala Rao, Professor, Dept. of ECE, KL University, A.P., India.
Notch Filter1:
Type of Notch filter
: Chebyshev filter
Center frequency
: 360 Hz
Bandwidth
: 60 Hz.
Passband ripple
: 0.5 dB
Stopband attenuation
Notch Filter2:
Type of Notch filter
: Chebyshev filter
Center frequency
: 1080 Hz
Bandwidth
: 60 Hz.
Passband ripple
: 0.5 dB
Stopband attenuation
Determine the transfer function and difference equation. Plot the filtered signal and its
spectrum.
22
Dr. M. Venu Gopala Rao, Professor, Dept. of ECE, KL University, A.P., India.
SP Project-10
: 600 Hz
23
Dr. M. Venu Gopala Rao, Professor, Dept. of ECE, KL University, A.P., India.
Type of Notch filter
Design methods
24
Dr. M. Venu Gopala Rao, Professor, Dept. of ECE, KL University, A.P., India.
SP Project-11
Background:
The QRS complex detection algorithm developed by Pan and Tompkins identifies QRS
complexes based on analysis of the slope, amplitude, and width. The various stages of
the algorithm are shown in Figure 1. The bandpass filter, formed using lowpass and
highpass filters, reduces noise in the ECG signal. Noise such as muscle contraction
artifacts, 60 Hz power-line interference, and baseline wander are removed by bandpass
filtering. The signal is then passed through a differentiator for highlighting the high slopes
that distinguish QRS complexes from low-frequency ECG components such as the P
and T waves. The next operation is the squaring
operation, which emphasizes the higher values that are mainly due to QRS complexes.
The squared signal is then pass through a moving-window integrator of window length
N= 30 samples (for a sampling frequency of fs = 200 Hz). The result is a single smooth
peak for each ECG cycle. The output of the moving-window integrator may be used to
detect QRS complexes, measure RR intervals, and determine the QRS complex
duration (see Figure 2).
Tasks1: Download the ECG data files (sampled at 200 Hz). Develop a Matlab program
to perform the various filtering procedures that form the Pan-Tompkins algorithm. Use
the 'filter' command for each step. Study the plots of the results at different stages of the
QRS-detection algorithm.
Tasks2: Implement a simple thresholding procedure including a blanking interval for the
detection of QRS waves from the output of the Pan-Tompkins algorithm.
25
Dr. M. Venu Gopala Rao, Professor, Dept. of ECE, KL University, A.P., India.
Tasks3: Develop Matlab code to use the output of the Pan-Tompkins algorithm to detect
QRS complexes and compute the following parameters for each of the sample ECG
signals provided:
1. Total number of beats in each signal and the heart rate in beats per minute.
2. Average RR interval and standard deviation of RR intervals of each signal (in ms).
3. Average QRS width computed over all the beats in each signal (in ms).
26
Dr. M. Venu Gopala Rao, Professor, Dept. of ECE, KL University, A.P., India.
SP Project-12
The electro cardiographic signal (ECG) is the electrical representation of the hearts
activity. Computerized ECG analysis is widely used as a reliable technique for the
diagnosis of cardio vascular diseases. Baseline wander is an artifact which produces
atrifactual data when measuring the ECG parameters, especially the ST segment
measures are strongly affected by this wandering. In most of the ECG recordings the
respiration, electrode impedance change due to perspiration and increased body
movements are the main causes of the baseline wandering. The baseline wander noise
makes the analysis of ECG data difficult, and therefore it is necessary to suppress this
noise for correct evaluation of ECG.
Objectives
(a) Load, display and manipulating ECG signals
(b) Design and implementation of various filters to remove the baseline wander
artifact.
(c) Compare of various filtering techniques.
(d) Compute power spectral density and plot their spectrum.
Respiratory signal wanders between 0.15Hz and 0.5Hz frequencies. The design of a
linear, time-invariant, high pass filter for removal of baseline wander involves several
considerations, of which the most crucial are the choice of filter cut-off frequency and
phase response characteristic. The cut-off frequency should be chosen so that the
clinical information in the ECG signals remains undistorted while as much as possible of
the baseline wander is removed. Hence, it is essential to find the lowest frequency
component of the ECG spectrum. In general, the slowest heart rate is considered to
define this particular frequency component; the PQRST waveform is attributed to higher
frequencies. If too high a cut-off frequency is employed, the output of the high pass filter
contains an unwanted, oscillatory component that is strongly correlated to the heart rate.
On the basis of Impulse Response, there are generally two types of digital Filters:
Infinite Impulse response(IIR)
Finite impulse Response(FIR)
27
Dr. M. Venu Gopala Rao, Professor, Dept. of ECE, KL University, A.P., India.
Task1: Perform mean and median (or moving average) filter to eliminate the baseline
wander artifact. Plot the original, filtered ECG signals and their spectrum. Compute the
power density spectrum of the signals.
Task2: Perform two stages mean and median (or moving average) filter to eliminate the
baseline wander artifact. Plot the original, filtered ECG signals and their spectrum.
Compute the power density spectrum of the signals.
Task3: Perform first order zero-phase low pass filter to eliminate the baseline wander
artifact. Plot the original, filtered ECG signals and their spectrum. Compute the power
density spectrum of the signals.
Note: Zero-phase filtering minimizes start-up and ending transients by matching initial
conditions & helps in preserving features in the filtered time waveform exactly where
those features occur in the unfiltered waveform
Task4: Perform band pass filter using FFT filtering to eliminate the baseline wander
artifact. Plot the original, filtered ECG signals and their spectrum. Compute the power
density spectrum of the signals.
Compare the parameters of all filtering approaches.
Filtration
Method
PSD at 0.35Hz
(dB/Hz) Before
filtration
PSD at 0.35Hz
(dB/Hz) After
filtration
SNR
(dB)
Average Power
of Signal
(dB)
Waveform
Modification
IIR HP
IIR zero
phase
FIR HP
FIR zero
phase
Moving
Average
Mean
SavitzkyGolay
Polynomial
Fitting
28
Dr. M. Venu Gopala Rao, Professor, Dept. of ECE, KL University, A.P., India.
SP Project-13
A reliable way of obtaining an estimate of the dominant fundamental frequency for long,
clean, stationary speech signals is to use the cepstrum. The cepstrum is a Fourier analysis
of the logarithmic amplitude spectrum of the signal as shown in Fig.1. If the log
amplitude spectrum contains many regularly spaced harmonics, then the Fourier analysis
of the spectrum will show a peak corresponding to the spacing between the harmonics:
i.e. the fundamental frequency. Effectively we are treating the signal spectrum as another
signal, then looking for periodicity in the spectrum itself.
The cepstrum is so-called because it turns the spectrum inside-out. The x-axis of the
cepstrum has units of quefrency, and peaks in the cepstrum (which relate to periodicities
29
Dr. M. Venu Gopala Rao, Professor, Dept. of ECE, KL University, A.P., India.
30
Dr. M. Venu Gopala Rao, Professor, Dept. of ECE, KL University, A.P., India.
SP Project-14
The most flexible way to perform spectral analysis is to use a bank of band pass
filters. A filter bank can be designed to provide a spectral analysis with any degree of
frequency resolution (wide or narrow), even with non-linear filter spacing and
bandwidths. A dis-advantage of filter banks is that they almost always take more
calculation and processing time than discrete Fourier analysis using the FFT.
To use a filter bank for analysis we need one band-pass filter per channel to do the
filtering, a means to perform rectification, and a low-pass filter to smooth the energies.
In this example, we build a 19-channel filter bank using bandwidths that are modelled on
human auditory bandwidths. We rectify and smooth the filtered energies and convert to a
decibel scale.
Task2: Spectral analysis using Fourier transform:
The discrete-time discrete-frequency version of the Fourier transform (DFT) converts an
array of N sample amplitudes to an array of N complex harmonic amplitudes. If the
sampling rate is f s , the N input samples are 1/ f s seconds apart, and the output
harmonic frequencies are f s / N Hertz apart. That is the N output amplitudes are
evenly spaced at frequencies between 0 and (N-1) f s / N Hertz.
Perform DFT for the speech signal. Use sizes of 512, 1024, etc., for the fastest
speed. Plot and display the magnitude and phase spectrum.
31
Dr. M. Venu Gopala Rao, Professor, Dept. of ECE, KL University, A.P., India.
Task3: Windowing a signal:
Often it is desired to analyze a long signal in overlapping short sections called
windows.
spectrogram. Unfortunately it cannot simply chop the signal into short pieces because
this will cause sharp discontinuities at the edges of each section. Instead it is preferable
to have smooth joins between sections. Raised cosine windows are a popular shape for
the joins:
Tas4: Spectrograms:
MATLAB has a built-in function specgram() for spectrogram calculation. This function
divides a long signal into windows and performs a Fourier transform on each window,
storing complex amplitudes in a table in which the columns represent time and the rows
represent frequency.
32
Dr. M. Venu Gopala Rao, Professor, Dept. of ECE, KL University, A.P., India.
SP Project-15
33
Dr. M. Venu Gopala Rao, Professor, Dept. of ECE, KL University, A.P., India.
Determine the DFT of signal and plot its spectrum. It can be observed that this spectrum
is periodic and discrete. Determine the distance between the harmonic signals, which is
referred to as fundamental frequencies.
Task4: Fundamental frequency of guitar string.
Load a guitar string that is properly tightened to produce predifened fundamental
frequency before you can play guitar.
Frequences of guitar strings in Hz should be: E=82.4, A=110, D=146.8, G=196,
B=246.92, E=329.6
34
Dr. M. Venu Gopala Rao, Professor, Dept. of ECE, KL University, A.P., India.
SP Project-16
In this project you have to obtain samples of male and female voice signals for all five
different vowel sounds. Many computers have built in microphones to do this and it is up
to you how you will obtain your 10 speech samples. Then, you must compute the
cepstrum of the sound samples and determine any differences you notice between male
and females voice patterns and amongst the different vowels themselves. Last, you
must lifter the signals to remove the transfer function (using an appropriate window
length) and compute the excitation signal by taking the inverse cepstrum to get back to
the time domain.
Task1:
Acquire voice samples. In this part, either record or find at least 10 voice
samples of a male and female individual making the five vowel sounds a, e, i, o,
u. If you are going to record them yourself or using a friend, then exaggerate the
sounds a little and keep your voice extended for a while. It is also okay to work with
other groups and use their voice samples, but please credit them. Make note of the
conditions used to obtain the voice samples (e.g., what computer, what type of speaker
built-in or microphone, using which software program, or where or from whom the files
were obtained). You should have at least 10 files in the end. If you want to be keen and
impressive, you can get more than one male and female voice to obtain a better understanding of differences between both signals in the cepstral domain.
35
Dr. M. Venu Gopala Rao, Professor, Dept. of ECE, KL University, A.P., India.
Task 2: Compute the cepstrum of each voice signal and discuss any difference
qualitatively and quantitatively amongst male and female voices in general and amongst
the different vowel sounds. This is an important component of the project, so please be
creative and as comprehensive as possible. Your report should provide figures with
original time-domain signals as well as cepstrum signals. Female voices should
generally have more peaks than male voices in the cepstrum domain. You should
discuss why you think this would be the case.
Task3: Lifter the cepstrum domain signals. Design a window (length is an important
design parameter and you should discuss how and what you select it can be the same
or different for each speech sample depending on what you would like to experiment
with) to remove the transfer function dependency. Then, compute the time domain signal
of the corresponding windowed result to obtain the deconvolved signal. Plot the
deconvolved result. Is there anything you can say about the signal and its difference
from the original time domain recorded sample? Again, your discussion is an important
part of the report.
36
Dr. M. Venu Gopala Rao, Professor, Dept. of ECE, KL University, A.P., India.
SP Project-17
Fig 1: Equalizer
Task 1: Generate an analog signal having frequency having frequency component of
500 Hz, 700 Hz, 900 Hz, 1000 Hz, 1200 Hz, 1400 Hz, 1500 Hz, 1600 Hz, 1700 Hz, 1800
Hz, 2000 Hz, 2200 Hz, 2500 Hz with unity magnitude. Plot the analog signal and its
spectrum. Observe the frequency components in the spectrum.
Task 2: Design a Band pass filter (FIR and IIR). Construct all equalizer circuit as shown
in fig. 1. Use the gain 5. Plot the unfiltered analog signal, filtered analog signal and their
spectrum. Plot the frequency response of the filter.
Design specification of filter as belowBPF-FIR filter specification:
Sampling rate: 8000 Hz with
Rectangular window
Hamming window
Hanning window
Frequency range to be emphasized : 1500-2000 Hz
37
Dr. M. Venu Gopala Rao, Professor, Dept. of ECE, KL University, A.P., India.
Lower stop band: 0-1000 Hz
Upper stop band: 2500-4000 Hz
Pass band ripple: 0.1 dB
Stop band attenuator- 45 dB
Determine the filter length and lower and upper cut off frequencies.
BPF IIR filters specifications:
(a) Butterworth IIR filter
Sampling rate: 8000 Hz
Frequency to be emphasized: 1500-2000 Hz
Lower stop band: 0-1000 Hz
Upper stop band: 2500-4000 Hz
Pass band ripple: 3dB
Stop band attenuator: 20dB
Determine the filter order and filter transfer function.
(b)
38
Dr. M. Venu Gopala Rao, Professor, Dept. of ECE, KL University, A.P., India.
SP Project-18
A typical two band digital cross over can be designed as shown in Fig.1. There are
two speaker drivers. The woofer responds to low frequencies and the tweeter responds
to high frequencies. The incoming digital audio signal is split into two bands by using a
low pass filter and high pass filer in parallel. We then amplify the separated audio signals
and send them to their respective corresponding speaker driver. Hence the objectives is
to design the low pass filter and high pass filter so that their combined frequency
response is flat, while keeping the transition as sharp as possible to prevent audio signal
distortions in transition frequency range. Although traditional cross over systems are
designed using active circuits or passive circuits, the digital cross over system provides
a cost effective solution with programmable ability, flexibility, and high quality.
39
Dr. M. Venu Gopala Rao, Professor, Dept. of ECE, KL University, A.P., India.
Task1: Design a digital FIR cross over system using the following specifications.
Type of filter:
FIR filter
Windows: (a) Rectangular window (b) Hamming window (c) Hanning window
Sampling rate
: 44,100 Hz
: 1000 Hz
Transition band
: 600 to 1400 Hz
: 0 to 600 Hz.
: 0.02 dB
: 1400 Hz
: 50 dB
From these specifications determine the cut-off frequency and filter length.
(Ans: cut-off frequency = 1000 Hz and filter length=183).
Use Matlab to design and plot frequency responses for both filters.
Task2: Design a IIR digital cross over system using the following specifications.
Type of filter:
IIR Filter
Sampling rate
: 44,100 Hz
: 1000 Hz
: 1000 Hz
: 1000 Hz
40
Dr. M. Venu Gopala Rao, Professor, Dept. of ECE, KL University, A.P., India.
19E SP Project-19
f2
5
128
50
128
x[n] cos 4 f c t
2 2
x[n] x[n]
cos 4 fc t
2
2
Determine xF [n] and its spectrum for N-point DFT as mentioned in Task2.
Task4: Design a LPF to remove the second harmonic carrier frequency component
cos 4 fc t to produce x[n] . Plot x[n] and its spectrum. Compare the original signal and
demodulated signals.
41
Dr. M. Venu Gopala Rao, Professor, Dept. of ECE, KL University, A.P., India.
SP Project-20
800 Hz and 1000 Hz. Add AWGN for the various noise variances (20dB, 30dB and
40dB). Display the signal and its spectrum.
42
Dr. M. Venu Gopala Rao, Professor, Dept. of ECE, KL University, A.P., India.
Step2: Compute the magnitude and phase response of the signal using FFT and plot
them. Find the Power Density Spectrum and plot.
Step3: Estimate the noise power.
Step4: Subtract the noisy estimate (power) from the Power Density Spectrum of signal.
Determine the magnitude spectrum from resultant signal
Step5: Perform the inverse IFFT operation. Find the signal to noise ratio (SNR) and
peak signal to noise ratio (PSNR).
Task2: Denoising for male voice speech signal.
Step1: Load and display a male voice speech signal and its spectrum.
Step2: Add AWGN for the various noise variances (20dB, 30dB and 40dB).
Step3: Divide the given speech signal into 50 ms blocks of speech frames and shift of
10 msec.
Step4: Compute the magnitude and phase response of the segmented speech signal
using FFT and plot them. Find the Power Density Spectrum and plot.
Step5: Estimate the noise power by computing Log Energy and zero crossing to
determine non-speech activity.
Step6: Subtract the noisy estimate (power) from the Power Density Spectrum of
segmented speech signal. Determine the magnitude spectrum from resultant signal
Step7: Perform the inverse IFFT that results the denoised speech signal. Find the signal
to noise ratio (SNR) and peak signal to noise ratio (PSNR).
Step8: Repeat the above steps for various segmented speech signal.
Task3: Filter the noise using Wiener filter.
Task3: Repeat the Task-2 and Task-3 for female voice speech signal.
Task4: Repeat the Task-2 and Task-3 for musical speech signal.
43
Dr. M. Venu Gopala Rao, Professor, Dept. of ECE, KL University, A.P., India.
SP Project-21
44
Dr. M. Venu Gopala Rao, Professor, Dept. of ECE, KL University, A.P., India.
Task1: Pitch determination using auto-correlation:
Step1: Load a speech signal.
Step2: Divide the given speech signal into 50 ms blocks of speech frames and shift of
10 msec.
Step3: Determine the auto correlation sequence of each frame. The pitch period can be
computed by finding the time lag corresponds to the second largest peak from the
central peak of autocorrelation sequence.
Task2: Cepstrum Pitch Determination: The main limitation of pitch estimation by the
auto correlation of speech is that there may be peaks larger than the peak
corresponding to the pitch period T0 due to the frequencies of the vocal tract. As a result
there may be picking of highest peaks and hence wrong estimation of pitch. The
approach to minimize such errors is to separate the vocal tract and excitation source
related information in the speech signal and there use the source information for pitch
estimation. The ceptral analysis of speech provides such an approach.
The ceptrum of speech is defined as the inverse Fourier transform of the log
magnitude spectrum. The cepstrum projects all the slowly varying components in log
magnitude spectrum to the low frequency region and fast varying components to the
high frequency regions. In the log magnitude spectrum, the slowly varying components
represent the envelope corresponds to the vocal tract and the fast varying components
to the excitation source. As a result the vocal tract and excitation source components get
represented naturally in the spectrum of speech.
Block diagram of Cepstrum
Dr. M. Venu Gopala Rao, Professor, Dept. of ECE, KL University, A.P., India.
Task3: Pitch estimation by SIFT method: The SIFT method is yet another mostly
used pitched estimation method. This is based on the linear prediction (LP) analysis of
speech. The SIFT in turn employs the autocorrelation method for the estimation of pitch.
However, the main discussion is, it performs autocorrelation of the LP residual than
speech directly. For the optimal LP ..., more of the vocal tract information is modeled by
the LP coefficients and hence the LP residual mostly contains the excitation source
information. The autocorrelation of LP residual will therefore have unambiguous peaks
representing the pitch period 'T0' information.
Step1: Load a speech signal.
Step2: Divide the given speech signal into 50 ms blocks of speech frames and shift of
10 msec.
Step3: Develop Matlab code to determine the autocorrelation of LP residual. Observe
the unambiguous peaks representing the pitch period T0 .
Task4: Consider a male speaker speech speaker signal having pitch period of about 10
ms. Compute its pitch by SIFT method using a segment size of 30 ms, 15 ms and 5 ms.
Compare the true autocorrelation sequence and justify their nature. As a result explain
how much is the main length of speech segment for the estimation of pitch in term of
pitch period T0 .
Task5: Consider a male speaker speech speaker signal having pitch period of about 10
ms. Compute its pitch by Cepstrum using a segment size of 30 ms, 15 ms and 5 ms.
Compare the true autocorrelation sequence and justify their nature. As a result explain
how much is the main length of speech segment for the estimation of pitch in term of
pitch period T0 .
Task6: Repeat the above tasks for female voice.
46
Dr. M. Venu Gopala Rao, Professor, Dept. of ECE, KL University, A.P., India.
SP Project-22
speech.
(c) Classification of the voiced/unvoiced/silence features of speech signals in both
Basic Theory: Speech is an acoustic signal produced from a speech production system.
From our understanding of signals and systems, the system characteristics depend on
the design of the system. For the case of linear time invariant system, this is completely
characterized in terms its impulse response. However, the nature of response depends
on the type of input excitation to the system. For instance, we have impulse response,
step response, sinusoidal response and so on for a given system. Each of these output
responses are used to understand the behavior of the system under different conditions.
A similar phenomenon happens in the production of speech also. Based on the input
excitation phenomenon, the speech production can be broadly categorized into three
activities. The first case where the input excitation is nearly periodic in nature, the
second case where the input excitation is random noise-like in nature and third case
where there is no excitation to the system. Accordingly, the speech signal can be
broadly categorized into three regions. The study of these regions is the aim of this
experiment.
1. Voiced Speech: If the input excitation to is a system is nearly periodic impulse
sequence, then the corresponding speech looks visually nearly periodic and is termed as
voiced speech.
The periodicity associated with the voiced speech can be measured by the
autocorrelation analysis. This period is more commonly termed as pitch period.
47
Dr. M. Venu Gopala Rao, Professor, Dept. of ECE, KL University, A.P., India.
2. Unvoiced Speech: If the excitation is random noise-like, then the resulting speech
will also be random noise-like without any periodic nature and is termed as Unvoiced
Speech. The typical nature of excitation and resulting unvoiced speech are shown in Fig
2 itself. As it can be seen, the unvoiced speech will not have any periodic nature. This
will be the main distinction between voiced and unvoiced speech. The aperiodicity of
unvoiced speech can also be observed by the autocorrelation analysis.
3. Silence Region: The speech production process involves generating voiced and
unvoiced speech in succession, separated by what is called silence region. During
silence region, there is no excitation supplied to the vocal tract and hence no speech
output. However, silence is an integral part of speech signal. Without the presence of
silence region between voiced and unvoiced speech, the speech will not intelligible.
Further, the duration of silence along with other voiced or unvoiced speech is also an
indicator of certain category of sounds. Even though from amplitude/energy point of
view, silence region is unimportant, but its duration is very essential for intelligible
speech.
4. Voiced/Unvoiced/Silence Classification of Speech
Above discussion gave a feel about the production of voiced/unvoiced speech and also
significance of silence region. Now the next question is how to identify these regions of
speech? First by visual perception and next by automatic approach. If the speech signal
waveform looks periodic in nature, then it may be marked as voiced speech, otherwise, it
may be marked as unvoiced/silence region based on the associated energy. If the signal
amplitude is low or negligible, then it can be marked as silence, otherwise as unvoiced
region. Finally, there may be regions where the speech can be mixed version of voiced
and unvoiced speech. In mixed speech, the speech signal will look like unvoiced speech,
but you will also observe some periodic structure.
Task1: Time domain analysis.
Step1: Load a speech signal.
48
Dr. M. Venu Gopala Rao, Professor, Dept. of ECE, KL University, A.P., India.
Step2: Divide the given speech signal into 50 ms blocks of speech frames.
Step3: Plot the segmented speech signal. Observe the time domain characteristics for
the three cases (Voice, un-voice and silence).
Explain how these voice, un-voice and silence signals are identified in time domain
plots?
Voiced segment represents periodicity in time domain.
Unvoiced segment is random noise-like in time domain
Silence region does not have energy in time domain.
Explain how these voice, un-voice and silence signals are identified in terms of enery
and zero crossing?
Repeat the above steps for several speech segments and comment for these three
features.
Task2: Frequency domain analysis.
Step1: Load a speech signal.
Step2: Divide the given speech signal into 50 ms blocks of speech frames.
Step3: Plot the spectrum of segmented speech signal. Observe the frequency domain
characteristics for the three cases (Voice, un-voice and silence). Explain how these
voice, un-voice and silence signals are identified in the spectrum of speech signals?
Voiced segment represents harmonic structure in frequency domain.
Unvoiced segment is non harmonic structure in frequency domain.
Silence region does not have energy in frequency domain.
Repeat the above steps for several speech segments and comment for these three
features.
Task4: Do the following
(a) Write a Matlab program that reads a speech file and plots the waveform,
spectrum and autocorrelation sequence of any three voiced segments present in
the given speech signal.
(b) Write a Matlab program that reads a speech file and plots the waveform,
spectrum and autocorrelation sequence of any three unvoiced segments present
in the given speech signal.
(c) Write a Matlab program that reads a speech file and plots the waveform,
spectrum and autocorrelation sequence of any three silence region present in the
given speech signal.
Task5: Repeat the above steps for both male female and musical speech signals.
49
Dr. M. Venu Gopala Rao, Professor, Dept. of ECE, KL University, A.P., India.
SP Project-23
L 2 852 / f s
H L ( z)
z sin L
z 2 z cos L 1
2
( n)
DTMF Tone
z sin H
H H ( z) 2
z 2 z cos H 1
y7 ( n )
7
H 2 1209 / f s
Fig1. Digital DTMF tone generator for the digit 7.
50
Dr. M. Venu Gopala Rao, Professor, Dept. of ECE, KL University, A.P., India.
The industry standard frequency specifications for all the keys are listed in Fig 2.
1209 Hz 1336 Hz 1477 Hz
697 Hz
770 Hz
852 Hz
941 Hz
2
205
X (k )
51
Dr. M. Venu Gopala Rao, Professor, Dept. of ECE, KL University, A.P., India.
H18 ( z )
H20 ( z )
x ( n ) y7 ( n )
DTMF Tone
H22 ( z )
H24 ( z )
H31 ( z )
H34 ( z )
H38 ( z )
v18 (n)
v20 (n)
v22 (n)
v24 (n)
v31 (n)
v34 (n)
v38 (n)
A18
logic
A20
logic
A22
logic
A24
logic
A31
logic
A34
logic
A38
logic
0
0
1
0
logic
1
0
0
Threshold
( A18 A20 A22 A24 A31 A34 A38 ) / 4
Fig 3 DTMF tone detector.
Develop MATLAB program to perform detection and display each detected key on the
screen.
52
Dr. M. Venu Gopala Rao, Professor, Dept. of ECE, KL University, A.P., India.
SP Project-24
53
Dr. M. Venu Gopala Rao, Professor, Dept. of ECE, KL University, A.P., India.
Task3: Modify the short term zero crossing (ZCR) program by not including the factor
"N"(frame length) in the relation. Compute the ST ZCR for window size of 30, 50 & 100
msec. compare the same with the earlier case given in the procedure section. Do you
find any difference? comment.
Task4: Develop the pitch estimation program in Matlab using frame sizes of 10, 50 &
100 msec, each with a shift of 10 msec. Compare the nature of plots in three different
cases & comment.
54
Dr. M. Venu Gopala Rao, Professor, Dept. of ECE, KL University, A.P., India.
SP Project-25
Back Ground: In a certain hall, echoes of the original audio signal x[n] are generated
due to the reflections at the walls and ceiling. The audio signal experienced by the
listener y[n] is a combination of x[n] and its echoes. . It is desired to estimate the delay
using cross-correlation analysis.
Task1: Let an audio signal is represented by a discrete-time sequence