2 - 2 - 1.1 - Introduction to signal processing [26-18].txt

download 2 - 2 - 1.1 - Introduction to signal processing [26-18].txt

of 13

Transcript of 2 - 2 - 1.1 - Introduction to signal processing [26-18].txt

  • 8/15/2019 2 - 2 - 1.1 - Introduction to signal processing [26-18].txt

    1/13

    >> Welcome to module one of DigitalSignal Processing.In this module we're going to see whatsignals actually are.We're going to through history, see theearliest of examplesof discreet time signals, actually it goesback to Egyptian times.Then through this history see how digitalsignals forexample, with the telegraph signals,became important in communications.And today, how signals are pervasive inmany applicationsin every day life objects.For this we're going to see what thesignal is,what a continuous time analog signal is,what the discreettime continuous amplitude signal is andhow these signalsrelate to each other and are used incommunication devices.We are not going to have any math in this

    first module,it's more illustrative and the mathematicswill come later in the class.>> Hi, welcome to our Digital SignalProcessing class.In this introduction we would like to giveyouan overview of what digital signalprocessing is all about.And perhaps the best way to do that is toconsider in turn what we meanwhen we use the word signal, when we usethe word processing or the word digital.

    And you will see that digital signalprocessing isreally an intermediate point in areflection about physics,about math and about the reality around usthat starteda very long time ago and continues to thisday.So let's consider the concept of signal tobegin with.In general a signal is a description ofthe evolution of a physical phenomenon.This is best understood by example.

    Take the weather for instance, the weatheris aphysical phenomenon that we usuallymeasure in terms of temperature.So temperature becomesa signal that evolves overtime and thatrepresents a measurement of the underlyingphysical phenomenon.We could've chosen another variable.For instance, we could've chosen rainfall.

  • 8/15/2019 2 - 2 - 1.1 - Introduction to signal processing [26-18].txt

    2/13

    that would constitute another signalrelatedto the same underlying physicalphenomenon.Another example, easy to understand issound.Sound can have very many origins take forinstance some musical instrument or aperson singing.Now when you measure soundwith a microphone for instance, whatyou're measuring isthe pressure, the air pressure at thepoint of measurement.The microphone translates the air pressureintoan electrical signal that represents thesound.Now if you want to record the sound on amagnetic tape for instance, you will haveto convert this electrical signal to amagneticdeviation that can be impressed over themagnetic tape.

    And again, these are differentrepresentations of the same underlyingphysical phenomenon.Taking a photograph is a very similaroperation.In this case, we're mapping the lightintensity of a scene onto gray levels, inthe case of a black and whitephotograph, that can be recorded byphotographic paper.The only difference is that in this casewe'remapping the signal over space rather than

    over time.To make things more tangible let's go backto anexperiment that most likely you carriedout in elementary school when youfirst learned about experimentalprocedures andanalysis of the world around you.You were probably asked to map the dailytemperature for say,a period of a month, and to chart it overgraph paper.And so you dutifully looked at the

    thermometer every morning and then atthe end of the month you probably ended upwith a graph like this.So here we have two conceptsthat are fundamental to digital signalprocessing.The first concept is that the temperaturemeasurements are taken atdiscrete moments in time and theyconstitute a finite countable set.

  • 8/15/2019 2 - 2 - 1.1 - Introduction to signal processing [26-18].txt

    3/13

    And the second similar observation is thatthe range of temperature is actuallysubdivided intoa finite number of possible values whicharedetermined by the resolution of thegraduating scaleon the thermometer.So, we look at the height of the mercurycolumnand we chose the tick that is closest tothat level.But, nonetheless, the number of ticks thatwe can chose from is finite.So the two fundamental concepts here arethediscretization of time due to the factthat wetake observations regularly but notcontinuously and the discretizationof amplitudes due to the fact that ourmeasuringdevice has a finite resolution.Now the discretization of amplitude is

    usually treated as a precision problem.We can use more sophisticated instrumentsand achieve a better precision.But the discretization of time is averitableparadigm shift in the way we think aboutreality.So much so that the problem appeared forthe first time over 2500years ago when the great Greekphilosophers started to think aboutwhy is it that we perceive reality the waywe do.

    And the first character in the story hereis Pythagoras, who in 500 BC, maintainedthatmost of reality, if not all of reality,could be described in terms of numbers andmeasurements.Think for instance of the Pythagoreantheorem,if one draws a right triangle, one canverify experimentally with the ruler thatthe squarebuilt on the hypotenuse is equal to thesum of the squares built on the sides.

    But what Pythagoras said, is that this isa universalproperty that applies to the abstractclass of all right triangles.And this was really a major change inthe way people started to think aboutabstract concepts.Pretty much the same time Parmenides,another character in our story, broughtthis

  • 8/15/2019 2 - 2 - 1.1 - Introduction to signal processing [26-18].txt

    4/13

    line of reasoning more into the waters ofmetaphysics by planting the seed ofa fundamental dichotomy, a fundamentaldifference betweenthe reality that we can experience withour senses and an ideal reality that wewill never be able to know.This of course was later developed byPlato intoa full fledged philosophical theory of theideals.So that even today when we talk about thePlatonic ideal, we referto some form of perfect reality that liesbeyond the veil of appearances.But more interestingly for us is the factthat right when this idea started toappear inthe global consciousness of the time,there were philosophersthat were ready to point out the potentialpitfallsof this new abstract models of reality.And the leader of the pack, so to speak,

    was Zeno of Elea whose paradoxes havesurvived to this day.One of Zeno's most famous paradoxes is theparadox of the arrow, which states that ifyou shoot an arrow from point A topoint B, the arrow will never reach itsdestination.And the reasoning goes like so,well if we modeled reality with theconcepts of geometry thenwe know that any segment can be dividedinto smaller segments.So what Zeno said was that the arrow,

    after leaving point a, and beforereaching point b, will have to travelthrough the mid-point between a and b.Let's call this point c.But now after it has reached the midpointbetween A and Bit will also have to pass through themidpoint between C and B.Let's call this point D.And so on so forth, for every interval youcan always find an extra midpointand the arrow will have to crossall of this midpoints before reaching it's

    destination.But because of the geometric modellingof reality there is an infinite number ofmidpoints and so Zeno said, well in orderto cross an infinite number of points, youwill need an infinite amount of time.Of course today we rebut such anargumentationby saying simply that we can express thelength

  • 8/15/2019 2 - 2 - 1.1 - Introduction to signal processing [26-18].txt

    5/13

    of the segment as the sum of all thesub segments and that this sum convergesto one.But this is a false answer to the problembecause the problem was never withcomputing the sum.The problem was with a model of reality inwhich the infinite and the finite are atodds.And it took over 2,000 years ofmathematical and philosophicalresearch to amend that model and come totoday's model.A model in which the sum of an infinitenumberof terms can indeed converge to a finitequantity without contradictions.Now you see the relevance of this problemto digital signal processing where we aremeasuring physical quantities at regularintervals in time while assuming thatthe underlying physical quantity isactually continuous.One of the reasons why arriving at this

    bettermodel of reality took over 2,000 years isthat inthe Middle Ages, as you can see from thispicture,people were concerned with much moremundane tasks than refininga mathematical model of reality.But progress did come in the end and thetwo towering figures of the 17th century,in this sense, are Galileo and Descartes.Descartes, the inventor of the Cartesianplane, started by put a name to think.

    So if you have a point on the plane likeso, Descartes said, well,if I use a coordinate system around thispoint I can give a nameto this point and I can use algebraicformulasto describe geometrical entities andperform operation on them.So for instance, a line would map to afirst degree equation.This allowed Descartes to solvealgebraically, geometric problems that hadbaffled Greeks, such as for instance the

    trisection of the angle.Much more importantly for us is the factthat the Cartesian Plane is the granddaddy of all vector spaces and you willsee howuseful vector spaces are in the context ofdigital signal processing.Well, Europe in the 17th century was flushwithmoney and Europeans had two things on

  • 8/15/2019 2 - 2 - 1.1 - Introduction to signal processing [26-18].txt

    6/13

    their minds.Finding new markets and winning the war ofconquest that came with the appropriationof new markets.Calculus, that was invented in thoseyears, purported toprovide a new answer to both problems, inthe sense that you could use calculusto find optimal ship routes around theglobe and to find optimal trajectory forcannonballs.Galileo, in particular, worked on thecannonball problem.And operated by running a series ofexperiments in whichthe trajectory of balls thrown by a cannonwas experimentally determined.And then working backwards to derive anideal Platonic model of the ballstrajectory.That is given by this equation where theinitial velocity, expressed as a vector inthe Cartesian plane, is coupled with thepull of gravity to give a parabolic shape.

    So the way science proceeded was bystarting from set ofexperimental data points and then workbackwards to find the descriptionof the underlying phenomenon in the formof a perfect algebraic equation.This usually worked very well forastronomy, which was a main concernin those days, because the trajectories ofthe planets are perfect conic curves.The invention of calculus and theavailability of models for realitybased on functions of real variables, led

    naturally to what we callcontinuous time signal processing.So if you have a function like this whichisfor instance, a temperature function, youcan compute the average,in continuous time, by taking the integralof the functionover its support and dividing by thelength of the support.Without calculus what you would have to dois take daily measurements say of thetemperature.

    And to compute the average you would justsum this values together and then divideby the number of days.Now the question is what is the relationbetween these two averages?What is the error I incur if I useexperimental data ratherthan finding the ideal function behind thedata and then computing the integral.And even if I can do that for certain

  • 8/15/2019 2 - 2 - 1.1 - Introduction to signal processing [26-18].txt

    7/13

    signals that appeared to be smoothand slow like this one, can I do the sameif the signal is fast?In other words, if I have a setof measurements for something that appearsto move quitequickly, do I have any chance even atrecovering the ideal function that liesunderneath the data.Well it took a long time since the17th century to answer this questionbecause oneof the missing pieces of the puzzle washow to measure this speed of the signal.The answer came from Joseph Fourier,the inventor of Fourier analysis.That showed us how to decompose anyphysical phenomenon, anydescription of a physical phenomenon, intoa series of sinusoidal components.A sinusoidal component is like a wave, anda wave is parameterized by itsfrequency, which is really a way ofmeasuring how fast the wave oscillates.

    You can see an example of this sinusoidaldecomposition ofthe signal in the spectral analyzer ofyour MP3 player.By splitting a signal into frequencycomponents youcan see where the energy of the signal is.And if it is in the high frequencies thenthe signal will be moving very fast.Whereas if it is in the low frequencies itwill be moving very slow.The next piece of the puzzle thatcompletes the path from continuous

    reality to discreet reality was given byNyquist andShannon, two researchers at Bell Labs inthe 50s.Their sampling theorem is really thebridge thatconnects the analog world to the digitalworld.The formula is like so, and it lookspretty complicated right now butyou will be very familiar with it by theend of the class.If you just have a tiny look at it, you

    will see thatthe formula relates a continuous timefunction, the Platonic idealwe were talking about, to a set ofdiscrete time measurements.And this sum really is a weighted sumwherefor each discrete sample we associate aspecial shape.Graphically it looks like so.

  • 8/15/2019 2 - 2 - 1.1 - Introduction to signal processing [26-18].txt

    8/13

    If this is our continuous time function,the ideal function, and we have a setof measurements that we indicate withthese reddots, we can reconstruct the originalfunctions startingfrom the samples just by associating whatwecall a sinc function to each of thepoints.So you scale copies of the same functionat each measured interval andthen when you sum them all together youobtain the original function back.All you need for this magic trick tohappen isthat the original function is not toofast, inthe sense that it doesn't contain too manyhigh frequencies.We will see this in more detail during theclass.If we now go back to the beginning of ouroverview, you

    remember the second fundamental ingredientindigital signals is the discrete amplitude.What that means is that we have two formsof discretization of an ideal function.Take for example thissine wave.The first discretization happens in timeand we get a discrete set of samples.And then the second discretization happensin amplitude, where each samplecan take values only amongst apredetermined set of possible levels.

    The very important consequence of thediscretization independently of thenumber of levels is that the set of levelsis countable.So we can always map the level of a sampleto an integer.If our data is just a set of integers now,itmeans that its representation iscompletely abstract and completely generalpurpose.This has some very important consequencesin three domains.

    Storage becomes very easy because anymemorysupport that can store integers can storesignals.And computer memory comes to mind as afirst candidate.Processing becomes completely independenton the nature of the signal becauseall we need is a processors that can dealwith the integers.

  • 8/15/2019 2 - 2 - 1.1 - Introduction to signal processing [26-18].txt

    9/13

    And again, CPUs are general purposeprocessorsthat can deal with integers very, verywell.And finally transmission, with digitalsignal wewill be able to deploy very effectiveways to combat noise and transmissionerrors as we will see in a second.As far as storageis concerned, just consider the differencebetween attempting to storean analog signal, which requires a mediumdependent support foreach kind of application, and the task ofstoring adigital signal, which requires just apiece of computer memory.In analog storage the medium evolved astechnology evolved.And for instance when it came to sound wehad waxcylinders in the beginning, and then youhad vinyl, and then

    reel-to-reel tapes, and then compactcassettes, and so on and so forth.Each medium was incompatible with itspredecessorand required specialized hardware to bereproduced.Today everything is stored in generalpurpose support systems, like memory cardor a hard drive, and is completelyindependent on the type ofcontent that is recorded.If you consider for instance the evolutionof memory

    supports, this is a famous picture fromthe internet.Just one microSD card will contain all theinformationthat was contained in countless floppydiscs and CDs from just a few years back.But what does not change, although thesupport changes and the capacity improveswith time, what does not change is theformatof the data which will remain the sameacross media.When it comes to processing again, the

    fact that the representation of the dataiscompletely decoupled from the origin ofthe datawill allow us to use general purposemachines.Here on the left you have three threeanalog processing devices.A thermostat on top with its temperaturesensitive coil,

  • 8/15/2019 2 - 2 - 1.1 - Introduction to signal processing [26-18].txt

    10/13

    you have a set of gears that for instancecan beused to measure movement or time, and adiscrete electronics amplifier.Each of these devices had to be designedandbuilt to process just one type of analogsignal.Conversely, on the right, you see just apiece of C code that implements a digitalfilter.Now this filter can be used to process atemperature signal or a sound signal andits structure or its implementation willnot change.Finally, let's consider the problem ofdatatransmission which is probably the domainwheredigital signal processing has made themost difference in our day to day life.So if you have a communication channel andyou try to send information froma transmitter to a receiver you are faced

    with a fundamental problem of noise.So let's see what happens inside thechannel.You have a signalthat will be put into the channel.The channel will introduce an attenuation.It will lower the volume of the signal, soto speak.But it will also introduce some noise,indicated here as sigma of t.And what you will receive at the end isan attenuated copy of your originalsignal, plus noise.

    This is just facts of nature that youcannot escape.So, if this is your original signal whatyou will get at the end is an attenuatedcopy scaled by a factor of G, plus noise.So how do you recover the originalinformation?Well, you try to undo the effectsintroduced by thechannel but the only thing you can undo isthe attenuation.So you can try and multiply the receivedsignal by a gain

    factor that is the reciprocal of theattenuation introduced by the channel.So if you do that you introduce a gainhere at the receiver and what you get is,let's start again with the originalsignal, attenuated copy,some noise added and then let's undo theattenuation.Well what happens unsurprisingly is thatthe gain factor has

  • 8/15/2019 2 - 2 - 1.1 - Introduction to signal processing [26-18].txt

    11/13

    also amplified the noise that wasintroduced by the channel.So you get a copy of the signal that isyes,of a comparable amplitude to the originalsignal, butin which the noise is much larger as well.This is typical situation that you get insecondgeneration or third generation copies ofsay a tape.Or if you try and do a photocopy of aphotocopy, justto give you an idea of what happens withthis noise amplification problem.Now, why is this very important?This is important because if you have avery longcable, so for instance, if you have acable that goes from Europeto the United States, and you try to senda telephone conversation over there.What happens is that you have to split thechannel into several

    chunks and try to undo the attenuation ofa chunk in sequence.So you actually put what are called,repeaters along theline that regenerated the signal to theoriginal level every say,ten kilometers of cable or so.But unfortunately the cumulative effect ofthis chain of receiver, is that somenoise gets introduced at each stage andgets amplified over and over again.So for instance, if this is our originalsignal which again, gets

    attenuated and gets corrupted by noise inthe first segment of the cable.After amplication you would get this,which is in that before.Then this signal is injected into thesecond section of the cable.It gets attenuated.New noise gets added to it and whenyou amplify it you get double theamplified noise.And after N sections of the cable you haveN times the amplified noise.This can lead very quickly to a

    complete loss of intelligibility in aphone conversation.Let's now consider the problem oftransmitting a digitalsignal over the same trans oceanic cable.Now, a digital signal as we said before,is composed of samples whose values belongto acountable finite set of levels and sotheir

  • 8/15/2019 2 - 2 - 1.1 - Introduction to signal processing [26-18].txt

    12/13

    values can be mapped to a set of integers.Now transmitting a set of integers meansthat we can encodethese integers in binary format andtherefore we end up transmittingbasically just a sequence of zeros andones, binary digits.We can build an analog signal associatingsay the level plus fivevolt to the digit zero and minus five voltto the digitone and we will have a signal and we willhave asignal that will oscillate between thesetwo levels as the digits are transmitted.What happens on the channel is the sameas before, we will have an attenuation, wewill have the addition of noise andwe will have an amplifier at each repeaterthat will try to undo the attenuation.But on top of it all, we will have what iscalled athreshold operator that will try toreconstitute

    the original signal as best as possible.Let's see how that works.If this is what we transmit, say analternation of zero and one mapped tothese twovoltage levels, the attenuation and thenoisewill reduce the signal to this state.The amplification will regenerate thelevels and will amplify the noise.So, the noise is much larger than before.But now we can just threshold and say, ifthe

    signal value is above zero we just outputfive volts.And vice versa, if it's below zero we willoutput minus five volts.So the thresholding operator willreconstruct a signal like so.So you can see that at the end of thefirst repeater we actuallyhave an exact copy of the transmittedsignal and not a noise corrupted copy.The effectiveness of the digitaltransmission schemescan be appreciated by looking at the

    evolutionof the throughput, the amount ofinformationthat can be put on a transatlantic cable.In 1866,the first cable was laid down and it had acapacity ofeight words per minute which correspondedto approximately five bits per second.In 1956 when the first digital cable was

  • 8/15/2019 2 - 2 - 1.1 - Introduction to signal processing [26-18].txt

    13/13

    laid down on the ocean floorthe capacity all of the sudden skyrocketed to three mega bits per second.So, ten to the power of six.Six order of magnitudes larger than theanalog cable.And in 2005 when a fiber cable was laiddown another sixorder of magnitude were added for acapacity of 8.4 terabits per second.Similarly and literally closer to home, wecan lookat the evolution of the throughput forin-home data transmission.In the 50s the first voice-band modemscame out of Bell Labs.Voice-band meaning that they were devicesdesignedto operate over a standard telephonechannel.Their capacity was very low, 1200 bits persecond, and they were analog devices.With the digital revolution in the 90sdigital modems

    started to appear and very quickly reachedbasically the ultimatelimit of data transmission over thevoice-band channel which was56 kilobits per second at the end of the90s.The transition to ADSL pushed that limitup to over 24 megabits per second in 2008.Now, this evolution is of course partlydueto improvements in electronics and tobetter phone lines.But fundamentally its success and its

    affordability aredue to the use of digital signalprocessing.We can use small yet very powerful andcheap general purpose processorsto bring the power of error correctingcodesand data recovery even in small homeconsumer devices.In the next few weeks we will studysignal processing stun, starting from theground up.And by the end of the class will have

    enough tricks in our bag to fullyunderstand how an ADSL modem works.And so after this very far reaching andprobably rambling introduction, it's timeto go back to basics and we willsee you in module two to discover whatdiscreet time signals are all about.