COMPGROUPS.NET | Search | Post Question | Groups | Stream | About | Register

### Interpolation by rational factor

• Email
• 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

See related articles to this posting

```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

```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

```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

```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

```
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.

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

```
 0

```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

```"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

```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

```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.

DSP and Mixed Signal Design Consultant
http://www.abvolt.com
```
 0

```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

```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

```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.
>
> 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

12 Replies
388 Views

Similar Articles

12/19/2013 5:49:25 PM
page loaded in 158353 ms. (0)

Similar Artilces:

How to factor a rational
I'm trying to factor a rational constant (4/3) L in equation 1 so that it looks like equation 2 But I was unable to do so. What would be the correct transformation to do so? \$ cat file6.out Mathematica 5.2 for Students: Microsoft Windows Version Copyright 1988-2005 Wolfram Research, Inc. In[1]:= Out[1]= {stdout} In[2]:= (* Write your mathematica code below *) In[3]:= eq1 = (4/3)*L*A - (4/3)*L*B == a*k*t 4 A L 4 B L Out[3]= ----- - ----- == a k t 3 3 In[4]:= FullForm[eq1] Out[4]//FullForm= > Equal[Plus[Times[Rational[4, 3], A...

Marcel Hendrix wrote: > I have great difficulty understanding why posters cling on > to the stack solution for interpolation. hi marcel, is not only a stack solution for interpolation, is: 1. FACTORED solution to linear interpolation and that imply a better FLEXIBILITY and REUSABILITY. 2. ROUNDED solution for linear interpolation with increased precision: running gforth-0.6.2 with the test program, even for coarse division for [0,1] interval ( 1024): \ factored & rounded ---------------------------------------- : round ( a b -- a+b|a-b) OVER 0> IF + ELSE - THEN ; : >spa...

Looking for a 2D Rational Function Interpolation routine
Anyone? Thanks, Yair ...

Spline Interpolation and cubic interpolation
Hi How many data points does Spline and Cubic interpolation take to calculate a point? for 3rd order polynomial interpolation, it's usually 4 data points (and you're interpolating between the inner two data points). there are many different interpolation polynomials, even for a given order (such as 3). Lagrange interpolation will fit an Nth order polynomial through N+1 adjacent data points, and assuming that N+1 is even and we start counting the data points from "0" to "N", the interpolation is used for the space between data points (N-1)/2 to (N+1)/2. Hermite...

Forth is Factorable --- factoring out DO ... LOOP
I find that Forth is ultimately factorable. It is in fact capable of factoring loops. DO LOOP can be factored away. Here is one way to do that. : GO \ ( xt-stop xt-doer -- ) BEGIN DUP EXECUTE OVER EXECUTE UNTIL 2DROP ; Jason On Aug 20, 1:22=A0am, Jason Damisch <jasondami...@yahoo.com> wrote: > I find that Forth is ultimately factorable. =A0It is in fact capable of > factoring loops. =A0DO LOOP can be factored away. =A0Here is one way to d= o > that. > > : GO > \ ( =A0xt-stop =A0 xt-doer =A0-- =A0) > =A0 =A0BEGIN > =A0 =A0 =A0 DUP EXEC...

Dual factorization equations and factoring
The following post steps through the mathematical underpinnings of a remarkably simple factoring method which relies on dual factorizations. It steps off from the familiar Pell's Equation--with rationals--and through basic algebra proves a viable factoring technique. In rationals starting with Pell's equation: x^2 - Dy^2 = 1 I have proven that (D-1)j^2 + (j+/-1)^2 = (x+y)^2 where j = ((x+Dy) -/+1)/D. Here the +/- indicates that one variation will work so it is an OR and not an AND. Either plus OR minus will give a valid j. It suffices to substitute out j, and simplify, which w...

Factor Analysis: Number of Factors
Hi, I have a very basic question in factor analysis - how many factors to menti= on in nfactor option while running a proc factor I can select how many factors I want to analyze by checking the scree plot = or by help of eigen value (>1), but if I run proc factor with nfactor=3D10= or nfactor=3D50 then loading on factors changes significantly and this eve= n changes the business definition of my factors. Please help me understand how to choose the optimal value of nfactor or if = there is a way by which we derive that value than what is that way Regards, Rajat _______________________...

Factor
Do you guys have an opinion on the Factor language? My own opinion is that Factor is a good language for desktop programming, and Forth is a good language for micro-controller programming. Is discussion of Forth-derived languages appropriate for this forum, or only ANS-Forth? The reason that I ask is that I wouldn't want my post to be considered non-Forth spam. I'm considering writing a book providing a head-to-head comparison of Factor and Forth. This would involve presenting programs written in both Factor and Forth, and compared according to various criteria that are presumably m...

interpolation of angular data (interpolation in a circle)
IDL geniuses, In my specific case, it is not interpolation across the international dateline, but instead interpolation across midnight, but it's the same problem. Can anyone point me to a resource on how this is done properly? Relatedly, I have found myself using a call that looks like: interpolated_data = INTERPOLATE(DATA,INTERPOL(OUTPUT_INDEX, OUTPUT_LOCATION, DATA_LOCATION)) Is it actually necessary to use both INTERPOLATE() and INTERPOL(), or am I doing this wrong? Thanks, --Edward H. On Apr 10, 6:48=A0pm, Ed Hyer <ejh...@gmail.com> wrote: > IDL geniuses, > > In my...