Digital Signal Processing (05/13/2009)
PROJECT #2
OVERSAMPLING A/D CONVERTERS: DELTA-SIGMA MODULATORS
Due Date: 06/11/2009
Project description
I want to build a very high quality A/D converter using only a small number of amplitude quantization levels (bits). To this end, we will examine one of a class of oversampling A/D converters: the Delta-Sigma (∆ − Σ ) modulator. The
∆ − Σ modulator is depicted below in Figure 1.
Figure 1. The ∆ − Σ modulator block diagram.
The ∆ − Σ modulator is run at a very high rate, i.e., many times the bandwidth of the input x(n). The amplitude quantizer Q in Figure 1 is usually very low resolution (< 4 bits). In this project, we assume Q is a 1 bit quantizer with input-output relationship given by:
1, 01, 0 1
Because of the high degree of oversampling, the effects of the 1-bit quantization noise are negligible over the input signal bandwidth. This is why a ∆ − Σ modulator is normally followed by a down-sampler as depicted in Figure 2. The quantization noise is removed by the low pass filter allowing the system to operate at a much lower rate.
Figure 2. The ∆ − Σ modulator and down-sampler.
To assess the affects of quantization noise on system performance, we introduce the quantization error e(n) :
, 2
and thus the model for the ∆ − Σ modulator (Figure 1) is as depicted in Figure 3.
Figure 3. Mathematical model for the ∆ − Σ modulator.
Project output
In the first part of this project, we will assess the performance of the ∆ − Σ modulator as applied to an input x(n) comprising two additive sinewaves:
xn Acosω· n 1 " A#cosω#· n 1 "#, n 1, …, 3
where A, A# denote normalized amplitudes (to prevent overloading the quantizer) which are given by:
A K; A# 0.5 · K,
and the constant K is chosen such that the sum of the normalized amplitudes equals 0.9, i.e.,
A A# 0.9 or K 0.9 1.5⁄ 0.6 Also, the sinewave frequencies ./ and phases "/ are given by:
. 205 12 3⁄ , .4 # 2010 12 3⁄ 4
" 3150 180⁄ , "# 9450 180⁄ , The sample rate Fs will be varied as described below.
1. Signal transfer function: With reference to Figure 3, the signal transfer function Hs (z) for the ∆ − Σ modulator is defined by:
142 892
:2;<=>?, 4
i.e., it is the ratio of the Z-transform of the ∆ − Σ modulator output 892 to the Z-transform of the input X(z) under the condition that the quantization error e(n) is zero. From Figure 3, derive Hs (z) and comment on the amplitude and phase distortion introduced by Hs (z)
.
2. Noise transfer function: With reference to Figure 3, the noise transfer function Hn (z) for the ∆ − Σ modulator is defined by:
1=2 892
@2;A=>?, 5
i.e., it is the ratio of the Z-transform of the ∆ − Σ modulator output Yˆ (z) to the Z-transform of the quantization error sequence E( z) under the condition that the input x(n) is zero. From Figure 3, derive Hn (z) and plot the magnitude frequency response B1=CDEFB. Assuming that @CDEF 1, comment on the magnitude frequency response of the ∆ − Σ modulator output, i.e., B89DEB B1DEB · B@CDEFB 1=CDEF under the quantization error input-only condition.
Specifically, how is B89DEB distributed over frequency?
3. Time-domain analysis of ∆ − Σ modulator output:
Here I want you to generate 3 plots of the decimated ∆ − Σ modulator output
89G<H defined as follows:
89G<H 1
IG<H J · IG<H K,
LMNOP
/>?
1, … 6
where IG<H is the decimation factor (specified below) and is the
∆ − Σ modulator output (which you should generate based on the model as specified in Figure 1). You should generate corresponding to three different sample rates and corresponding to the 2-sinewave input model described above:
xn Acosω· n 1 " A#cosω#· n 1 "#, n 1, … , where the amplitudes, phases and frequencies are as specified above. The three sample rates are given by:
34 6412, 25612, 102412.
Given that the signal bandwidth is 10 Hz (highest sinewave frequency), the above sampling rates correspond to oversampling ratios of 6.4, 25.6 and 102.4, respectively. For each sample rate, first generate samples of corresponding to 1 second of data, i.e., for: 1 ≤ n ≤ 34 . So, for 34 = 64Hz you should generate 64 samples of ; for 34 = 256Hz generate 256 samples; etc. Then in plotting
G<H, use the following decimation factors:
IG<H 1 @ 34 6412, IG<H 4 @ 34 25612, RS IG<H 16 @ 34 102412
In this way, you will always plot 64 samples of G<H regardless of 34. For purposes of comparison, also generate a 4-th time plot of the input x(n) corresponding to 34 6412. Discuss the comparisons between the different plots of G<H and x(n) . Can you a find a trend??
4. Spectrum analysis of ∆ − Σ ∆ − Σ ∆ − Σ ∆ − Σ modulator output:
Here I want to compute the magnitude-squared DFT of the ∆ − Σ modulator output, i.e.,
TUK V1
I J · P#WD/P·=P/L L
=>
V
#
, 1 Y K Y I 7
where is generated as described in (3) above corresponding to the three
different sample rate. The length of the DFT N will be varied depending on the sample rate. Specifically, use
I 64 @ 34 6412, I 256 @ 34 25612, RS I 1024 @ 34 102412
In this way the frequency resolution of the DFT is always:
∆ 34⁄ 112, 8 I
and the two sinewave frequencies (5 Hz and 10 Hz ) will coincide with a discrete DFT frequency, i.e., the sinewave at 5 Hz coincides with the DFT frequency index:
K 1 512 ∆⁄ 5 and the sinewave at 10 Hz will coincide with the DFT frequency index: K# 1 1012 ∆⁄ 10.
4a) First I want you to generate 3 plots of TUK in dB (i.e., 10 log?aTUKb) versus k for 1 Y K Y min100, I 2⁄ 1012 ∆⁄ 10. So, for:
34 25612 I 256 RS 34 102412 I 1024
you will plot the 1-st 100 values of 10 log?aTUKb (which correspond to the frequency range: 0 →100 Hz ). For 34 = 64Hz (N = 64) you will plot the first 32 values of 10 log?aTUKb (corresponding to the frequency range: 0 →32 Hz ). Discuss the comparisons between the different plots of 10 log?aTUKb.
Again, can you a find a trend??
4b) Finally, to quantify your results compute the signal-to-noise ratio (SNR) defined as follows:
SNR TUK 6 TUK# 11
∑ij>TUK aTUK TUK#b 9
The numerator is the total signal power at the 2 signal DFT frequencies and the denominator is the total noise power over the frequency range 0 →15 Hz (note that in computing the total noise power, we have to subtract out the signal power). You will compute SNR (even better, 10 log?kIlb) for the three different sample rates given above. Again, can you find a trend??
Note that after you finish Parts 1-4 you will have generated a total of about 8 plots
Note: You can compute TUK via the matlab command: P_y_hat = abs(fft(y_hat)/N).^2;
(1 noise transfer function plot; 4 time domain plots and 3 spectral plots) plus derivations and about a page or two of discussion.
5. Processing ∆ − Σ modulator output with an input audio signal (sound clip):
Given your findings using simple sinewaves, we will now consider an actual speech signal for x(n) . You will find on the class website:
www.csie.ntu.edu.tw/~dsp
a new binary data file:
data1.bin
Download it to your computer and then use the following to read the data into Matlab:
fid = fopen('data1.bin','r');
y_hat = fread(fid,[1, 240016],'bit1'); y_hat = 2*y_hat + 1;
fclose(fid)
The data array y _ hat(n) , n = 1, …, 240016, represents a short (~ 1.3 secs) sound clip from the 1984 movie “Amadeus” that has been oversampled by a factor of 16 via the 1-bit ∆ − Σ modulator as depicted in Figure 1. The ∆ − Σ sampling rate used in generating y _ hat(n) is: 16 ×11025 =176400 Hz = 176.4 kHz. Using the decimation techniques above in Part 3 (Equation 6), recover the underlying speech clip and provide a transcription. In carrying out this part, you will want to try several different decimation factors, i.e., IG<H 2, 4, 8, 16. Which factor dec N provides the best sound quality to you? (Don’t forget, when you listen to the sound after decimation you must change the sample rate correspondingly, i.e., soundsc(ydec,176400/ dec N ).)
6. Project report:
As before, the output of your studies should be clearly documented in a project report (type or write neatly). Make sure you present all supporting data (tables, plots – clearly labeled !!), equations, etc. to justify your conclusions.
Extra Credit (up to 10% of the project):
As an extension of 5 above, instead of using Equation 6 for the decimation operation experiment with different lowpass filters (see Figure 2) to recover the underlying speech clip. Might I suggest, for example, the FIR filter in Matlab: b = fir1(N,fc); where N ~ 25-100 and fc is the cutoff frequency of the lowpass filter normalized by the Nyquist frequency (1/2 the sampling rate). The cutoff frequency of the lowpass filter should thus be matched to the original Nyquist frequency, 11025/2. After lowpass filtering, subsample the data by a factor of M = 16. Compare the quality with 2-3 values of N to that obtained in Part 5. Briefly describe your findings – which filter length N yields the best results? You can also try different decimation factors in which case you will also have to modify fn appropriately.
For those of you interested in finding out more about ∆ − Σ modulators, I refer you to the following references:
[1] Oversampling Delta-Sigma Data Converters. Theory, Design and Simulation, J.
Candy and G. Temes, Ed., IEEE Press, New York, 1992.
[2] Digital Signal Processing in Telecommunications, K. Shenoi, Prentice Hall, Chapter 8, 1995.