DSPRelated.com
Forums

Help me to understant sampling theory, decimation by integer factor

Started by hyjeon_0_o February 22, 2008
Hi, everyone!


   I read "decimation  by integer" and "interpolation by integer factors"
in a DSP book. 
   I'm just wondering why integer factor to downsampling...

Sometimes, to resample signal by rational factor, people use conversion
oversampling(integer factor) -> low-passfilter -> downsampling(also
integer factor). (This means "Sampling rate conversion by non-integer
factors")

However, why do they use the "integer factor" above all the steps?

Please, explain "by integer factor" to me.




Thank you for reading...

Good Luck To You!!




For practical reasons, one may resample a digital signal by a rational
factor. If the input sample rate is Fs, the output sample rate is (M/
N) * Fs where M and N are integers. The definition of a rational
number is any number that can be expressed as (M/N) where M, N are
members of Z.

It is possible to resample a digital signal by an irrational factor,
i.e, output sample rate = alpha * Fs, where alpha is an irrational
number. But this requires sample-to-sample interpolation rather than
the simpler upsample by M, lowpass filter, downsample by N.

-V

On Feb 22, 5:11 am, "hyjeon_0_o" <fantaj...@cnu.ac.kr> wrote:
> Hi, everyone! > > I read "decimation by integer" and "interpolation by integer factors" > in a DSP book. > I'm just wondering why integer factor to downsampling... > > Sometimes, to resample signal by rational factor, people use conversion > oversampling(integer factor) -> low-passfilter -> downsampling(also > integer factor). (This means "Sampling rate conversion by non-integer > factors") > > However, why do they use the "integer factor" above all the steps?
If you don't have an integer resampling ratio, then each new sample step is unlikely to end up at or near enough to the same fractional offset as any previous new sample. With integer resampling factors, the fractional offset of the new samples to the original samples will repeat, thus allowing one to repeatedly reuse a finite and smaller set of interpolation filter coefficients. If you don't mind recalculating your interpolation filter coefficients every sample (or pre-calculating a large enough table), then you don't need to resample using only integer ratios. IMHO. YMMV. -- rhn A.T nicholson d.0.t C-o-M
On Fri, 22 Feb 2008 07:11:04 -0600, "hyjeon_0_o" <fantajeon@cnu.ac.kr>
wrote:

>Hi, everyone! > > > I read "decimation by integer" and "interpolation by integer factors" >in a DSP book. > I'm just wondering why integer factor to downsampling... > >Sometimes, to resample signal by rational factor, people use conversion >oversampling(integer factor) -> low-passfilter -> downsampling(also >integer factor). (This means "Sampling rate conversion by non-integer >factors") > >However, why do they use the "integer factor" above all the steps? > >Please, explain "by integer factor" to me. >Thank you for reading... >Good Luck To You!!
Hi hyjeon_0_o, Thats' because in any *individual* upsampling (interpolation) or downsampling (decimation) operation the upsampling factor or downsampling factor must be by an integer. There is no such thing as a fraction of a sample. [-Rick-]
Rick Lyons wrote:
> On Fri, 22 Feb 2008 07:11:04 -0600, "hyjeon_0_o" <fantajeon@cnu.ac.kr> > wrote: > >> Hi, everyone! >> >> >> I read "decimation by integer" and "interpolation by integer factors" >> in a DSP book. >> I'm just wondering why integer factor to downsampling... >> >> Sometimes, to resample signal by rational factor, people use conversion >> oversampling(integer factor) -> low-passfilter -> downsampling(also >> integer factor). (This means "Sampling rate conversion by non-integer >> factors") >> >> However, why do they use the "integer factor" above all the steps? >> >> Please, explain "by integer factor" to me. >> Thank you for reading... >> Good Luck To You!! > > Hi hyjeon_0_o, > > Thats' because in any *individual* > upsampling (interpolation) or downsampling > (decimation) operation the upsampling factor > or downsampling factor must be by an integer. > There is no such thing as a fraction of a sample. > > [-Rick-]
Hi Rick, No, but you can find intermediate samples using a polyphase filter bank. Regards, John
On Feb 23, 5:30 pm, Rick Lyons <R.Lyons@_BOGUS_ieee.org> wrote:
> On Fri, 22 Feb 2008 07:11:04 -0600, "hyjeon_0_o" <fantaj...@cnu.ac.kr> > wrote: > >Hi, everyone! > > > I read "decimation by integer" and "interpolation by integer factors" > >in a DSP book. > > I'm just wondering why integer factor to downsampling... > > >Sometimes, to resample signal by rational factor, people use conversion > >oversampling(integer factor) -> low-passfilter -> downsampling(also > >integer factor). (This means "Sampling rate conversion by non-integer > >factors") > > >However, why do they use the "integer factor" above all the steps? > > >Please, explain "by integer factor" to me. > >Thank you for reading... > >Good Luck To You!! > > Hi hyjeon_0_o, > > Thats' because in any *individual* > upsampling (interpolation) or downsampling > (decimation) operation the upsampling factor > or downsampling factor must be by an integer. > There is no such thing as a fraction of a sample.
No, but one can interpolate any intermediate value between samples. It's just that computing the interpolation kernel coefficients has costs; and integer ratios will repeat, thus allowing reuse of a finite set of those coefficients. All the polyphase resampling stuff is just a optimization method to precompute interpolation coefficient sets and store them in an addressable table. If you (re)compute a simply windowed Sinc interpolation kernel on the fly (e.g. for every sample), you can resample by arbitrary and even irrational ratios (as close as can be approximated in floating point). I have one such algorithm on my dsp web page/blog: http://www.nicholson.com/rhn/dsp.html IMHO. YMMV. -- rhn A.T nicholson d.0.t C-o-M
On Sun, 24 Feb 2008 01:30:42 GMT, Rick Lyons <R.Lyons@_BOGUS_ieee.org>
wrote:

>On Fri, 22 Feb 2008 07:11:04 -0600, "hyjeon_0_o" <fantajeon@cnu.ac.kr> >wrote: > >>Hi, everyone! >> >> >> I read "decimation by integer" and "interpolation by integer factors" >>in a DSP book. >> I'm just wondering why integer factor to downsampling... >> >>Sometimes, to resample signal by rational factor, people use conversion >>oversampling(integer factor) -> low-passfilter -> downsampling(also >>integer factor). (This means "Sampling rate conversion by non-integer >>factors") >> >>However, why do they use the "integer factor" above all the steps? >> >>Please, explain "by integer factor" to me. >>Thank you for reading... >>Good Luck To You!! > >Hi hyjeon_0_o, > > Thats' because in any *individual* >upsampling (interpolation) or downsampling >(decimation) operation the upsampling factor >or downsampling factor must be by an integer. >There is no such thing as a fraction of a sample.
There must be some fancy context hidden behind that ["individual"] exception because fractional interpolation/decimation is definitely possible. Basically given a suitably sampled signal, you recover the original analog waveform and resample it at any fractional location between two samples [except that you don't actually have to recover the original waveform to get there].
On Sun, 24 Feb 2008 08:12:37 GMT, mk <kal*@dspia.*comdelete> wrote:

>On Sun, 24 Feb 2008 01:30:42 GMT, Rick Lyons <R.Lyons@_BOGUS_ieee.org> >wrote: > >>On Fri, 22 Feb 2008 07:11:04 -0600, "hyjeon_0_o" <fantajeon@cnu.ac.kr> >>wrote: >> >>>Hi, everyone! >>> >>> >>> I read "decimation by integer" and "interpolation by integer factors" >>>in a DSP book. >>> I'm just wondering why integer factor to downsampling... >>> >>>Sometimes, to resample signal by rational factor, people use conversion >>>oversampling(integer factor) -> low-passfilter -> downsampling(also >>>integer factor). (This means "Sampling rate conversion by non-integer >>>factors") >>> >>>However, why do they use the "integer factor" above all the steps? >>> >>>Please, explain "by integer factor" to me. >>>Thank you for reading... >>>Good Luck To You!! >> >>Hi hyjeon_0_o, >> >> Thats' because in any *individual* >>upsampling (interpolation) or downsampling >>(decimation) operation the upsampling factor >>or downsampling factor must be by an integer. >>There is no such thing as a fraction of a sample. > >There must be some fancy context hidden behind that ["individual"] >exception because fractional interpolation/decimation is definitely >possible. Basically given a suitably sampled signal, you recover the >original analog waveform and resample it at any fractional location >between two samples [except that you don't actually have to recover >the original waveform to get there].
Hi mk, You bet! I emphasized "individual" because hyjeon_0_o asked: "However, why do they use the "integer factor" above all the steps?" If I understand that question, it seems that hyjeon_0_o was asking, "When we increase a sample rate, or decrease a sample rate, why must that single (individual) sample rate change by by an integer factor." [-Rick-]