# easy resampling bandwith question ...

Started by June 25, 2003
```hi all,

let's say i want to resample to 4/5 the input samplerate, i.e.
interpolate 4X then decimate 5X. for both steps lowpass filters need to
be designed. according to dspguru.com, it is sufficient  to

1. determine cutoff freq. for the interp. filter
2. determine cutoff freq. for the decim. filter
3. choose the lower of the 2 cutoff freqs to design *one* resampling FIR
filter.

so my question is if the decimation rate is greater than 1, wouldn't you
always choose decimation filter to be the resampling filter ?

and if the decimation rate is 1 and the interp. rate > 1, wouldn't the
lowpass filter cutoff be just the inputrate/2 ?

by that reasoning if i resample to 4/5 my input sample rate, which is
30kHz with the highest freq ~ 14kHz, that means that after resampling
the bandwidth of my signal at the output samplerate will be 0-3kHz

i.e. the 5X decimation reduces my workable bandwith by(1/5) (0-6kHz)
which is then halved to assure there is no aliasing ..

thanks ....

a bit muddled
sammy

```
```"sammy davis jr." <sdj@ratpackproductions.com> wrote in message
news:3EF9CF10.50505@ratpackproductions.com...
> hi all,
>
> let's say i want to resample to 4/5 the input samplerate, i.e.
> interpolate 4X then decimate 5X. for both steps lowpass filters need to
> be designed. according to dspguru.com, it is sufficient  to
>
> 1. determine cutoff freq. for the interp. filter
> 2. determine cutoff freq. for the decim. filter
> 3. choose the lower of the 2 cutoff freqs to design *one* resampling FIR
> filter.
>
> so my question is if the decimation rate is greater than 1, wouldn't you
> always choose decimation filter to be the resampling filter ?
>
> and if the decimation rate is 1 and the interp. rate > 1, wouldn't the
> lowpass filter cutoff be just the inputrate/2 ?
>
> by that reasoning if i resample to 4/5 my input sample rate, which is
> 30kHz with the highest freq ~ 14kHz, that means that after resampling
> the bandwidth of my signal at the output samplerate will be 0-3kHz
>
> i.e. the 5X decimation reduces my workable bandwith by(1/5) (0-6kHz)
> which is then halved to assure there is no aliasing ..

Sammy,

Not quite.  First, it doesn't make sense to talk about decimation factor >1
or an interpolation factor <1 ...  just semantics.  Otherwise,
"interpolation" would be "decimation" and vice versa.

If you are going to decimate to 4/5 the original sample rate of 30kHz, the
sample rate is increased to 120kHz (interpolate by 4) and then decreased to
24kHz (decimate by 5).  If the sample rate is 24kHz, then the bandwidth must
be limited to below 12KHz.  That's the cutoff of the lowpass filter you
need.

If the numbers are really as you state, using 14/15=0.9333 of the available
bandwidth is a bit ambitious.  Something in the order of 0.8 is often the
limit chosen.  Otherwise the filters need to be pretty good / pretty long in
impulse response.  So, this implies a starting bandwidth of 12kHz might be
better for 30kHz sample rate - as a practical matter.

> and if the decimation rate is 1 and the interp. rate > 1, wouldn't the
> lowpass filter cutoff be just the inputrate/2 ?

Yes but you need to be careful about what this means.  This would be pure
interpolation with a rate >1.
Let's say that 3 is the interpolation rate and you start with a bandwidth of
0.4fs.
The sample rate is increased by 3 by zero padding.
The original spectrum now occupies 0.4*fs which is 0.4/3=0.1333 times the
*new* fs.
So, the zero-padded array needs to be filtered to 0.4/3 cutoff frequency
relative to the new fs in order to remove the replications that were

There's another way to look at it if you like:

Start with a sample rate fs and a signal bandwidth of 0.4*fs.
Note that the spectrum is periodic at fs.
Because you want a higher sample rate of 3*fs, look at 3 replications of
this spectrum and consider the "period" to now be 3*fs - the sample rate is
now at 3*fs in this viewpoint.
(This is equivalent to zero-padding in time).
In order to yield the original spectrum, you need to remove all of the
replicated spectral data that's above 0.4*fs and below 3*fs-0.4*fs = 2.6*fs.
So a lowpass filter at 0.4*fs is needed which is 0.13333 of the new "period"
in frequency.

So, yes the filter needs to be below the inputrate/2 *relative to the input
rate* and nees to be below inputrate/2*I where I is the interpolation factor
*relative to the output rate*.  It is generally relative to the output rate
that you design the filter.

I should say that I'm biased.  I think that design is generally easier to
deal with if you work in fractions of the sample rate - as if the sample
interval is normalized to 1 second and the sample rate is 1 sample/second.
So, as you change sample rates, you have to be aware of the change if you're
using this typical convention.  Thus, the bandwidth of filters changes

Fred

```
```sammy davis jr. wrote:
> by that reasoning if i resample to 4/5 my input sample rate, which is
> 30kHz with the highest freq ~ 14kHz, that means that after resampling
> the bandwidth of my signal at the output samplerate will be 0-3kHz
>
> i.e. the 5X decimation reduces my workable bandwith by(1/5) (0-6kHz)
> which is then halved to assure there is no aliasing ..

Candy Man:

I think after L=4 M=5 resampling, your bandwidth would simply be (30
kHz)*(4/5) = 24 kHz.

OUP

```
```"One Usenet Poster" <me@my.computer.org> wrote in message
news:vfjpmbsmusrf10@corp.supernews.com...
> sammy davis jr. wrote:
> > by that reasoning if i resample to 4/5 my input sample rate, which is
> > 30kHz with the highest freq ~ 14kHz, that means that after resampling
> > the bandwidth of my signal at the output samplerate will be 0-3kHz
> >
> > i.e. the 5X decimation reduces my workable bandwith by(1/5) (0-6kHz)
> > which is then halved to assure there is no aliasing ..
>
> Candy Man:
>
> I think after L=4 M=5 resampling, your bandwidth would simply be (30
> kHz)*(4/5) = 24 kHz.

Sample rate = 24
Bandwidth should be = something under 12 like 11.2.

Fred

```
```Fred Marshall wrote:
> "One Usenet Poster" <me@my.computer.org> wrote in message
> news:vfjpmbsmusrf10@corp.supernews.com...
>
>>sammy davis jr. wrote:
>>
>>>by that reasoning if i resample to 4/5 my input sample rate, which is
>>>30kHz with the highest freq ~ 14kHz, that means that after resampling
>>>the bandwidth of my signal at the output samplerate will be 0-3kHz
>>>
>>>i.e. the 5X decimation reduces my workable bandwith by(1/5) (0-6kHz)
>>>which is then halved to assure there is no aliasing ..
>>
>>Candy Man:
>>
>>I think after L=4 M=5 resampling, your bandwidth would simply be (30
>>kHz)*(4/5) = 24 kHz.
>
>
> Sample rate = 24
> Bandwidth should be = something under 12 like 11.2.
>
> Fred

Fred:

Yes, you are correct. Consider the hair split.

If we're being precise, I believe the use of the term "interpolation
rate" and "decimation rate" is not correct. A better term would be "factor".

OUP

```
```"One Usenet Poster" <me@my.computer.org> wrote in message
news:vfjvbkha9d7m61@corp.supernews.com...
> Fred Marshall wrote:
> > "One Usenet Poster" <me@my.computer.org> wrote in message
> > news:vfjpmbsmusrf10@corp.supernews.com...
> >
> >>sammy davis jr. wrote:
> >>
> >>>by that reasoning if i resample to 4/5 my input sample rate, which is
> >>>30kHz with the highest freq ~ 14kHz, that means that after resampling
> >>>the bandwidth of my signal at the output samplerate will be 0-3kHz
> >>>
> >>>i.e. the 5X decimation reduces my workable bandwith by(1/5) (0-6kHz)
> >>>which is then halved to assure there is no aliasing ..
> >>
> >>Candy Man:
> >>
> >>I think after L=4 M=5 resampling, your bandwidth would simply be (30
> >>kHz)*(4/5) = 24 kHz.
> >
> >
> > Sample rate = 24
> > Bandwidth should be = something under 12 like 11.2.
> >
> > Fred
>
> Fred:
>
> Yes, you are correct. Consider the hair split.
>
> If we're being precise, I believe the use of the term "interpolation
> rate" and "decimation rate" is not correct. A better term would be
"factor".

Yep.

```