Professional Documents
Culture Documents
INTRODUCTION
1.2. METHODOLOGY:
Chapter 2 will give the information about parameters, producing audio signals.
Chapter 3 will give the information about classification of audio signals and brief
introduction to various effects.
Chapter 4 will give the information about brief explanation of time delay and
frequency effects which are having applications in currently developing audio
fields.
Chapter 5 will help in conversion of audio signals, representations of audio signal
effects in digital form.
Chapter 6 will give explanation about MATLAB software.
Chapter 7 contains flowcharts which will help to write MATLAB code.
Chapter 8 results of Realization of various effects of audio signals
2. INTRODUCTION TO AUDIO SIGNALS
2.1. SOUND:
2.3.1. Receiving:
A micro phone placed in sound field moves according to pressures exerted
on it. Transducer transforms energy to a different form (e.g., electrical
energy).
2.3.2. Sending:
A speaker transforms electrical energy to sound waves.
2.4. TYPES OF AUDIO SIGNALS:
2.4.1. Music:
2.4.2. Speech:
3.5.2. Panning :
Panning can add to the stereo effect, but it does not help with
stereo separation. Stereo separation can be achieved by time delaying one channel
relative to the other.
3.5.3. Compression :
3.5.4. Expansion:
Noise gates usually have controls for hold time, attack time, and
release time. The hold time is the time for which a signal should remain below the
threshold, before it is gated. The attack time is the time during which a signal
(that is greater than the threshold) is faded in from the gated state. The release
time is the time during which a signal (that is below the threshold) is faded into
the gated state. These controls help to eliminate the problems of distortion caused
by gating signals that are part of the foreground audio signal, and the problem of
sustained notes being suddenly killed by the noise gate.
These effects are based on the addition of time-delayed samples to the current
output...
3.6.1. Echo :
3.6.2. Reverberation :
3.6.4. Flanging :
3.6.5. Phasing :
Other strange effects can be achieved with variations of echo and chorus.
3.7. WAVE FORM SHAPING EFFECTS :
These effects distort the original signal by some form of transfer function (non-
linear).
3.7.4. Distortion :
These are effects based on filtering the input signal or modulation of its
frequency.
3.8.2. Vibrato :
3.8.3. Equalization :
3.8.4. Wah-wah :
This effect is often used by guitarists, and can be used to make the guitar "talk".
3.8.5 Vocoding :
• But importance is given to audio effects which have real time applications
such as time delay & Frequency effects.
• Those are
Echo & Multiple echoes.
Reverberation.
Flanging.
Pitch shifting.
Equalization.
Fading.
• These are having more applications in currently developing audio fields
4. TIME AND FREQUENCY DELAY EFFECTS
4.1. DELAY:
4.1.1. Introduction:
The delay is one of the simplest effects out there, but it is very
valuable when used properly. A little delay can bring life to dull mixes, widen
your instrument's sound, and even allow you to solo over yourself. The delay is
the also a building block for a number of other effects, such as reverb, chorus, and
flanging.
Simply put, a delay takes an audio signal, and plays it back after
the delay time. The delay time can range from several milliseconds to several
seconds. Figure 4.1 presents the basic delay in a flow-graph form. This only
produces a single copy of the input, and thus is often referred to as an echo
device.
Delays are very useful for filling out an instrument's sound. Playing through a
delay unit with a short echo, say 50 to 100 milliseconds creates a doubling effect,
as though two instruments were being played in unison. Using several delays
together with feedback can be used to create a reverb-like sound, though a typical
reverb unit will create a more complex sound pattern.
4.2. REVERBERATION:
4.2.1. Introduction:
It's very tempting to say that reverb a series of echoes, but this
isn't quite correct. 'Echo' generally implies a distinct, delayed version of a sound,
as you would hear with a delay more than one or two-tenths of a second. With
reverb, each delayed sound wave arrives in such a short period of time that we do
not perceive each reflection as a copy of the original sound. Even though we can't
discern every reflection, we still hear the effect that the entire series of reflections
has.
So far, it sounds like a simple delay device with feedback might produce
reverberation. Although a delay can add a similar effect, there is one very
important feature that a simple delay unit will not produce - the rate of arriving
reflections changes over time, whereas the delay can only simulate reflections
with a fixed time interval between them. In reverb, for a short period after the
direct sound, there is generally a set of well defined and directional reflections
that are directly related to the shape and size of the room, as well as the position
of the source and listener in the room. These are the early reflections (also called
the 'early echoes' despite the general meaning of the word 'echo'). After the early
reflections, the rate of the arriving reflections increases greatly. These reflections
are more random and difficult to relate to the physical characteristics of the room.
This is called the diffuse reverberation, or the late reflections. It is believed that
the diffuse reverberation is the primary factor establishing a room's 'size', and it
decays exponentially in good concert halls. A simple delay with feedback will
only simulate reflections with a fixed time interval between reflections.
Predelay
Reverb Decay
The reverb decay indicates how you how long the reverb can be
heard after the input stop. The actual measure of what can be 'heard' can vary
among manufacturers. The reverb decay is typically in terms of milliseconds,
which can be thought of as something like the reverb time.
Gate Time
Some units with gated reverbs will also provide this parameter,
which controls how the gate is actually applied or 'closed'. A very short gate time
means that the reverb is cutoff rapidly, such as shown in Figure 4.7. Longer decay
times means that the reverb is given some time to fade away gradually.
Gate Threshold
4.3. FLANGING:
4.3.1. Introduction:
Figure 4.8: Diagram of a simple flanger. The delay changes with time
Depth (Mix)
Delay
Sweep Depth
Note that when you vary the delay parameter, both the upper and
lower limits of the first notch are changed, but when you adjust the depth,
only the lower limit is affected. So when you are setting up a flanger to
sweep over a particular range, first set the delay so that the high point of the
sweep is where you want it, and then adjust the sweep depth to set the low
point of the sweep. (When I refer to the sweep here, I'm talking about the
notches, not the delay time. Remember that the parameters you set are
controlling the delay, and that the notches result from this delay. As the
delay increases, the notch frequencies decrease.)
Figure 4.10: The relationship between the sweep depth and delay parameters.
LFO Waveform
Some flangers will allow you to choose the LFO waveform. This
waveform determines how the delay in the flanger varies in time. Figure 4.11
show some common LFO's. The triangle is probably the more common choice in
flangers.
Feedback/Regeneration
Some units will give you an option for taking a portion of the
flanger's output and routing it to the input. In some cases, you can also specify
whether to add or subtract the feedback signal. A large amount of feedback can
create a very 'metallic' and 'intense' sound. A diagram for the flanger with
feedback is shown in Figure 5. Of course as the feedback gain approaches one,
the system can be come unstable, possibly resulting in overflow or clipping.
Figure 4.12: The more complex flanger including a feedback path and LFO
control over the delay.
Speed/Rate
But the pitch shifter varies the rate (At which information passes
through the memory) to a frequency that is either higher or lower than the
sampling rate. If the frequency is higher than the sampling rate the pitch of the
analog signal will increase and vice versa). This is possible because the frequency
of the output waveform is controlled by the rate at which it enters the D-A
converter. This technique however creates either a build up of data or gaps in the
digital information, due to the changed clock frequency. These gaps or overlaps of
data are then interpreted as distortion, thus making the overall tonal quality low.
The pitch time changer lets you very the playback speed
(duration) and the pitch of the input signal independently.
Speed
Pitch changer
This effect is called” Pitch Shift”. The pitch changer varies the
pitch of the input signal. The algorithm works by loading memory with an
incoming signal sampled at rate A and reading out the samples at rate B. The ratio
A/B determines the pitch change. To maintain a continuous output signal, samples
must be repeated for upward pitch shifts or skipped for downward pitch shifts.
Because the output address pointer repeatedly overtakes the input address pointer
for pitch increases or is overtaken by the recirculating input address pointer for
pitch decreases, the output address must occasionally jump to a new point in the
memory.
If the signal we want to pitch shift is speech then we can split the
signal into small blocks and then add or remove blocks to make the speech lost
longer/shorter (more/less samples). Then to speed up, play at a faster rate (or
convert the sample rates [2-3]). The sections must be split at zero crossings or
cross-faded so that clicks are not produced between blocks. Detecting the pitch
sections (pitch pulses) requires knowledge of how speed is produced and is the
main obstacle in using this method. Auto-correlation is probably the most popular
way of detecting these sections although it requires lots of computing power.
For any other type of signal a version of the chorus can be used.
The chorus effect [3-4] changes the pitch of a signal by changing the sampling
frequency, causing the time to “wobble” around its normal value. If a saw tooth
wave is used to modulate the sampling frequency then the signal is pitch shifted
up (or down). When the edge of the saw tooth occurs there will be a click on the
output. To get around this, some form of filter could be used. If there modulation
signals are out of step with each other then we can switch the output between the
two flangers so that we avoid the click. In order to prevent the clicks when the
change of output source is made some form of filtering may be needed.
The final method of pitch shifting is the most complex but gives
the best quality results. We can transform the input signal into the frequency
domain (using the Fourier transform) and stretch the frequency information, so
that the frequencies of the signals are changed. Reverse transforming this new
frequency domain representation will give a pitch shifted signal.
4.5. EQUALIZATION:
4.5.1. Introduction:
By using the Low-Pass, High Pass and Band-Pass Filters, an
audio equalizer can be built. This allows the user to magnify or dampen any
frequencies that they choose. Many equalizers on the market allow users to
change up to 20 different frequency bands. For simplification we designed an
equalizer with three bands: the lower band, a middle band, and the upper band.
This was done with the
Mat lab code that follows and the output is also shown below.
The user can go through and change the gains to see the different effects that
occur to the signal.
In most applications, low pass and high pass filters arty to totally
remove a portion of the spectrum. For example, a low pass filter tries to eliminate
all the high frequencies. But with the shelving filters, we are not always trying to
remove any thing we are just boosting or cutting one portion while leaving the
rest unaffected.
This type of filter generally does not have a defined cut off
frequency, but this instead defined by two other characteristics. The frequency at
which the peaking filter is at its maximum (or when cutting the signal, the
minimum) gain is called the center frequency. The other important characteristic
is the bandwidth, which basically means how wide the peaking filter is (how wide
of a frequency rage it offers). Generally we are only able to adjust the boost or
cut, and the center frequency and bandwidth are fixed.
4.6. FADING:
4.6.1. Introduction:
Digital:
Operating by the use of discrete signals to represent data in the form of numbers
Signal:
A variable parameter by which information is conveyed through an electronic
circuit
Processing:
To perform operations on data according to programmed instructions
Which leads us to a simple definition of?
Repeatability:
Digital systems can be easily duplicated.
Digital systems do not depend on strict component tolerances.
Digital system responses do not drift with temperature.
Simplicity:
Some things can be done more easily digitally than with analogue systems
DSP is used in a very wide variety of applications.
But most share some common features:
5.2. ANTIALIASING:
Only after it has been held can the signal be measured, and the measurement
converted to a digital value
The sampling results in a discrete set of digital numbers that
represent measurements of the signal - usually taken at equal intervals of time.
Note that the sampling takes place after the hold. This means that we can
sometimes use a slower Analogue to Digital Converter (ADC) than might seem
required at first sight. The hold circuit must act fast - fast enough that the signal is
not changing during the time the circuit is acquiring the signal value - but the
ADC has all the time that the signal is held to make its conversion.
5.5. QUANTIZATION:
Sadly, the errors introduced by digitization are both non linear and signal
dependent.
Non linear means we cannot calculate their effects using normal math’s.
Signal dependent means the errors are coherent and so cannot be reduced by
simple means.
This is a common problem in DSP. The errors due to limited
precision (i.e. word length) are non linear (hence incalculable) and signal
dependent (hence coherent). Both are bad news, and mean that we cannot really
calculate how a DSP algorithm will perform in limited precision - the only
reliable way is to implement it, and test it against signals of the type expected.
The non linearity can also lead to instability - particularly with IIR filters.
The word length of hardware used for DSP processing determines the available
precision and dynamic range.
Uncertainty in the clock timing leads to errors in the sampled signal.
The diagram shows an analogue signal which is held on the rising edge of a clock
signal. If the clock edge occurs at a different time than expected, the signal will be
held at the wrong value. Sadly, the errors introduced by timing error are both non
linear and signal dependent.
A real DSP system suffers from three sources of error due to limited word length
in the measurement and processing of the signal:
Limited precision due to word length when the analogue signal is converted to
digital form.
Errors in arithmetic due to limited precision within the processor itself
Limited precision due to word length when the digital samples are converted
back to analogue form.
These errors are often called 'quantization error'. The effects of
quantization error are in fact both non linear and signal dependent. Non linear
means we cannot calculate their effects using normal moths. Signal dependent
means that even if we could calculate their effect, we would have to do so
separately for every type of signal we expect. A simple way to get an idea of the
effects of limited word length is to model each of the sources of quantization error
as if it were a source of random noise.
5.6. FILTERING:
Two convolutions are involved: one with the previous inputs, and
one with the previous outputs. In each case the convolving function is called the
filter coefficients.
The filter can be drawn as a block diagram:
Two convolutions are involved: one with the previous inputs, and
one with the previous outputs. In each case the convolving function is called the
filter coefficients.
The filter can be drawn as a block diagram:
The filter diagram can show what hardware elements will be required when
implementing the filter:
The left hand side of the diagram shows the direct path, involving previous
inputs: the right hand side shows the feedback path, operating upon previous
outputs.
5.7.1. Echo:
5.7.3. Reverberation:
α= Reverberation coefficient.
5.7. 4. Flanging:
6. INTRODUCTION TO MATLAB
Online help is available from the Matlab prompt (>> a double arrow),both
generally (listing of all available commands):
>> help
[A long list of help topics follows]
A= [ 1 2 3 4
5 6 7 8];
Kinds of plots:
plot(x,y) creates a Cartesian plot of the vectors x & y
plot(y) creates a plot of y vs. the numerical values of the elements in the y-
vector
semilogx(x,y) plots log(x) vs y
semilogy(x,y) plots x vs log(y)
loglog(x,y) plots log(x) vs log(y)
polar(theta,r) creates a polar plot of the vectors r & theta where theta is in radians
bar(x) creates a bar graph of the vector x. (Note also the command
stairs(x))
bar(x,y) creates a bar-graph of the elements of the vector y, locating the bars
according to the vector elements of 'x'
Plot description:
grid creates a grid on the graphics plot
title('text') places a title at top of graphics plot
xlabel('text') writes 'text' beneath the x-axis of a plot
ylabel('text') writes 'text' beside the y-axis of a plot
text(x,y,'text') writes 'text' at the location (x,y)
text(x,y,'text','sc') writes 'text' at point x,y assuming lower left corner is (0,0)
and upper right corner is (1,1)
axis([xmin xmax ymin ymax]) sets scaling for the x- and y-axes on the current
plot
Scalar Calculations:
+ Addition
- Subtraction
* Multiplication
/ Right division (a/b means a ÷ b)
\ left division (a\b means b ÷ a)
^ Exponentiation
For example 3*4 executed in 'matlab' gives ans=12
4/5 gives ans=0.8
• Advantages:
Handles vector and matrices very nice
Quick plotting and analysis
EXTENSIVE documentation (type ‘help’)
Lots of nice functions: FFT, fuzzy logic, neural nets, numerical integration,
OpenGL
• Drawbacks:
Slow compared to C or Java
7. FLOW CHARTS
8.1. ECHO:
Echo device:
Waveforms:
8.2. MULTIPLE ECHOES:
Waveforms:
8.3. REVERBERATION:
Reverberation device:
Waveforms:
8.4. FLANGING:
Flanging device:
Waveforms:
8.5. PITCH SHIFT UP:
Waveforms:
8.6. PITCH SHIFT DOWN:
Waveforms:
8.7. EQUALIZER:
Equalizer:
ORIGINAL SIGNAL
LOWPASS FILTERED OUTPUT
RECONSTRUCTED SIGNAL
8.8. FADING-IN:
Waveforms:
8.9. FADING-OUT:
Waveforms:
APPLICATIONS OF AUDIO EFFECTS