Thursday 13 December 2012

Digital Image Processing

WHY USE DIGITAL IMAGE PROCESSING?
  • It provides a flexible environment in which to experiment
  • You can MANIPULATE
            TRANSFORM
            ENHANCE      your images and photographs
CCD
Charge Coupled Device
This is either a linear or matrix array of photosensitive electronic elements that captures the image through either a lens or a detector.


  • Digital cameras capture images through and area array sensor. This is a grid that uses hundreds of thousands of microscopic photocells to create picture elements (pixels) by sensing the light intensity in small portions of the image formed through a lens system.
PIXELIZATION
Pixelization can occur when the sensor array resolution is too low. You can remedy this by increasing the number of cells in the sensor array as this increases the resolution of the captured image. 



DIGITAL CAMERA COLOUR
Digital cameras capture colour images by placing upto 3 filters over the photocells, these colours are:

  1. Red
  2. Green
  3. Blue
Each photocell is assigned three 8bit numbers (up to 256 levels), these correspond to the red, green and blue brightness value.

RED- 227
GREEN- 166
BLUE- 97

DIGITAL CAMERA OPTICS
Before a digital camera focuses the light collected on to the sensor array it has to pass it through and optical low-pass filter, this:
  • Excludes picture data beyond the sensor's resolution
  • Compensates for false colouration caused by drastic changes of colour contrast
  • Reduces infrared and non-visible light
A PIXEL IS THE SMALLEST DIGITAL IMAGE ELEMENT
MANIPULATED BY IMAGE PROCESSING SOFTWARE.


DYNAMIC RANGE: This is the number of colours or shades of grey used in a visual scene. In a digitised image the dynamic range is fixed by the number of bits that the digital system uses to represent each pixel in an image. 




WHAT IS DIGITAL IMAGE PROCESSING?
  • Analysis:
    Operations provide information on photometric features of an image eg. colour count, histogram.
  • Manipulation:Operations change the content of an image eg. flood fill, crop. Input image yields output image.
  • Enhancement:Operations attempt to improve the quality of an image in some sense eg. heighten contrast, edge enhancement. Input image yields output image.
  • Transformation:
    Operations alter the image geometry eg. rotate, skew. Input image yields output image.


Wednesday 12 December 2012

The Little Ducks

For this lab we had to edit together raw camera videos of ducks near a pond and add music to create a minute long piece of work. We got a choice of videos and different music we could add to the piece. I chose to keep mine classical and edited the footage so that scenes faded into each other so that it looked smooth. I also chose to edit the video into a sepia tone as I thought it looked good and fitted in with the theme I had decided to do.

http://www.youtube.com/watch?v=MZUUVyzmS30&feature=youtu.be

Here is the link to the video which I have uploaded to YouTube.



The Human Ear


The human ear's auditory system can detect rapid changes in sound intensity (dB) and frequency (Hz). We hear this as loudness and pitch.
The auditory system converts changes in air pressure to neural activity, sending signals that allow the brain to attach meaning to the sounds that we hear.

There are different parts to the ear; the outer ear, the middle ear and the inner ear. Each are responsible for different, specific functions in hearing. 

OUTER EAR
Soundwaves are first collected here, in the outer ear, by the Pinna(outer ear) which is shaped in order to amplify sound and figure out sound location. This leads into the ear canal which leads to the eardrum.

MIDDLE EAR
The soundwaves vibrate your eardrum, this in turn causes the Malleus, Incus and Stapes (3small bones) to vibrate. The Stapes then vibrates a small membrane at the base of the Cochlea.



INNER EAR
It is here in the inner ear where the complex structures convert sound into neural activity so that your brain can process it. 


If you were to 'unroll' the Cochlear and look inside you would see the Basilar membrane. The Basilar membrane vibrates in response to the sound transmitted to the fluid-filled Cochlea by deflections in the middle ear. 



High Frequency sounds displace the stiff base.
Mid Frequency sounds displace the middle of the Basilar membrane.
Low Frequency sounds displace the Apex.



Digital Signal Processing



A Digital Signal Processor (DSP) needs:
  • Input and Output filtering
  • Analogue to Digital to Analogue conversion
  • A digital processing unit
DSP's are used for PRECISION, ROBUSTNESS and FLEXIBILITY. 

Precision: In theory it is just the precision of DSP systems that is limited by the conversion process at input and output. However in reality it is the sampling rates and word length restrictions that modify this. The increasing operating speed and word length of modern digital logic is allowing many more areas of application.

Robustness: Digital systems are less susceptible to electrical noise pick up and component tolerance variations than analogue systems. Adjustments for electrical drift and component aging are essentially removed which is important complex systems.

Flexibility: It's programmability allows you to upgrade and expand the process operations without incurring large scale hardware changes. You can construct practical systems with time varying and adaptive characteristics. 




In the above diagram the sampling frequency defines the number of samples per unit of time taken from a continuous signal to make a discrete signal.

The inverse of the sampling frequency is the sampling interval, which is the time between samples.

QUANTISATION
The majority of modern soundcards support 16bit word length coding, of the quantised sample values.
This represents 65536 different signal levels within the input voltage range on the soundcard.

EG. If the voltage range of an input connection is +/-5V, the range is 10V. A 16bit system therefore has a quatisation step of (10/65536V) = 0.15mV. 
And this is the smallest voltage difference from this system.

DYNAMIC RANGEThe dynamic range is the ratio of the largest signal amplitude to the smallest.To calculate the dynamic range:
20log([Voltage Range]/{Quantisation step size})dB
=20log(65536)dB
=96dB

In the human ear, we have a dynamic range of >120dB












Wednesday 5 December 2012

Generating Signals with GoldWave


Here is a screenshot of a 400Hz sine wave with 8 cycles.




When we add harmonics, this is the expression that would be used.






A 3rd Harmonic
As you can see when harmonics are added the wavelength starts to change shape.

A 5th Harmonic

A 7th Harmonic

A 9th Harmonic


After adding more harmonics the expression generator now looks likes this: 



The wave is gradually taking on a square shape.






If you look at the wave through the spectrum filter you can view the frequency content of the waveform.
The Magnitude Spectrum.











Thursday 25 October 2012

Getting familiar with waves

https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcSKP6kjfuGDNZGpAhwfstjaabtfMDfAGudfulRKeKNoj_oFK7th

In a recording room, if an acoustic wave was measured to have a frequency of 1KHz we would work out the wavelength taking the velocity, which we know to be 333m/s and divide it by the frequency. First we would need to change the 1KHz to Hz = 1000Hz
So 333/1000= 0.333metres.
If you had a 2KHz wavelength, you use the same method of working out except this time it would be 333/2000= 0.166metres.
If the frequency was only 500Hz, this would produce a wavelength of 0.666metres. 
There are some circumstances where the velocity may not be 333m/s for example underwater and this would change the equation. Other things that could affect this equation could be if you were in an anechoic chamber as they use frequency absorbers.

VELOCITY = THE SPEED OF SOUND
  • Velocity is the distance travelled during a unit of time by a sound wave. It is measured in metres per second (m/s). 
  • Wavelength is the distance between each successive crest of a wave. It is measured in metres (m). 
  • Frequency is the rate at which something occurs or is repeated over a particular period of time in a sample.
  • 20Hz - 20,000Hz is our audible sound range.It is measured in hertz (Hz).
  • Sound travels faster in liquids and non-porous solids than it does in air. In water it travels 4.3x faster.
https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcQshYn1PUng0kyxqlBc_rYPQRKKBbhyjSow5zUY8s6gySFLckngWw

When all the instruments in an orchestra tune for a concert, they tune to something called CONCERT PITCH. Standard concert pitch is A440Hz or the note A above middle C on a piano. 
You can work out the wavelength of the sound coming from the violin by dividing the velocity, which we know as 333m/s, by the frequency, 440Hz. So 333/440= 0.7568m is the wavelength. 

Sound travelling through different environments:
If an acoustic wave with a wavelength of 3.33m travels along a workbench we can work out the frequency of the sound wave by dividing the velocity (333m/s) by the wavelength (3.33m) which equals 100Hz.
It is easy for sound to travel through a solid such as this workbench as the energy from the sound waves is transmitted by the particles in the solid colliding with each other. 
In solid materials the atoms that make up the workbench are packed very close together, therefore they don't move about as much. Due to them being in this fixed position, they can only vibrate in a fixed position, so sound waves travel through the solid object very fast. For example like a domino effect.

  • Sound travels through air at 333m/s
  • Sound travels through water at 1500m/s
  • Sound travels through solid steel at 5000m/s
It travels more slowly through air compared to a solid because the air particles are a lot further spread apart, so when they vibrate, they move freely in all directions and have to move further in order to collide with other particles. So even though sound doesn't move as fast in air, it does travel in all directions as the air surrounds you.

STANDING WAVES: 

  • A standing wave is a wave that remains in a constant position.
  • It occurs because the medium is moving in the opposite direction to the wave.
    OR
    If a stationary medium interferes between two waves of equal amplitude travelling in opposite directions.
  • physics.info/waves-standing/
  • For example, a standing wave can be compared to the string of a guitar, it is joined at both ends but it can still move/vibrate only up and down rather that traveling forwards and backwards as the medium is in a fixed position.
CONSTRUCTIVE AND DESTRUCTIVE INTERFERENCE:
  1. Constructive Interference occurs when two waves combine by the superposition principle.
    eg Amplitude = A
    A1 + A2 = A total

    http://zonalandeducation.com/mstm/physics/waves/interference/constructiveInterference/InterferenceExplanation2.html
  2. Destructive Interference occurs when the crest of one wave interferes with the trough of another. The amplitudes are subtracted.



The amplitude of an acoustic wave determines its loudness.
The amplitude of a wave is its maximum disturbance from its undisturbed position.
(not the difference between the the top and bottom of the wave) 

Decibels
Decibels are used in the measurement of relative loudness in acoustic waves because the loudness of sound is based on intensity level, using a logarithmic scale. It is relative to the weakest sound the human ear can hear (by ratio).

The formula for sound intensity is:
Sound Intensity

http://www.noisehelp.com/decibel-scale.html

When sound travels underwater, it travels faster than it does in air, this again is due to the water molecules being closer together as they are a liquid (rather than a gas like the air) so it is easier for them to collide and vibrate.

It is interesting that if you have ever listened to someone talk whilst you are underwater in a swimming pool, the noise sounds sort of distorted and it is not always clear what the person is saying to you. I came across this article which goes further into why this happens. 

https://ccrma.stanford.edu/~blackrse/h2o.html

Thursday 27 September 2012

Anechoic Chambers

Anechoic Chambers


http://i.dailymail.co.uk/i/pix/2012/04/03/article-2124581-1274105D000005DC-638_634x421.jpg
  • Anechoic chambers are rooms designed to stop the reflection of sound.
  • They are designed using wedge shaped panels made of an absorbent material so that any sound produced in the room will not echo or reverberate. 
  • They are a useful tool for bands and orchestras to record music in as it produces a completely different quality of sound.

Echoes vs. Reverberation

Echoes and Reverberations

  • ECHO
    An echo is the perceived reflection of sound from a surface.
    The fraction of sound level that is reflected is known as the reflections coefficient.
    0 <= 
    α <= 1
  • The time difference between the echo and the direct sound depends on the distances travelled and the speed of sound.
  • The smallest distance for sound to travel to be described as an echo is 33m. However because it is an echo the sound has to travel to eg. a wall and bounce back therefore travelling 17m each way.
  • The difference must be greater than about 100ms to be perceived as an echo.
https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcTkBkcuXN2ORSoMeSxTWqJ9ZMF6HY-QwzYsAmyVTKeZQ8cEFoM6
  • REVERBERATION
    The persistence of a sound after its source has stopped, caused by multiple reflection of the sound within closed space.
  • The reverberant character of a room is due to the accumulated reflections from all the surfaces (walls, floors,ceiling and other objects) adding to the direct sound.
  • Multiple level reflections occur as well as single ones.

https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRylCD0aGiLQQR1aSVaOLuvAp3d4kgJSQOim9mcJDLDiohrtCDEFw

Inverse Square Law

Inverse Square Law

  • The intensity of the sound received varies inversely as the square of the distance R from the source
    ie. as 1/R².
  • In open air, sound will be roughly nine times less intense at a distance of 3m from its origin, as at a distance of 1m.
  • Objects in our surroundings produce reflection (echo), absorption and scattering of the sound waves.
  • The inverse square law is not always applicable in direct measurements of the intensity of sound.
  • However is it a rough indication when you are away from reflecting surfaces eg. open air away from walls. 

https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcROog5MFf-KX19hLXmr1EPogyhiJkWqLNlxW5Ssz-C8sZvJxhb0

Decibels

Decibels
  • The sound intensity of a normal conversation speech is around 10⁵ (ie. 100,000) times that of whispered speech.
  • To easily graph and discuss these huge range of values;
    sound intensity (power) level is defined using a logarithm and is measured in decibels (dB)
    eg. Sound Intensity Level = 10log₁₀(Isound/Istandard) dB 
    which means that a 10 times multiplication in sound intensity corresponds to an additional 10dB of sound level, and an increase from sound intensity P₁ to 2*P₁ (a two times increase in power) corresponds to 10log₁₀(2*P₁/P₁)=3dB
https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcQfcB-T3cuc0TeLbXp0yeHWiXIf8PoCInqdtqwpIDY_nFsLOwZjAg

Harmonics

Harmonics

  • The vibration as a whole produces the fundamental (basic) tone, and the other vibrations produce the various harmonic tones.
  • A harmonic is an integer multiple of the fundamental frequency.
    Eg. 2 x fundamental, 3 x fundamental etc.
  • So a sound consisting of components at frequencies of 1000Hz and 3000Hz would contain a 3rd harmonic of the 1kHz fundamental. 
https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcRR_CcDFmjVxnvXP1hpJco-0H_lyo4g2rOczuXODXzyKa_1uBh4

Wavelength, Amplitude and Velocity

Wavelength

https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcRVPEk7AgNQLzmbhtSBH2Wjghaksitpeof7ktDFVdoCA6aNqllD
  • For a transverse wave, the wavelength is the distance between two successive crests or troughs.
  • For a longitudinal wave, it is the shortest distance between two peak compressions. 
Amplitude
  • The amplitude of a sound wave is the degree of motion of air molecules within the wave.
  • This corresponds to the extent of rarefaction and compression that accompanies the wave.
  • The greater the amplitude of the wave, the harder the molecules strike the ear drum and the louder the sound is transduced.
  • The amplitude of a sound wave can be expressed in absolute units by measuring the actual distance moved by the air molecules, or the pressure difference in the compression and rarefaction, or the energy involved. 
  • Eg. Ordinary speech produces sound energy at a power level of about one hundred-thousandths of a watt (10⁻⁵W = 10µW)
Velocity
  • The velocity of the wave, which is the speed at which it advances, is equal to the wavelength times the frequency.
  • The frequency of the wave is the number of vibrations (complete cycles) per second. The unit is the Hertz (Hz). 
  • Velocity (m/s) = wavelength (m) x frequency (Hz)
    v = 
    ƛ x f m/s
    So if 1kHz tone in air has a wavelength:
    ƛ = v/f m
      = 333/1000 m
      = 0.333 m
    which is slightly longer than a 12" ruler.


    https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcR9CNnxQIBQzXcuOUSGN5rJ6o9KIGjfI2Zddi1GmDy3FmTP5_klCg

Compression and Rarefaction

COMPRESSION:
INCREASE IN DENSITY

RAREFACTION:
DECREASE IN DENSITY


  • A sound wave is a series of alternate compression and rarefaction events in the medium eg. air.

http://lossenderosstudio.com/rarefaction.jpg

Longitudinal and Transverse Waves

Longitudinal and Transverse Waves

  • Sound is transmitted as a wave motion through a medium such as air, water or metal.
    https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRR8YMHP0yqEHPtp39e1igi1_aeJYflHyPKj4IAUXbgRpqf1uL1

Longitudinal Waves




  • If the vibration is parallel to the direction of motion, the wave is known as a longitudinal wave. 
  • As the sound wave is propagated outward from the centre of disturbance, the individual air molecules move back and forth.
  • Each individual molecule passes the energy on to the next molecules, but after the sound wave has passed, the molecule remains in about the same location of space.
    eg. Newton's Cradle

https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcSQs6XxASqYjjyfXQx5VmkjK-aVS-3eTKIXFJkOL6vIpyFxcvBMag

Transverse Waves

  • If the vibration is at right angles to the direction of motion the wave is known as transverse wave.
  • An example of a transverse wave is the ripple on the surface of water, they move up and down out from the disturbance.
https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcSr1qW3wZq0QQOlPtbaNonkCt0qUY6SC-lJkc-TtR3PeNDBzgXr

  • SOUND
    A "PHYSICAL PHENOMENON THAT STIMULATES THE SENSE OF HEARING"

      Key Words:
  • Longitudinal
  • Transverse
  • Compression
  • Rarefaction
  • Wavelength (of sound)
  • Velocity (of sound)
  • Distance Travelled (by sound)
  • Harmonics
  • Decibels
  • Inverse Square Law
  • Echo vs. Reverberation
  • Anechoic Chamber