• obligatory dead person quote:
    • ”[…] space and time are mere thought entities and creatures of the imagination […] They precede the existence of objects of the senses […]”
  • number sets:
    • N: natural numbers [1,)
      • whole numbers [0,)
    • Z: integers
    • Q: rational numbers
      • inclusive of recurring mantissa
    • P: irrational numbers
      • non-repeating and non-recurring mantissa
      • π value, 2
    • R: real numbers (everything on the number line)
      • includes rational and irrational numbers
    • C: complex numbers
      • includes real and imaginary numbers

number-sets

fig: number sets


digital signal processing

  • signal: description of a physical phenomenon’s evolution over time
  • signal processing:
    • analysis: understanding the information carried by the signal
    • synthesis: creating a signal to contain the information
  • digital paradigm for signal processing:
    • discrete, digitized time
    • discrete, digitized amplitude
  • a digital signal is a sequence of observations called samples
    • a sample is denoted by x[n]
  • each sample is subjected to both:
    • time discretization: time component ‘n
    • amplitude discretization: amplitude component ‘x

discrete-time

  • discrete-time model:
    • a paradigm that moves away from the idealistic analog view
      • makes computation more intuitive
      • finding solutions easier with computational methods
    • more practical model of reality compared to analog models
  • Sampling Theorem:
    • mathematically, analog and discrete models are equivalent
      • provided sufficient discrete sampling is available
  • samples replace idealized models
  • simple math replaces calculus

discrete-amplitude

  • each amplitude can only take on a value from a predetermined set
    • the number of levels in countable
    • so the amplitude is mapped to a set of integers
  • this ability to integer mapping provides benefits for
    • storage
    • processing
    • transmission
  • analog signals suffer from noise and attenuation in way that causes loss of information during signal transmission
    • digital signal transmission mechanisms are more robust
    • information is significantly low
  • general-purpose storage can be used
  • general-purpose processing can be applied
  • noise can be controlled during signal transmission

discrete-time signals

  • ‘lollipop’ notation
  • discrete-time signals sampled sufficiently densely look continuous in a plot

formally

  • a sequence of complex numbers
  • one dimensional
  • notation: x[n]
    • [n]: integer
  • two-sided sequences: x:ZC
    • n(,+)
  • n is adimensional “time”
    • no physical units, just a counter
    • can embody periodicity
      • number of samples of the repeating pattern
  • analysis eg.: periodic temperature, sea-level, river water level
  • synthesis eg.: stream of algorithm generated samples

fundamental discrete signals

  • delta signal: x[n]=𝛿[n]
    • when n=0,x=1; else x=0
    • signifies a physical phenomenon that lasts a very short duration of time
    • eg. a clapper for syncing video and audio for a movie recording
      • when audio and video recording happens separately

delta

fig: discrete delta

  • unit step: x[n]=u[n]
    • when n<0,x=0; else x=1
    • synonymous to flipping a switch

unit step

fig: discrete unit step

  • exponential decay: x[n]=|a|nu[n],|a|<1
    • when n<0,x=0; else x decays exponentially, starting from 1 @ n=0
    • x0 as n
    • newton’s law of cooling
      • cooling of a coffee cup
    • rate of capacitor discharge

exponential decay

fig: discrete exponential decay

  • sinusoid: x[n]=sin(ω0n+θ)
    • ω0: angular frequency rad
    • θ: initial phase rad

sinusoid

fig: discrete sinusoid


signal classes

  • finite-length
  • infinite length
  • periodic
  • finite-support

finite-length signals

  • can only have N samples
    • N: range of signal
    • N is limited in finite-length signals
  • notations:
    • sequence: x[n],n=0,1,,N1
    • vector: x=[x0,x1,,xN1]T
  • practical entities
    • good for numerical packages

infinite-length signals

  • can have infinite number of samples
  • it is an abstraction
  • useful for theorems that do not depend on the length of the data

periodic signals

  • repetitive samples with a constant frequency
  • notation: x~ xtilde
  • N-periodic signals: x[n]=x~[n+kN];n,k,NZ
    • data repeats every N samples
    • same information as finite-length of length N
    • natural bridge between finite and infinite lengths

finite-support signals

  • infinite length sequence
    • but only a finite number of non-zero sample
  • notation: x¯ xbar
  • x¯=x[n] if 0nN)else\(x=0;nZ
  • same information as finite-length
  • another bridge between finite and infinite length lengths

elementary signal operations

  • scaling:
    • y[n]=αx[n]
  • sum:
    • y[n]=x[n]+z[n]
  • product:
    • y[n]=x[n]z[n]
  • delay (shift):
    • y[n]=x[nk],xZ
    • output of operation is shifted by k samples
    • care must be taken to append and prepend zeros to accommodate the shift
    • two types of delay:
      • finite-length is turned into finite-support
        • by adding zeros until and +
        • then shift is applied
      • make the finite-signal periodic:
        • samples circle around in the given range of N
  • energy:
    • sum of the squares of all amplitudes of the signal
    • consistent with physical energy
    • many signals have infinite energy i.e. periodic signals
    • so not a great way to describe the energetic property of a signal

Ex=n=|x[n]|2

  • power:
    • a signal cannot have infinite power even if it’s energy is infinite
    • power is the rate of production of energy for a sequence
    • it is limit of the ratio of local energy in a window to the size of the window as N goes to infinity
    • for a periodic signal, the power is the ratio fo energy in one period to the length of the period

Px=limN12N+1n=NN|x[n]|2


simple dsp applications

digital vs. physical frequency

  • discrete time:
    • n: just a counter, no time dimension
    • periodicity: number of samples of one cycle of the pattern
  • physical time:
    • frequency: Hz (s1)
    • periodicity: number of seconds of one cycle of the pattern

dsp lab: laptop/desktop

  • a desktop computer is a signal processing lab for all practical purposes
  • signals can be generated
    • visualed as plots
    • can be used to generate sounds
      • an analog-digital interface is needed for this
  • a sound card is an interface that converts digital signals to analog
    • has a system clock of period Ts seconds
    • discrete samples at Ts intervals are sampled and converted to analog electrical signals
  • a periodicity of M samples in digital domain
    • becomes MTs  seconds in the physical domain
    • frequency in physical domain f=1MTsHz
  • sampling rate for sound card: Fs
    • Ts=1Fs
    • usually Fs=48000 Hz; so Ts20.8μs
    • so, for M=110f440Hz
    • and M=Fsf
  • dsp involves a few fundamental building blocks
    • adder block:
      • x[n]+y[n] fig: adder block
    • scaler block:
      • αx[n] fig: scaler block
    • delay block:
      • x[n]z1x[n1]
        • (z1) means unit buffer
        • holds current value and send previously held value fig: unit delay (buffer) block
      • x[n]zNx[nN]
        • (zN) means N samples buffer fig: N delay (buffer) block
  • these blocks can be combined in any way to build arbitrarily complex circuitry for analysis or synthesis
    • an abstract implementation of dsp algorithm is first made
      • with the building blocks in a flow chart
      • can then be coded and executed in any language
    • example: moving average:
      • local average of a few samples
      • 2-sample moving average:
        • y[n]=x[n] + x[n1]2 fig: two-point moving average block
      • M sample moving average is an ubiquitous tool to smooth discrete signals
  • feedback loop:
    • unit delay feedback loop
      • y[n]=x[n]+αx[n1] fig: feedback loop with delay
    • introduces recursion in the algorithm: chicken-and-egg problem
    • to solve the particular problem feedback loop is applied to
      • set a start time n0
      • assert zero initial conditions for input and output for all time before n0
    • feedback loop for interest accumulation in a bank account:
      • assume interest rate 10% p.a.
      • interest accrual date: Dec 31
      • deposit/withdrawals in year n: x[n]
      • so balance (with accrued interest) at year-end is:
        • y[n]=1.1y[n1] + x[n]
    • M-delay feedback loop:
      • y[n]=x[n]+αx[nM] fig: M-samples delay feedback loop
      • equivalent to cascading unit delays in feedback branch
  • Karplus-Strong Algorithm:
    • to synthesize plucked-string sound
    • algorithm: build a recursion loop with a delay M
      • y[n]=x[n]+αx[nM]
      • the number of samples controls the pitch of the output sound
    • input: finite support signal x¯[n]
      • non-zero only for 0n<M
      • this controls the timbre of the output
    • parameters to configure (knobs of the algorithm):
      • decay factor: α
        • α=1: no decay (100% feedback)
        • α=0: extreme decay (0% feedback)
      • controls how sustained the sound is
    • run the algorithm on the input to generate output
    • a random valued ([1,1]) finite-support signal input was found to give best results
  • Refactoring DSP operations:
    • DSP operations can get complex very quickly
    • refactoring them is an art that heavily aids building simple block diagrams
    • the simplified expressions are used for efficiency in analysis and synthesis

references