Interpolation by rational factor

  • Follow


When you interpolate a signal by an integer M you stuff M-1 zero between 
each sample and send the upsampled sequence though a low-pass filter.

What do you do if M is a rational number >1 ???







0
Reply Jens 10/19/2010 2:29:16 AM

Jens <jens@invalidxyzcom> wrote:

>When you interpolate a signal by an integer M you stuff M-1 zero between 
>each sample and send the upsampled sequence though a low-pass filter.
>
>What do you do if M is a rational number >1 ???

Try a Lagrangian interpolator.

There have been about three discussions of this on comp.dsp in the past 
year or so.

Steve
0
Reply spope33 10/19/2010 2:39:21 AM


On 10/18/2010 07:29 PM, Jens wrote:
> When you interpolate a signal by an integer M you stuff M-1 zero between
> each sample and send the upsampled sequence though a low-pass filter.
>
> What do you do if M is a rational number >1 ???

If M = P/Q you stuff P-1 zeros, lowpass filter, then every Qth sample 
from the resulting signal -- whether P > Q or the obverse.

Or you use a polyphase filter.

-- 

Tim Wescott
Wescott Design Services
http://www.wescottdesign.com

Do you need to implement control loops in software?
"Applied Control Theory for Embedded Systems" was written for you.
See details at http://www.wescottdesign.com/actfes/actfes.html
0
Reply Tim 10/19/2010 2:47:30 AM

Tim Wescott <tim@seemywebsite.com> wrote:
> On 10/18/2010 07:29 PM, Jens wrote:
>> When you interpolate a signal by an integer M you stuff M-1 zero between
>> each sample and send the upsampled sequence though a low-pass filter.

>> What do you do if M is a rational number >1 ???
 
> If M = P/Q you stuff P-1 zeros, lowpass filter, then every Qth sample 
> from the resulting signal -- whether P > Q or the obverse.

Sounds good, but does anyone actually do that?

Consider sample rate conversion for digital audio.

I have a CD recorder that will accept different input rates and
convert to 44.1kHz for recording.  I believe it isn't even
synchronous.

Consider digital TV, where the horizontal sampling rate is different
from the screen size * line rate.  Or, even more, for screen lines
and frame rate?  I can almost see doing it per line, but collecting
the pixels in a column and doing the zero stuff/filter/decimate
would take way too long.

-- glen
0
Reply glen 10/19/2010 3:32:06 AM

On 10/18/2010 08:32 PM, glen herrmannsfeldt wrote:
> Tim Wescott<tim@seemywebsite.com>  wrote:
>> On 10/18/2010 07:29 PM, Jens wrote:
>>> When you interpolate a signal by an integer M you stuff M-1 zero between
>>> each sample and send the upsampled sequence though a low-pass filter.
>
>>> What do you do if M is a rational number>1 ???
>
>> If M = P/Q you stuff P-1 zeros, lowpass filter, then every Qth sample
>> from the resulting signal -- whether P>  Q or the obverse.
>
> Sounds good, but does anyone actually do that?
>
> Consider sample rate conversion for digital audio.
>
> I have a CD recorder that will accept different input rates and
> convert to 44.1kHz for recording.  I believe it isn't even
> synchronous.
>
> Consider digital TV, where the horizontal sampling rate is different
> from the screen size * line rate.  Or, even more, for screen lines
> and frame rate?  I can almost see doing it per line, but collecting
> the pixels in a column and doing the zero stuff/filter/decimate
> would take way too long.
>
> -- glen

"Or use a polyphase filter".

-- 

Tim Wescott
Wescott Design Services
http://www.wescottdesign.com

Do you need to implement control loops in software?
"Applied Control Theory for Embedded Systems" was written for you.
See details at http://www.wescottdesign.com/actfes/actfes.html
0
Reply Tim 10/19/2010 6:07:13 AM


glen herrmannsfeldt wrote:
> Tim Wescott <tim@seemywebsite.com> wrote:
> 
>>On 10/18/2010 07:29 PM, Jens wrote:
>>
>>>When you interpolate a signal by an integer M you stuff M-1 zero between
>>>each sample and send the upsampled sequence though a low-pass filter.
> 
> 
>>>What do you do if M is a rational number >1 ???
> 
>  
> 
>>If M = P/Q you stuff P-1 zeros, lowpass filter, then every Qth sample 
>>from the resulting signal -- whether P > Q or the obverse.
> 
> 
> Sounds good, but does anyone actually do that?
> 
> Consider sample rate conversion for digital audio.
> 
> I have a CD recorder that will accept different input rates and
> convert to 44.1kHz for recording.  I believe it isn't even
> synchronous.

Most of inexpensive audio cards work at fixed sample rate which is 
typicaly 48 or 44.1kHz. All of the other sample rates are made by 
interpolation in the driver. That interpolation is fairly crude, 
something like linear between the adjacent samples.

> Consider digital TV, where the horizontal sampling rate is different
> from the screen size * line rate.  Or, even more, for screen lines
> and frame rate?  I can almost see doing it per line, but collecting
> the pixels in a column and doing the zero stuff/filter/decimate
> would take way too long.

Oh, video is the area of really dumb algorithms. They have to be fast, 
and the accuracy isn't important.


Vladimir Vassilevsky
DSP and Mixed Signal Design Consultant
http://www.abvolt.com





0
Reply Vladimir 10/19/2010 9:07:19 AM

On 10/18/2010 11:07 PM, Tim Wescott wrote:

>
> "Or use a polyphase filter".
>

Tim,

I've never thought of a polyphase implementation as anything but a FIR 
filter.  So, one has to know what one has in mind *first*.  Then a 
polyphase implementation might be just the thing because of efficiency.

Did I miss something?

Fred
0
Reply Fred 10/19/2010 10:53:17 AM

"glen herrmannsfeldt" <gah@ugcs.caltech.edu> wrote in message 
news:i9j3fm$4n3$1@news.eternal-september.org...

> Consider digital TV, where the horizontal sampling rate is different
> from the screen size * line rate.  Or, even more, for screen lines
> and frame rate?  I can almost see doing it per line, but collecting
> the pixels in a column and doing the zero stuff/filter/decimate
> would take way too long.

Nope. That's what we do.
Typically I use a fourth, sixth, or eighth-order polyphase filter
for up-conversion. Horizontally, the delay elements are registers.
Vertically they are line delays.

This is all fairly easy to do in an FPGA these days.

For down-conversion I will often use higher-order filters, but
the output pixel rate is lower, so no more hardware is needed.

Usually this can be seperable, so that keeps the hardware simple.
(non-separable filters are not needed for simple zoom).

Pete 


0
Reply Pete 10/19/2010 1:34:49 PM

On 10/19/2010 03:53 AM, Fred Marshall wrote:
> On 10/18/2010 11:07 PM, Tim Wescott wrote:
>
>>
>> "Or use a polyphase filter".
>>
>
> Tim,
>
> I've never thought of a polyphase implementation as anything but a FIR
> filter. So, one has to know what one has in mind *first*. Then a
> polyphase implementation might be just the thing because of efficiency.
>
> Did I miss something?
>
> Fred

I didn't see anything in the OP's post that ruled out an FIR filter. 
I'm pretty sure you could do a polyphase IIR filter (I've posted a 
thumbnail sketch of it here) -- but I haven't actually tried it, because 
I rarely need to do any sample rate conversions beyond simple decimation.

-- 

Tim Wescott
Wescott Design Services
http://www.wescottdesign.com

Do you need to implement control loops in software?
"Applied Control Theory for Embedded Systems" was written for you.
See details at http://www.wescottdesign.com/actfes/actfes.html
0
Reply Tim 10/19/2010 2:54:23 PM

Speaking of interpolation... Recently I fucked up (or had a valuable 
learning experience, if you put it in politically correct way). The 
problem could be stated as the following: estimate the phase of a 
sampled signal using digital PLL. The PLL was locked by adjustment of 
the "secondary" sample rate vs the incoming fixed "primary" sample rate. 
So the interpolation by an arbitrary factor was used. That interpolation 
resulted in the unexpectedly large timing errors; although the rms 
accuracy of the interpolator initially seemed to be adequate. The 
problem is that interpolation error is in fact deterministic rather then 
being the white noise like. That reminds me of quantization noise; may 
be, add some dither to the interpolator timing to break the periodical 
dependencies?


Not very long ago Dale asked me what is the origin of the rule to 
increase the stopband requirements of a filter by N times if you are 
planning to decimate this filter into N subfilters. That's simple: when 
the filter is decimated, its response is aliased. The N times 
requirement corresponds to the worst case. It generally doesn't matter 
if the filter is designed by Parks-McClellan, Windowed or any other method.





Vladimir Vassilevsky
DSP and Mixed Signal Design Consultant
http://www.abvolt.com
0
Reply Vladimir 10/19/2010 4:29:56 PM

On 10/19/2010 09:29 AM, Vladimir Vassilevsky wrote:
>
> ... Recently I fucked up (or had a valuable
> learning experience, if you put it in politically correct way).

I'll try to remember that phrasing the next time I'm standing to bit of 
my work as it smokes throws of pieces and generally turns to slag: "my, 
what a valuable learning experience we're having".

-- 

Tim Wescott
Wescott Design Services
http://www.wescottdesign.com

Do you need to implement control loops in software?
"Applied Control Theory for Embedded Systems" was written for you.
See details at http://www.wescottdesign.com/actfes/actfes.html
0
Reply Tim 10/19/2010 4:47:11 PM

On 10/19/2010 9:47 AM, Tim Wescott wrote:
> On 10/19/2010 09:29 AM, Vladimir Vassilevsky wrote:
>>
>> ... Recently I fucked up (or had a valuable
>> learning experience, if you put it in politically correct way).
>
> I'll try to remember that phrasing the next time I'm standing to bit of
> my work as it smokes throws of pieces and generally turns to slag: "my,
> what a valuable learning experience we're having".
>

When the missile was being demonstrated to a gallery of military folks, 
the missile took off and then either augered in or blew up.

The project manager said:  "and, that General, is why we have testing 
programs"


0
Reply Fred 10/19/2010 8:18:03 PM

On Oct 19, 9:29=A0am, Vladimir Vassilevsky <nos...@nowhere.com> wrote:
> Speaking of interpolation...
> ...
> Not very long ago Dale asked me what is the origin of the rule to
> increase the stopband requirements of a filter by N times if you are
> planning to decimate this filter into N subfilters. That's simple: when
> the filter is decimated, its response is aliased. The N times
> requirement corresponds to the worst case. It generally doesn't matter
> if the filter is designed by Parks-McClellan, Windowed or any other metho=
d.
>
> Vladimir Vassilevsky
> DSP and Mixed Signal Design Consultanthttp://www.abvolt.com

I still find it curious. What I asked Vlad was why -he- was applying
the factor as filter design issue. I've always had customers with
systems engineers who wrote cross-talk specifications that included
the appropriate factor into the system specs before they were put out
for bid.It's a systems issue whether the requirement is worst case or
otherwise depending on the application and it's environment. In some
applications of interpolation the interference might only consist of
noise and the factor would not be N in a signal to noise driven
requirement

Dale B. Dalrymple
0
Reply dbd 10/20/2010 5:03:34 AM

12 Replies
266 Views

(page loaded in 0.374 seconds)

Similiar Articles:








7/22/2012 4:37:12 AM


Reply: