Digital Signal Processing(3)

Document Sample
Digital Signal Processing(3) Powered By Docstoc
					 Digital to Analogue Conversion
• Natural                x(t )  sin(2ft)
  signals tend to
  be analogue

                        x(n)  sin(2fnt s )
• Need to
  convert to
• Need to hold the signal steady for long enough
  to enable the A to D converter to generate an

                Sample      Analogue
                 and        To digital
                 Hold       converter
• Quantization converts continuous value to
  a discrete (usually integer) value

• Output value is rounded so accuracy lost

• Maximum quantization error of ±0.5 lsb

• Error is combined with signal as noise
        Quantization accuracy
• Least significant bit determines accuracy. So for
  a 2 Volt peak to peak signal, an 8 bit converter
  can accurately represent multiples of 7.81mV
  but anything in between will be rounded

  If input range is  1 volt then for 8 and 16 bit converters:
              full voltage range 2 volts
  lsb value          num bits
                                    8
                                          7.81mV
                    2              2
              full voltage range 2 volts
  lsb value          num bits
                                 16  30.5V
                    2              2
         Quantization error

Error is at most
±1/2 an lsb, or
±3.905 mV for the 8
bit converter or
±15.25µV in the 16
bit case
          Quantization error
• Relatively small signal changes are
  subject to severe quantization errors
• Quantization error
  creates steps

• Steps create
  distortion which is
  visible in the
  frequency domain

• Noise shown on dB
  scale as it is
  relatively small
  compared to the
          Sampling theory
• Signal needs to be sampled at twice the
  speed of the fastest change to be captured
• Shannon or the Nyquist sampling theorem,
  (authors of 1940s papers)
• Theorem states that a continuous signal
  can be properly sampled, only if it does
  not contain frequency components above
  one-half of the sampling rate
     Correctly sampled signal
• Signal frequency is 0.09 of the sample rate
  (i.e. sample rate is about 11x signal freq)

• e.g. 90Hz signal sampled at 1kHz
         Sample rate still ok
• Signal frequency is 0.31 of the sample rate
(i.e. sample rate about 3x signal freq)

• 3.2 samples / cycle but freq still preserved
          Improper Sampling
• Signal frequency is 0.95 of the sample rate (i.e.
  sample rate only slightly higher than signal freq)

• Only 1.05 samples per cycle. Produces a 0.05Hz
  alias signal which is mixed with the original
• Sampling a signal is effectively
  multiplication of signals in the time domain

• Multiples of the sample frequency are
  produced as well as sum and difference
  frequencies (sidebands)
   No sampling no sidebands
• Time domain to frequency domain of an
  analogue signal
Sampled signal produces
    Incorrectly sampled signal
• Breaching Nyquist causes aliasing with
  overlapping sidebands
            Simulated sampling
• Using a sample rate of 1kHz, the frequency
  spectrum with noise was calculated from:
   f (n)  sin(2 50 nts )  sin(2 120 nts )  sin(2 300 nts )

• Then modified to illustrate aliasing by changing
  300Hz signal to 800Hz:
   f (n)  sin(2 50 nts )  sin(2 120 nts )  sin(2 800 nts )
   Correct sample rate

f (n)  sin(2 50 nts )  sin(2 120 nts )  sin(2 300 nts )
        Aliasing at 200Hz

f (n)  sin(2 50 nts )  sin(2 120 nts )  sin(2 800 nts )
             Anti-alias filter
• Frequencies higher than those of interest (such
  as noise) need to be blocked before sampling.
  Use an analogue low pass filter
                      DSP system
Analogue     Sample   Analogue              Digital      Analogue
Anti-alias    and     to digital         to analogue   Reconstruction
  Filter      Hold    converter           converter        Filter

• Low pass input filter removes F > 0.5F(S)
• Reconstruction filter removes high
  frequency F(S) multiples
Sound Blaster block diagram

Lingjuan Ma Lingjuan Ma