You are on page 1of 1

ECE 355 – Fall 2017 – Homework #11

Your job for this assignment is to simulate (in Matlab) an ideal A/D converter followed by
the possibly non-ideal D/A converter you created last time so that you can see the effect of
quantization noise and mismatch. First, write the code to take a signal value between -5 and 5 volts
and produce an integer between 0 and 255. Then convert that to an eight bit binary word compatible
with the D/A converter you already have from homework 10. This is an ideal 8 bit A/D converter.
When you get that working, apply a 4 volt amplitude, 1KHz sine wave by taking samples at
50KHz–that is, samples every 20ìsec–and processing each sample with your A/D converter. Run
the simulation for 10ms, saving the set of binary numbers in a vector that you can apply to your D/A
converter from last time.
First, apply the vector of binary samples to your D/A converter with perfectly matched
resistors. Plot the output waveform against the samples of the original input signal samples. Plot
the difference of the two. Next, plot the FFT of the output waveform above. Oh yeah, whenever
(unless I specify otherwise) you plot the FFT, plot the magnitude out to fs/2 only. Use the semilog
plot function to see all of the spectral components better. Now add dither to the input sine wave with
an rms value equal to the rms value of the quantization noise, apply this to the A/D converter, and
then D/A converter. Plot the FFT spectrum again. Do you see how it has changed? Finally run the
simulation again, adding dither, but randomize the resistors in the D/A converter with 5% standard
deviation. Plot the fft spectrum again and discuss what you see in the spectrum for full credit.

You might also like