Audio Signal Processing Using MATLAB
Audio Signal Processing Using MATLAB
Project Report
STUDY OF COMMUNICATION SYSTEM
OF ONGC
Submitted by
RAJATSUBHRA KAR
WINTER TRAINEE
Under the guidance of:
Mr. Sukesh Debbarma
RAJATSUBHRA KAR
WINTER TRAINING
Acknowledgement
I would like to express my deep sense of gratitude and sincere thanks to
my project guide Mr. AnirbanBhattacherjee for his continuous support and
encouragement throughout this period. His meticulous approach in
dealing with complex problem and critical comments at each stage helped
me to make this project a real success. Especially sirs guidance at each
step made me feel as if this period was just a cake walk. He was really
involved with this project and gave his input at all relevant situations. He
allowed me to innovative with my ideas as he never tried to impose his
ideas on me forcibly. I would also like to convey my heartfelt thanks for
offering me this opportunity to undertake this project. Without him it
would not have been possible for me to undertake this project. I would like
to bestow a sincere round of gratitude to him. The hearty support of the
institute: National institute of Technology, Agartala is highly solicited.
The blessings of my loving parents remained with me throughout this
period. Their continuous encouragement made me feel comfortable every
time I ran into a bit of disarray. I shall carry the affection and blessings of
Mr. AnirbanBhattacharjee throughout my life. He has really been an
epitome of hard work, dedication and motivation. His involvement has
really shown me the way to succeed.The list is really unending and there
are many others who helped me through each and every walk of this
project and enabled me to complete it in a soothing and comforting way.
This period has really been quite entertaining and enjoyable. Last but not
least I would like to thank the Almighty for always showering his blessings
on me which enabled me to complete this project.
RAJATSUBHRA KAR
WINTER TRAINING
ABSTRACT
RAJATSUBHRA KAR
WINTER TRAINING
CONTENTS
Goal
Objective
Signals
o Introduction
o Audio Signals
o Signal Processing
o Noise
o Additive White Gaussian Noise
o Digital Filtering
o Butterworth Filter
o Wiener Filter
o Audio Signal noise removal using Wiener Filter
o Simulation Result
Conclusion and Future Works
Reference
RAJATSUBHRA KAR
WINTER TRAINING
Goal
The goal of this thesis is to study the nature of audio signals. Analyzing the audio signal in
frequency domain. Study its distinct characteristics and study its behavior under the
application of different digital filters.
Objective
Here our objective is to add an Additive White Gaussian Noise to an audio signal and then
reconstruct the signal using Wiener Filter.
Signals
A signal as referred to in communication systems, signal processing, and electrical
engineering "is a function that conveys information about the behavior or attributes
of some phenomenon". In the physical world, any quantity exhibiting variation in
time or variation in space (such as an image) is potentially a signal that might
provide information on the status of a physical system, or convey a message
between observers, among other possibilities. The IEEE Transactions on Signal
Processing states that the term "signal" includes audio, video, speech, image,
communication, geophysical, sonar, radar, medical and musical signals.
Other examples of signals are the output of a thermocouple, which conveys
temperature information, and the output of a pH meter which conveys acidity
information. Typically, signals are often provided by a sensor, and often the
original form of a signal is converted to another form of energy using a transducer.
For example, a microphone converts an acoustic signal to a voltage waveform, and
a speaker does the reverse.
WINTER TRAINING
Time discretization
One of the fundamental distinctions between different types of signals is
between continuous and discrete time. In the mathematical abstraction, the domain
of a continuous-time (CT) signal is the set of real numbers (or some interval
thereof), whereas the domain of a discrete-time (DT) signal is the set
of integers (or some interval). What these integers represent depends on the nature
of the signal; most often it is time.
WINTER TRAINING
Amplitude quantization
If a signal is to be represented as a sequence of numbers, it is impossible to
maintain arbitrarily high precision - each number in the sequence must have a
finite number of digits. As a result, the values of such a signal are restricted to
belong to a finite set; in other words, it is quantized. Quantization is the process of
converting a continuous analog audio signal to a digital signal with discrete
numerical values.
Examples of signals
Signals in nature can be converted to electronic signals by various sensors. Some
examples are:
WINTER TRAINING
WINTER TRAINING
Audio Signals
An audio signal is a representation of sound, typically as an electrical voltage.
Audio signals have frequencies in the audio frequency range of roughly 20 to
20,000 Hz (the limits of human hearing). Audio signals may
be synthesized directly, or may originate at a transducer such as
a microphone, musical instrument pickup, phonograph cartridge, or tape
head. Loudspeakers or headphones convert an electrical audio signal into sound.
Digital representations of audio signals exist in a variety of formats.
An audio channel or audio track is an audio signal communications channel in
a storage device, used in operations such as multi-track recording and sound
reinforcement.
Digital equivalent
As much of the older analog audio equipment has been emulated in digital form,
usually through the development of audio plug-ins for digital audio
workstation (DAW) software, the path of digital information through the DAW (i.e.
from an audio track through a plug-in and out a hardware output) is also called
an audio signal or signal flow.
A digital audio signal being sent through wire can use several formats
including optical (ADAT, TDIF), coaxial (S/PDIF), XLR (AES/EBU),
and Ethernet.
WINTER TRAINING
WINTER TRAINING
WINTER TRAINING
WINTER TRAINING
Noise
In electronics, noise is a random fluctuation in an electrical signal, a characteristic
of all electronic circuits.Noise generated by electronic devices varies greatly, as it
can be produced by several different effects. Thermal noise is unavoidable at nonzero temperature (see fluctuation-dissipation theorem), while other types depend
mostly on device type (such as shot noise, which needs steep potential barrier) or
manufacturing quality and semiconductor defects, such as conductance
fluctuations, including 1/f noise.
In communication systems, noise is an error or undesired random disturbance of a
useful information signal in a communication channel. The noise is a summation of
unwanted or disturbing energy from natural and sometimes man-made sources.
Noise is, however, typically distinguished from interference, (e.g. cross-talk,
deliberate jamming or other unwanted electromagnetic interference from specific
transmitters), for example in the signal-to-noise ratio (SNR), signal-to-interference
ratio (SIR) and signal-to-noise plus interference ratio (SNIR) measures. Noise is
also typically distinguished from distortion, which is an unwanted systematic
alteration of the signal waveform by the communication equipment, for example in
the signal-to-noise and distortion ratio (SINAD). In a carrier-modulated passband
analog communication system, a certain carrier-to-noise ratio (CNR) at the radio
receiver input would result in a certain signal-to-noise ratio in the detected
message signal. In a digital communications system, a certain Eb/N0 (normalized
signal-to-noise ratio) would result in a certain bit error rate (BER).
While noise is generally unwanted, it can serve a useful purpose in some
applications, such as random number generation or dithering.
WINTER TRAINING
ADDITIVE WHITE
GAUSSIAN NOISE
Additive white Gaussian noise (AWGN) is a basic noise model used
in Information theory to mimic the effect of many random processes that occur in
nature. The modifiers denote specific characteristics:
Additive because it is added to any noise that might be
intrinsic to the information system.
White refers to the idea that it has uniform power across
the frequency band for the information system. It is an
analogy to the color white which has uniform emissions at all
frequencies in the visible spectrum.
Gaussian because it has a normal distribution in the time
domain with an average time domain value of zero.
Wideband noise comes from many natural sources, such as the thermal vibrations
of atoms in conductors (referred to as thermal noise or Johnson-Nyquist
noise), shot noise, black body radiation from the earth and other warm objects, and
from celestial sources such as the Sun. The central limit theorem of probability
theory indicates that the summation of many random processes will tend to have
distribution called Gaussian or Normal.
AWGN is often used as a channel model in which the only impairment to
communication is a linear addition of wideband or white noise with a
constant spectral density (expressed as watts per hertz of bandwidth) and
a Gaussian distribution of amplitude. The model does not account
for fading, frequency selectivity, interference, nonlinearity or dispersion. However,
it produces simple and tractable mathematical models which are useful for gaining
insight into the underlying behavior of a system before these other phenomena are
considered.
10
WINTER TRAINING
The AWGN channel is a good model for many satellite and deep space
communication links. It is not a good model for most terrestrial links because of
multipath, terrain blocking, interference, etc. However, for terrestrial path
modeling, AWGN is commonly used to simulate background noise of the channel
under study, in addition to multipath, terrain blocking, interference, ground clutter
and self-interference that modern radio systems encounter in terrestrial operation.
Digital Filtering
11
WINTER TRAINING
WINTER TRAINING
Butterworth Filter
WINTER TRAINING
British engineer and physicist Stephen Butterworth in his paper entitled "On the
Theory of Filter Amplifiers"
Fs=16384;
Order=2;
Sampling_freq=16384;
[B,A]=butter(Order,[0.7,0.9]);
freqz(B,A,5000,Sampling_freq);
[Flute,Fs]=wavread('FluteMixRingtone.wav');
P=filter(B,A,Flute);
soundsc(P,Fs)
Q=fft(P,4096);
Pyy=Q.*conj(Q)/4096;
f_val=3e4/4096*(0:2048);
plot(f_val,Pyy(1:2049))
14
WINTER TRAINING
15
WINTER TRAINING
16
WINTER TRAINING
NOISE REMOVAL
Noise reduction is the process of removing noise from a signal.
All recording devices, both analog or digital, have traits which make them
susceptible to noise. Noise can be random or white noise with no coherence, or
coherent noise introduced by the device's mechanism or processing algorithms.
In electronic recording devices, a major form of noise is hiss caused by
random electrons that, heavily influenced by heat, stray from their designated path.
These stray electrons influence the voltage of the output signal and thus create
detectable noise.
17
WINTER TRAINING
In the case of photographic film and magnetic tape, noise (both visible and
audible) is introduced due to the grain structure of the medium. In photographic
film, the size of the grains in the film determines the film's sensitivity, more
sensitive film having larger sized grains. In magnetic tape, the larger the grains of
the magnetic particles (usually ferric oxide or magnetite), the more prone the
medium is to noise.
To compensate for this, larger areas of film or magnetic tape may be used to lower
the noise to an acceptable level.
In selecting a noise reduction algorithm, one must weigh several factors:
the available computer power and time available: a digital camera must
apply noise reduction in a fraction of a second using a tiny onboard CPU,
while a desktop computer has much more power and time
whether sacrificing some real detail is acceptable if it allows more noise to
be removed (how aggressively to decide whether variations in the image are
noise or not)
the characteristics of the noise and the detail in the image, to better make
those decisions
Wiener Filter
In signal processing, the Wiener filter is a filter used to produce an estimate of
a desired or target random process by linear time-invariant (LTI) filtering of an
observed noisy process, assuming known stationary signal and noise spectra,
and additive noise. The Wiener filter minimizes the mean square error between
the estimated random process and the desired process.
18
WINTER TRAINING
WINTER TRAINING
where
are respectively power spectra of the
original image and the additive noise, and H(f1,f2) is the
blurring filter. It is easy to see that the Wiener filter has two
separate part, an inverse filtering part and a noise
smoothing part. It not only performs the deconvolution by
inverse filtering (highpass filtering) but also removes the
noise with a compression operation (lowpass filtering).
Implementation
20
WINTER TRAINING
WINTER TRAINING
iHf =
iHf.*(abs(Hf)*gamma>1)+gamma*abs(sHf).*iHf.*(abs(sHf)*gamma<=1
);
Pyf = Pyf.*(Pyf>sigma^2)+sigma^2*(Pyf<=sigma^2);
Gf = iHf.*(Pyf-sigma^2)./(Pyf-(1-alpha)*sigma^2);
eXf = Gf.*Yf;
ex = real(ifft2(eXf));
return
WINTER TRAINING
soundsc(ewx,Fs)
T=fft(P,4096);
Pyy=abs(T).^2;
dBs=10*log10(Pyy);
Ma=max(dBs)
%Measuring maxima of Noisy Signal
D=fft(ewx,4096);
Pyz=abs(D).^2;
dBS=10*log10(Pyz);
Maa=max(dBS) %Measuring maxima of reconstructed signal
figure(2),plot(ewx,'r'),
xlabel('frequency')
ylabel('amplitude')
legend('Reconstructed Signal');
Simulation Results:
23
WINTER TRAINING
Reconstructed Signal:
24
WINTER TRAINING
References:
25
WINTER TRAINING
1. Li, Tan; Jean, Jiang; Improving digital signal processing course with realtime processing experiences for
electrical and computer engineering technology students, 2010 ASEE Annual
Conference and Exposition;
2010.
2. Barkana, Buket; A graduate level course: Audio Processing Laboratory,
2010 ASEE Annual Conference
and Exposition; 2010.
3. Adams, J.; Mossayebi, F.; Hands on experiments to instill a desire to learn
and appreciate digital signal
processing, 2004 Annual Conference and Exposition, 2004.
4. Ossman, Kathleen; MATLAB/Simulink lab exercises designed for teaching
digital signal processing
applications, 2008 ASEE Annual Conference and Exposition; 2008.
5. Ossman, Kathleen; MATLAB exercises to explain discrete fourier
transforms, 2003 ASEE Annual
Conference and Exposition; 2003.
6. Pierre, John W.; Kubichek, Robert F.; Hamann, Jerry C.; Enhancing the
comprehension of signal
processing principles using audio exercises with MATLAB, 1999 ASEE
Annual Conference and
Exposition; 1999.
7. Atti, Venkatraman; Spanias, Andreas; Panayiotou, Constantinos; Song, Yu;
Teaching digital filter design
techniques used in high-fidelity audio applications, 2004 ASEE Annual
Conference and Exposition; 2004.
8. Piano Key Frequencies, Wikipedia,
http://en.wikipedia.org/wiki/Piano_key_frequencies
9. Musical Instrument Samples, Electronic Music Studios, University of Iowa,
http://theremin.music.uiowa.edu/MIS.html
10. www.owling.com
26