Sign in

username or email:

password:



Not a member?
Forgot your password?

Search compdsp



Search tips


Discussion Groups

Free Online Books

See Also

Embedded SystemsFPGA

Discussion Groups | Comp.DSP | Resampling in stages?

There are 8 messages in this thread.

You are currently looking at messages 1 to .


Is this discussion worth a thumbs up?

0

Resampling in stages? - 2012-07-19 09:00:00

Is there a reason (founded in DSP theory) to resample in stages instead of going directly
from one sample rate to another? If so what is the reason? And where can I read about it?

For example: When I resample from 8kHz to 48kHz the resulting audio sounds worse compared to the
audio I get if I resample in stages from 8kHz to 24kHz to 48kHz.

Thanks
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: Resampling in stages? - mnentwig - 2012-07-19 10:12:00



Yes, it's more efficient, if you measure by the number of multiplications
it takes.

Intuitively, the impulse response of a direct filter at the high rate looks
very regular. One might wonder, whether this could be computed more
efficiently. 
A multi-stage filter does just that. Designed properly, it achieves a
similar (but not exactly the same) impulse response that can be computed
using shared expressions for adjacent output samples. 

I wrote a design example on the topic here in my blog:
http://www.dsprelated.com/showarticle/156.php

In this particular case, use of multiple stages reduces the computational
load to 12 % (in other words, 88 % are avoided). And it could be improved
further by changing the final stage to CIC or the like.
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: Resampling in stages? - ChrisDSP - 2012-07-19 10:36:00

> Yes, it's more efficient, if you measure by the number of multiplications
> it takes.

Thank you...However...I was more curious about whether or not there is a reason (founded in DSP
theory) why I achieve better audio quality when I resample from 8 -> 24 -> 48 instead of
directly from 8 --> 48 ?? 

My guess is that when you filter in stages you get better stop band suppression, but i'm not
sure if that's correct.
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: Resampling in stages? - mnentwig - 2012-07-19 11:07:00

>Thank you...However...I was more curious about whether or not there is a
reason (founded in DSP theory) why I achieve better audio quality when I
resample from 8 -> 24 -> 48 instead of directly from 8 --> 48 ?? 

I think you'll find the reason in your implementation, not DSP theory.

______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: Resampling in stages? - kaz - 2012-07-19 11:12:00

>
>> Yes, it's more efficient, if you measure by the number of
multiplications
>> it takes.
>
>Thank you...However...I was more curious about whether or not there is a
reason (founded in DSP theory) why I achieve better audio quality when I
resample from 8 -> 24 -> 48 instead of directly from 8 --> 48 ?? 
>
>My guess is that when you filter in stages you get better stop band
suppression, but i'm not sure if that's correct.
>

Whether it is one stage or cascaded stages, the final output depends on
your filtering quality that you choose. In all cases ideal interpolation is
not possible as it requires +/- infinite samples(an obvious mathematical
fiction).

breaking up into multistage may help implementation resource.

kadhiem
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: Resampling in stages? - Tim Wescott - 2012-07-19 15:00:00

On Thu, 19 Jul 2012 06:00:17 -0700, dspchris2012 wrote:

> Is there a reason (founded in DSP theory) to resample in stages instead
> of going directly from one sample rate to another? If so what is the
> reason? And where can I read about it?

As pointed out, it is computationally more efficient.

> For example: When I resample from 8kHz to 48kHz the resulting audio
> sounds worse compared to the audio I get if I resample in stages from
> 8kHz to 24kHz to 48kHz.

I can't think of a single reason why decimating in stages should preserve 
the signal any better than decimating in one thump.  If anything, 
decimating in stages should result in a more complicated spectrum to your 
decimated result, with more aliasing products running around and causing 
more trouble.

So I rather expect that you're not decimating correctly, and something 
about doing it in stages is masking the problem to some extent.

-- 
My liberal friends think I'm a conservative kook.
My conservative friends think I'm a liberal kook.
Why am I not happy that they have found common ground?

Tim Wescott, Communications, Control, Circuits & Software
http://www.wescottdesign.com
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: Resampling in stages? - ChrisDSP - 2012-07-19 15:20:00

>I can't think of a single reason why decimating in stages should preserve 
>the signal any better than decimating in one thump.  If anything, 
>decimating in stages should result in a more complicated spectrum to your 
>decimated result, with more aliasing products running around and causing 
>more trouble. 

We're not talking about decimation. We are talking about upsampling and interpolation, i.e.:

METHOD #1

1. Upsample by 3
2. Low-pass filter
3. Upsample by 2
4. Low-pass filter

versus

METHOD #2

1. Upsample by 6
2. Low-pass filter

My simulations show that there is more noise in the stop band with method #2 than with method
#1

I am using 4 cascaded 2nd order IIR filters (direct form 2 transposed).

______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: Resampling in stages? - Tim Wescott - 2012-07-19 16:43:00

On Thu, 19 Jul 2012 12:20:09 -0700, ChrisDSP wrote:

>>I can't think of a single reason why decimating in stages should
>>preserve the signal any better than decimating in one thump.  If
>>anything, decimating in stages should result in a more complicated
>>spectrum to your decimated result, with more aliasing products running
>>around and causing more trouble.
> 
> We're not talking about decimation. We are talking about upsampling and
> interpolation, i.e.:
> 
> METHOD #1
> 
> 1. Upsample by 3
> 2. Low-pass filter
> 3. Upsample by 2
> 4. Low-pass filter
> 
> versus
> 
> METHOD #2
> 
> 1. Upsample by 6
> 2. Low-pass filter

D'oh.  I missed that.

> My simulations show that there is more noise in the stop band with
> method #2 than with method #1
> 
> I am using 4 cascaded 2nd order IIR filters (direct form 2 transposed).

If you are restricting yourself to four 2nd-order filters per upsample 
stage, then when you upsample in two stages you have the benefit of eight 
poles of filtering, where you only have four in the single-stage case.

If that's the case, then the extra filtering you have available in the 
two-stage case may, indeed, be making all the difference in the world.

-- 
My liberal friends think I'm a conservative kook.
My conservative friends think I'm a liberal kook.
Why am I not happy that they have found common ground?

Tim Wescott, Communications, Control, Circuits & Software
http://www.wescottdesign.com
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.