Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > Linear interpolation in vhdl

Reply
Thread Tools

Linear interpolation in vhdl

 
 
df84077@gmail.com
Guest
Posts: n/a
 
      08-21-2005
Hi,

I am looking for some insight on impelementing a linear interpolation
algorithm in vhdl.

thanks in advance

Dima

 
Reply With Quote
 
 
 
 
Carson
Guest
Posts: n/a
 
      08-21-2005
Hi Dima,

A 2 point interpolation is given by:

x = lambda * x_0 + (1 - lambda) * x_1 where lambda is between 0 to
1

Therefore the value of x is between x_0 and x_1

Directly implementing the above equation requires 2 multipliers and
2 adders (1 for x_0 and 1 for x_1). Rewriting the above equation,

x = lambda* (x_0 - x_1) + x_1.

so it now only uses 1 multiplier and 2 adders.

Please comment.

Thanks,

Carson

 
Reply With Quote
 
 
 
 
df84077@gmail.com
Guest
Posts: n/a
 
      08-21-2005
Well that is kind of what I was thinking, except I belive I also need
to implement a divider to calculate lambda.

lambda = (y - y_0) / (y_1 - y_0)

 
Reply With Quote
 
Lawrence Wilkinson
Guest
Posts: n/a
 
      08-21-2005
On Sun, 21 Aug 2005 14:11:02 -0700, df84077 wrote:

> Well that is kind of what I was thinking, except I belive I also need
> to implement a divider to calculate lambda.
>
> lambda = (y - y_0) / (y_1 - y_0)


You could try searching for line-drawing algorithms (e.g. Bresenham) since
their basic function is to calculate interpolated coordinates. There are
probably algorithms which can calculate a given point without having to
calculate all the preceding values (maybe log2(N) values?).

LJW

 
Reply With Quote
 
df84077@gmail.com
Guest
Posts: n/a
 
      08-22-2005
Lawrence,

Thanks a lot for your help. I took a look at Bresenham's alrgorithm
and I am not sure if it will work (or how to modify it) for my
application.

Basically I have several A to D converters connected to an fpga
sampling at ~100 kHz. I am timestamping ADC data(32 bit counter running
from a 50 Mhz system clock) and need to be able to do linear
interpolation to obtain A/D values between sampling events. If
anybody has any suggestions on the best way to approach this I would
appreciate it.

 
Reply With Quote
 
Andrew FPGA
Guest
Posts: n/a
 
      08-22-2005
Hi Dima,
What are you really trying to do? Why are you wanting to linearly
interpolate? Do you really need to know the "A/D value" at arbitrary
times between A/D sampling events?

If you just want to know "A/D" values midway between sampling events
then interpolation will get you there. Insert zeros between samples and
then low pass filter. Actually you can insert any number of zeros
between A/D samples to get whatever sampling rate you want(well, an
integer mulitiple of the original sampling rate).

http://www.dspguru.com/info/faqs/multrate/interp.htm

Regards
Andrew

 
Reply With Quote
 
df84077@gmail.com
Guest
Posts: n/a
 
      08-22-2005
Thanks for your help guys. I didn't realize this right away, but the
A/D that I am using actually samples at a constant rate which is known.
So I can just precalculate the 1/(t_1- t_0), which turns the linear
interpolation into a couple of multiplications and an addition.

Thanks,

Dima

 
Reply With Quote
 
Carson
Guest
Posts: n/a
 
      08-24-2005
Hi Dima,

What you in DSP is called interpolation. If you have accessed to
IEEE filter, try to locate a paper call Farrow structure, it is an
efficient implementation for the interpolation (using first order,
second order, or higher)

As for the "lambda" term, I guess you have already figured out. But
you may also consider to use a huge counter (the larger the bits, the
higher the resolution) to count the relative position. (you can use the
remainder as the lambda)

Your project really interests me, I am quite familiar with these
interpolation tricks using digital filters interpolation. Let me know a
bit more detail and maybe I can help.

Carson

 
Reply With Quote
 
Researcher_123 Researcher_123 is offline
Junior Member
Join Date: Oct 2011
Posts: 1
 
      10-07-2011
Hi,

I am new to this domain and want to know any simplest interpolation implementation guides for VHDL ,

I want to test a number of algorithms to get a good feel of how interpolation differs. I understand that zero stuffing and LPF are required , where an LPF is an FIR filter in hardware for the bandlimited signals. But how does this implementation effects this sample approximation is confusing.

Please comment.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Interpolation in VHDL scottpops VHDL 0 07-10-2009 02:19 PM
std::map, linear interpolation Hicham Mouline C++ 2 02-04-2008 03:36 PM
Linear interpolation for image upscaling martin.wahlstedt VHDL 0 03-29-2007 12:53 PM
Code for linear congruences, diophantine linear equations alessandra_cabrini@virgilio.it Java 1 11-15-2005 12:23 PM
3D linear interpolation Cary Robins Java 1 02-04-2004 08:41 AM



Advertisments