DSPRelated.com
Forums

Interpolation and decimation in DFT...

Started by Vista May 25, 2007
Hi all,

I have two blocks of samples of signals.

x0, ..., x_{n-1},

and

y0, ..., y_{n-1},

where DFT[x]= y.

Suppose I want to interpolate {x} by a upsampling rate of 2, how to do that 
by operating on the {y} sequence, assuming {x} is not given so we can only 
modify {y}?

How about decimating {x} by a downsampling rate of 2?

Now, what if I want to interpolate {y} by a upsampling rate of 2, how to do 
that by operating on the {x} sequence, assuming {y} is not given so we can 
only modify {x}?

What about decimating {y} by a downsampling rate of 2?

Thanks! 


On May 25, 6:23 am, "Vista" <a...@gmai.com> wrote:
> Hi all, > > I have two blocks of samples of signals. > > x0, ..., x_{n-1}, > > and > > y0, ..., y_{n-1}, > > where DFT[x]= y. > > Suppose I want to interpolate {x} by a upsampling rate of 2, how to do that > by operating on the {y} sequence, assuming {x} is not given so we can only > modify {y}? > > How about decimating {x} by a downsampling rate of 2? > > Now, what if I want to interpolate {y} by a upsampling rate of 2, how to do > that by operating on the {x} sequence, assuming {y} is not given so we can > only modify {x}? > > What about decimating {y} by a downsampling rate of 2? > > Thanks!
Smells like a homework question. What have you come up with so far ?
On May 25, 6:23 am, "Vista" <a...@gmai.com> wrote:
> Hi all, > > I have two blocks of samples of signals. > > x0, ..., x_{n-1}, > > and > > y0, ..., y_{n-1}, > > where DFT[x]= y. > > Suppose I want to interpolate {x} by a upsampling rate of 2, how to do that > by operating on the {y} sequence, assuming {x} is not given so we can only > modify {y}?
Divide y into two equal pieces (each having n/2 samples). Insert n zeroes between the first half of y and the last half of y. IDFT the new sequence.
> > How about decimating {x} by a downsampling rate of 2?
Divide y into 4 equal pieces (each having n/4 samples). Throw away the middle two pieces. IDFT the new sequence.
> > Now, what if I want to interpolate {y} by a upsampling rate of 2, how to do > that by operating on the {x} sequence, assuming {y} is not given so we can > only modify {x}? > > What about decimating {y} by a downsampling rate of 2? > > Thanks!
"BERT" <callmevc@gmail.com> wrote in message 
news:1180094062.875578.73670@g4g2000hsf.googlegroups.com...
> On May 25, 6:23 am, "Vista" <a...@gmai.com> wrote: >> Hi all, >> >> I have two blocks of samples of signals. >> >> x0, ..., x_{n-1}, >> >> and >> >> y0, ..., y_{n-1}, >> >> where DFT[x]= y. >> >> Suppose I want to interpolate {x} by a upsampling rate of 2, how to do >> that >> by operating on the {y} sequence, assuming {x} is not given so we can >> only >> modify {y}? >> >> How about decimating {x} by a downsampling rate of 2? >> >> Now, what if I want to interpolate {y} by a upsampling rate of 2, how to >> do >> that by operating on the {x} sequence, assuming {y} is not given so we >> can >> only modify {x}? >> >> What about decimating {y} by a downsampling rate of 2? >> >> Thanks! > > Smells like a homework question. What have you come up with so far ? > >
It's my self-study question. That's to say-- I raised it myself, to help me understand the sampling rate conversion better. I don't have result yet. Could you please give some help? Thanks
"John Hadstate" <jh113355@hotmail.com> wrote in message 
news:1180094910.608568.259980@q75g2000hsh.googlegroups.com...
> On May 25, 6:23 am, "Vista" <a...@gmai.com> wrote: >> Hi all, >> >> I have two blocks of samples of signals. >> >> x0, ..., x_{n-1}, >> >> and >> >> y0, ..., y_{n-1}, >> >> where DFT[x]= y. >> >> Suppose I want to interpolate {x} by a upsampling rate of 2, how to do >> that >> by operating on the {y} sequence, assuming {x} is not given so we can >> only >> modify {y}? > > Divide y into two equal pieces (each having n/2 samples). Insert n > zeroes between the first half of y and the last half of y. IDFT the > new sequence. > >> >> How about decimating {x} by a downsampling rate of 2? > > Divide y into 4 equal pieces (each having n/4 samples). Throw away > the middle two pieces. IDFT the new sequence. >
Thanks John! Do you have any theorey/proof supporting your methods? Thanks again!
Vista wrote:
> Hi all, > > I have two blocks of samples of signals. > > x0, ..., x_{n-1}, > > and > > y0, ..., y_{n-1}, > > where DFT[x]= y. > > Suppose I want to interpolate {x} by a upsampling rate of 2, how to do that > by operating on the {y} sequence, assuming {x} is not given so we can only > modify {y}? > > How about decimating {x} by a downsampling rate of 2? > > Now, what if I want to interpolate {y} by a upsampling rate of 2, how to do > that by operating on the {x} sequence, assuming {y} is not given so we can > only modify {x}? > > What about decimating {y} by a downsampling rate of 2?
I assume that by "upsampling" you mean generating a signal that more specified points per unit time than the original; an operation on a time sequence. The FT converts a time sequence to a spectrum. What does "upsampling" a spectrum mean? (I can supply a meaning, and I can suggest how you might do it, but it would be silly to suggest what you might not want.) Jerry -- Engineering is the art of making what you want from things you can get. &macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;
"Jerry Avins" <jya@ieee.org> wrote in message 
news:YM2dnfFvyaN2sMrbnZ2dnUVZ_oGlnZ2d@rcn.net...
> Vista wrote: >> Hi all, >> >> I have two blocks of samples of signals. >> >> x0, ..., x_{n-1}, >> >> and >> >> y0, ..., y_{n-1}, >> >> where DFT[x]= y. >> >> Suppose I want to interpolate {x} by a upsampling rate of 2, how to do >> that by operating on the {y} sequence, assuming {x} is not given so we >> can only modify {y}? >> >> How about decimating {x} by a downsampling rate of 2? >> >> Now, what if I want to interpolate {y} by a upsampling rate of 2, how to >> do that by operating on the {x} sequence, assuming {y} is not given so we >> can only modify {x}? >> >> What about decimating {y} by a downsampling rate of 2? > > I assume that by "upsampling" you mean generating a signal that more > specified points per unit time than the original; an operation on a time > sequence. The FT converts a time sequence to a spectrum. What does > "upsampling" a spectrum mean? (I can supply a meaning, and I can suggest > how you might do it, but it would be silly to suggest what you might not > want.) > > Jerry > -- > Engineering is the art of making what you want from things you can get. > &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
I believe upsampling and downsampling are fairly standard in DSP. Mechanically, treating the spectrum as a signal, I can apply U/D sampling to spectrum as well. That's what I meant... Thanks Jerry!
Vista wrote:
> "Jerry Avins" <jya@ieee.org> wrote in message > news:YM2dnfFvyaN2sMrbnZ2dnUVZ_oGlnZ2d@rcn.net... >> Vista wrote: >>> Hi all, >>> >>> I have two blocks of samples of signals. >>> >>> x0, ..., x_{n-1}, >>> >>> and >>> >>> y0, ..., y_{n-1}, >>> >>> where DFT[x]= y. >>> >>> Suppose I want to interpolate {x} by a upsampling rate of 2, how to do >>> that by operating on the {y} sequence, assuming {x} is not given so we >>> can only modify {y}? >>> >>> How about decimating {x} by a downsampling rate of 2? >>> >>> Now, what if I want to interpolate {y} by a upsampling rate of 2, how to >>> do that by operating on the {x} sequence, assuming {y} is not given so we >>> can only modify {x}? >>> >>> What about decimating {y} by a downsampling rate of 2? >> I assume that by "upsampling" you mean generating a signal that more >> specified points per unit time than the original; an operation on a time >> sequence. The FT converts a time sequence to a spectrum. What does >> "upsampling" a spectrum mean? (I can supply a meaning, and I can suggest >> how you might do it, but it would be silly to suggest what you might not >> want.) >> >> Jerry >> -- >> Engineering is the art of making what you want from things you can get. >> &#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533; > > > I believe upsampling and downsampling are fairly standard in DSP. > Mechanically, treating the spectrum as a signal, I can apply U/D sampling to > spectrum as well. That's what I meant... Thanks Jerry!
I can only imagine what you would mean by upsampling a spectrum. I can see a few ways to use the spectrum to create an upsampled time signal and to get the spectrum of the upsampled time signal. (That amounts to interpolation.) Jerry -- Engineering is the art of making what you want from things you can get. &macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;
"Vista" <abc@gmai.com> wrote in message 
news:f377lg$gc9$1@news.Stanford.EDU...
> > "John Hadstate" <jh113355@hotmail.com> wrote in message > news:1180094910.608568.259980@q75g2000hsh.googlegroups.com... >> On May 25, 6:23 am, "Vista" <a...@gmai.com> wrote: >>> Hi all, >>> >>> I have two blocks of samples of signals. >>> >>> x0, ..., x_{n-1}, >>> >>> and >>> >>> y0, ..., y_{n-1}, >>> >>> where DFT[x]= y. >>> >>> Suppose I want to interpolate {x} by a upsampling rate >>> of 2, how to do that >>> by operating on the {y} sequence, assuming {x} is not >>> given so we can only >>> modify {y}? >> >> Divide y into two equal pieces (each having n/2 samples). >> Insert n >> zeroes between the first half of y and the last half of >> y. IDFT the >> new sequence. >> > Thanks John! Do you have any theorey/proof supporting your > methods? >
Think about what I just proposed. By doubling the size of the DFT, I also doubled the size of the IDFT. By placing zeroes in the center of the DFT, I have doubled the number of points in the DFT, while at the same time ***adding no information*** to the spectrum. By extension, then, I have doubled the size of the time series without adding any information to it. Is this not a form of interpolation?
"Vista" <abc@gmai.com> wrote in message 
news:f377lg$gc9$1@news.Stanford.EDU...
> > "John Hadstate" <jh113355@hotmail.com> wrote in message > news:1180094910.608568.259980@q75g2000hsh.googlegroups.com... >>> >>> How about decimating {x} by a downsampling rate of 2? >> >> Divide y into 4 equal pieces (each having n/4 samples). >> Throw away >> the middle two pieces. IDFT the new sequence. >> > > > Thanks John! Do you have any theorey/proof supporting your > methods? >
This situation is not as straightforward. You must recognize that in order to decimate (x) without loss of information, (x) must contain no information at or above the Nyquist frequency ***at the decimated (lower) rate***. Consequently, discarding all spectral components from the middle half of (y) is an implicit statement that the original (x) was over-sampled by at least a factor of two. One wonders about the wisdom of decimating this way. Surely it is cheaper to extract every other sample from (x) than it is to DFT(x), fumble around with (y), and then IDFT the result. However, don't expect to get the same decimated values for (x). Both methods will produce a legitimate decimation (as would averaging pairs of samples) but they are not equivalent.