DSPRelated.com
Forums

Questions on a good book's content.

Started by Adel November 3, 2003
Hello.

I am reading "The Scientist and Engineer's Guide to Digital Signal
Processing" by Steven W. Smith and I have a question. In the chapter 3
(http://www.spectrumsdi.com/ch3.pdf) p.60:

"The 8 kHz data is pulled from memory and converted to a 64 kHz
sampling rate, a procedure called interpolation. This involves placing
seven samples, with a value of zero, between each of the samples
obtained from memory. The resulting signal is a digital impulse train,
containing the desired voice band between 100 and 3000 hertz, plus
spectral duplications between 3 kHz and 32 kHz."

I can't understand what does it mean in the frequency domain if in the
time domain I place samples, with a value of zero between existing
samples of original signal?

And second question. In chapter 12
(http://www.spectrumsdi.com/ch12.pdf) p.231:
"As shown in Fig. 12-4, diluting the time domain with zeros
corresponds to a duplication of the frequency spectrum."

Why it is so?

Thanks in advance.

Adel Mamin.
Adel wrote:

> Hello. > > I am reading "The Scientist and Engineer's Guide to Digital Signal > Processing" by Steven W. Smith and I have a question. In the chapter 3 > (http://www.spectrumsdi.com/ch3.pdf) p.60: > > "The 8 kHz data is pulled from memory and converted to a 64 kHz > sampling rate, a procedure called interpolation. This involves placing > seven samples, with a value of zero, between each of the samples > obtained from memory. The resulting signal is a digital impulse train, > containing the desired voice band between 100 and 3000 hertz, plus > spectral duplications between 3 kHz and 32 kHz." > > I can't understand what does it mean in the frequency domain if in the > time domain I place samples, with a value of zero between existing > samples of original signal? > > And second question. In chapter 12 > (http://www.spectrumsdi.com/ch12.pdf) p.231: > "As shown in Fig. 12-4, diluting the time domain with zeros > corresponds to a duplication of the frequency spectrum." > > Why it is so? > > Thanks in advance. > > Adel Mamin.
That's hard to answer without drawing pictures. At least, I'm not articulate enough today. See if you can find help at http://www.bores.com/courses/intro/index.htm and keep in mind that what you are seeing amounts to aliasing in reverse. It will come clear. I'll answer when I have more time if you ask again. Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
"Adel" <tadam@pisem.net> wrote in message
news:c8d8c374.0311030555.1450f64c@posting.google.com...
> Hello. > > I am reading "The Scientist and Engineer's Guide to Digital Signal > Processing" by Steven W. Smith and I have a question. In the chapter 3 > (http://www.spectrumsdi.com/ch3.pdf) p.60: > > "The 8 kHz data is pulled from memory and converted to a 64 kHz > sampling rate, a procedure called interpolation. This involves placing > seven samples, with a value of zero, between each of the samples > obtained from memory. The resulting signal is a digital impulse train, > containing the desired voice band between 100 and 3000 hertz, plus > spectral duplications between 3 kHz and 32 kHz." > > I can't understand what does it mean in the frequency domain if in the > time domain I place samples, with a value of zero between existing > samples of original signal? > > And second question. In chapter 12 > (http://www.spectrumsdi.com/ch12.pdf) p.231: > "As shown in Fig. 12-4, diluting the time domain with zeros > corresponds to a duplication of the frequency spectrum." > > Why it is so?
Adel, I like to think of it this way: You have increased the "theoretical" sample rate by a factor of 8. This means that fs went from fs1=8kHz to fs8=64kHz as stated. But, you have added no new information. Interesting, eh? So, if you look at the spectrum, you normally look from: -fs1/2=-4kHz to fs1/2=4kHz or from zero to fs1=8kHz. Now that you have changed the sample rate to 8*fs0=fs8, you will want to look from -fs8/2 to fs8/2 or from zero to fs8. What you will see is the same spectral data repeated 8 times. Here's an easy way to construct this using "cartoons". These really are cartoons so you don't have to be very careful and you can crumple one up and start over if you feel like it. 1) Draw a wiggly line that represents the time data on a horizontal time axis - it doesn't matter what it looks like. This is before sampling. 2) To the right side of this figure, draw a spectral plot of the continuous data. It will stop at 3kHz as you've said. Make the shape something easy to draw, like a half triangle going to zero at 3kHz. Draw a two-ended arrow pointing between the two figures. This means "these two time and frequency plots correspond" 3) Below the center of the time plot, make a mark "X" meaning "multiply". 4) Below this, draw another time plot that is a picket fence of sample points. This represents the time sampling you're going to do. Mark the spacing between them as T=1/fs 5) Below this, put a down arrow sign "v" meaning "results in". 6) Below this, show the product of the two time plots above. It will be a picket fence with varying picket heights according to the original time data. Now we will construct the spectral information for these two new time plots - to the right of them 7) Below the center of the first frequency plot, make a mark "*" meaning "convolve". Multiplication in time is matched with convolution in frequency - that's part of the pairing. 8) Below, this and to the right of the picket fence of time sample points, draw another picket fence with pickets at frequency= zero, and fs=1/T, 2/T, 3/T, -1/T..... [you do this because you know that the Fourier Transform of a picket fence is just another picket fence and with the spacing relations given here]. 9) Below this, put a down arrow sign "v" meaning "results in". 10) Below this, draw another frequency plot. This step is the trickiest because you are going to visualize what convolution does. But, this one is pretty simple: You are going to convolve the original spectrum with the frequency picket fence. This simply repeats the spectrum at each picket. So now you have triangles that peak at 0,fs, 2fs, 3fs, etc. that extends 3kHz in either direction from the peak. | x | | x x x | x |x x xx | |x | xx x| | x | x | x | | | x | | <-> | x | | | x | | | x | | | x | | | x | | | x | | | x +----------+ +-----------xooooooooooooooooo time -> frequency -> B X * ^ ^ ^ ^ ^ ^ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | <-> | | | | | | | | | | | | | | | | | | | | | | | | | | |T |T |T | | | +----------+ +-----------------------------+ time -> 0 frequency -> fs V V | | o o x x | | x |x x|x | o | x | x x | x | | | o x | x x | x | | | | | x x | x | | | | <-> | x x | x | | | | | x x | x | | | | | x x | x | | | | | x x | x | | | | | x x | x | | | | | x x | |T |T |T | | x x | +----------+ +-----------xoooooox-----------+ time -> f=0 B fs-B fs=1/T Now, we are going to increase the sample rate: 11) Repeat the process above ... starting with a picket fence in time that has 8 times as many samples per unit time. 12) Multiply in time follwing the same steps in making figures as before. Except now you're multiplying the varying time picket fence with another picket fence. The result is a varying picket fence with 7 zeros inserted between each of the original samples. This is what you started with in your situation. 13) Now draw the corresponding frequency plots to the right of each of the new time plots. The first one will be a picket fence with pickets separated by 8fs1=fs8 ... so ...-fs8, 0 fs8, 2*fs8, 3*fs8..... 14) The convolution in frequency this time results in nothing new. Convolving an ever-repeating sequence with a picket fence that's spaced an integral multiple of the original pickets does nothing. Well, except perhaps to change your perspective! So, to change the perspective, mark the spots at -fs8,0,fs8,2*fs8,....etc. This is the span of the "new" spectrum. This also allows you to answer your own question. What you have done is increase the apparent sample rate by adding the zeros. You have extended the span of the frequency spectrum "of interest" to fs8=64kHz with simple repetitions of the original spectrum. Please view in a fixed-width font such as Courier. | | | | | | x x x x x x x | x |x x|x x|x x|x x|x x| | | x | | | | | | | | | | | | | | | | | x | | | | | | | | | | <-> | | | | | | | | | | | <-> | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | T | T | T | | | | | | | +-----------------------+ +-ooo-+-ooo-+-ooo-+-ooo-+-ooo-+ time -> 0 fs 2fs 3fs 4fs 5fs 1/T frequency -> X * o o o o o o o o o o o o o o o | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | <-> | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +-----------------------+ +-----------------------|------> time -> 0 frequency -> fs=4/T V V x x x x x x x | x |x x|x x|x x|x x|x x| | | x | | | | | | | | | | | | | | | | | x | | | | | | | | | | | <-> | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +-o-o-o---o-o-o---o-o-o-+ |-ooo-+-ooo-+-ooo-+-ooo-|-ooo-+ time -> 0 frequency -> fs=4/T However, you haven't done "interpolation" yet!! You have only set the stage for it. In order to interpolate, you need to fill in those zeros in time. This takes one more step of multiplication and convolution in the cartoons. In this case, we're going to multiply in frequency and convolve in time. You already know how to construct the cartoons so this should be reasonably easy: Interpolation and low pass filtering are very closely related and are often the same thing. What we see in frequency right now is the original spectrum repeated 7 times over the new sample frequency. What we want is to see the original spectrum plotted with the new sample frequency but with no repetitions of it in between. That would be a reasonably faithful representation of the original signal but having used the higher sample rate. So, what we want to do is get rid of all those repetitions above 3kHz and below 61kHz. This means apply a lowpass filter. Let's make it simple a use a perfect lowpass filter. (There may be better choices but that comes in Chapter 2). So we will multiply in frequency by a function that is: 1.0 from -4kHz to +4kHz and zero everywhere else, that repeats every 64kHz. We know that the Inverse Fourier Transform of this periodic "gate" function is a sin(x)/x shape that has zeros peridic at 1/8kHz seconds. So, you will have a cartoon with a periodic gate in frequency and a sinx/x in time as a transform pair. Multiplying the periodic gate times the repeating spectrum, removes (lowpasses) all of the repeating parts between 3kHz and 61kHz. Convolving the time samples with the sinx/x yields values where the zeros are. The end result in time is a sequence of samples that are interpolated by a factor of 8. Please view in a fixed-width font such as Courier. x x x x x x x | x |x x|x x|x x|x x|x x| | | x | | | | | | | | | | | | | | | | | x | | | | | | | | | | | <-> | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +-o-o-o---o-o-o---o-o-o-+ |-ooo-+-ooo-+-ooo-+-ooo-|-ooo-+ time -> 0 frequency -> fs=4/T Adding zeros in time increases the sample rate without changing th frequency spectrum - only the perspective. * X o ooooo ooooo | ||||| ||||| | ||||| ||||| | ||||| ||||| | ||||| ||||| | <-> ||||| ||||| | ||||| ||||| | ||||| ||||| o | o ||||| ||||| | | | ||||| ||||| o | | | o ||||| ||||| | | | | | ||||| ||||| o---o---o---+---o---o---o- oooo|oooooooooooooooooooooo|ooooo+ | time -> | 0 frequency -> fs=4/T o o V V X x x | x x x X x|x x|x | | | | | x x X | | | | | | | | x x | | | | | | | | | | | x X x | | | | | | | | | | | | | | | | | | <-> | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +-----------------------+ - | --------------------- + - time -> 0 frequency -> fs=4/T Fred
Fred and Jerry, thanks for your answers. 
Now the things are clear for me.
And I would like to ask another question. The same book, chapter 11
p.223:
"Remember, whenever the phase is directly manipulated, frequency 0 and
0.5 must both have a phase of zero (or a multiple of 2pi, which is the
same thing)."
Why?

Adel Mamin.
"Fred Marshall" <fmarshallx@remove_the_x.acm.org> wrote in message
news:faWdnWIbUJWULDui4p2dnA@centurytel.net...
>
....................snip
> > Now, we are going to increase the sample rate: > > 11) Repeat the process above ... starting with a picket fence in time that > has 8 times as many samples per unit time.
I should have said "4 times" for the pictures ... that was easier to draw