FPGA Central - World's 1st FPGA / CPLD Portal

FPGA Central

World's 1st FPGA Portal

 

Go Back   FPGA Groups > NewsGroup > DSP

DSP comp.dsp newsgroup, mailing list

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-25-2004, 11:31 PM
sammy davis jr.
Guest
 
Posts: n/a
Default streaming resampled buffers seamlessly

Hi guys,

this problem is driving me nuts over here.

I'm working on a streaming resampling method that resamples buffers in
sequence, when i reach the end of an input buffer i zeropad it (enough
for the anti-alisaing filter), generate the output buffer, and i'm done.

the problem is that those last zero-samples at the end of my input
buffer skew the last two samples of my output buffer (resampled)

so if i'm pumping buffers of sinewaves @ 440Hz ...there is a click on
the buffer boundaries where the last sample is interpolated with the
zeropadded samples instead of the next buffer coming in (that I have no
knowledge of yet)

i know there must be a way to smooth out these boundary clicks ...
does anyone have any ideas on how to go about this ??

thanks!!!
sdj

Reply With Quote
  #2 (permalink)  
Old 02-26-2004, 02:51 AM
Jon Harris
Guest
 
Posts: n/a
Default Re: streaming resampled buffers seamlessly

As you realize, you really want to use data from the next buffer, rather
than zeros. One simple way is to store 2 buffers of data before starting
your work. Then you will know what is in the next buffer. Of course, this
also introduces an additional processing latency based on the buffer length.

If that is not acceptable, then how about this. Conceptually, zero pad the
beginning of the first buffer with enough zeros for your filter. Then save
off an equal number of samples from the end of the first buffer for later
use. Now process the block up to but not including the samples from the end
you saved off. When the next buffer arrives, insert the saved samples from
the previous buffer at the beginning, save off an equal number from the end,
and run your filter. Repeat.

With this method, the extra latency will only be based on the size of your
filter rather than the whole block, so it should be better. I don't think
there is any way to do better than this in a real-time casual system.

"sammy davis jr." <[email protected]> wrote in message
news:Tm9%b.15137$[email protected] ..
> Hi guys,
>
> this problem is driving me nuts over here.
>
> I'm working on a streaming resampling method that resamples buffers in
> sequence, when i reach the end of an input buffer i zeropad it (enough
> for the anti-alisaing filter), generate the output buffer, and i'm done.
>
> the problem is that those last zero-samples at the end of my input
> buffer skew the last two samples of my output buffer (resampled)
>
> so if i'm pumping buffers of sinewaves @ 440Hz ...there is a click on
> the buffer boundaries where the last sample is interpolated with the
> zeropadded samples instead of the next buffer coming in (that I have no
> knowledge of yet)
>
> i know there must be a way to smooth out these boundary clicks ...
> does anyone have any ideas on how to go about this ??
>
> thanks!!!
> sdj
>



Reply With Quote
  #3 (permalink)  
Old 02-26-2004, 03:32 PM
Me
Guest
 
Posts: n/a
Default Re: streaming resampled buffers seamlessly

Also, check that no state information within the filter is being lost when
you set up to filter the next block (pointers, prev states etc.).

Jim Adamthwaite
Reply With Quote
  #4 (permalink)  
Old 02-27-2004, 12:41 AM
Ronald H. Nicholson Jr.
Guest
 
Posts: n/a
Default Re: streaming resampled buffers seamlessly

In article <Tm9%b.15137$[email protected]>,
sammy davis jr. <[email protected]> wrote:
>I'm working on a streaming resampling method that resamples buffers in
>sequence, when i reach the end of an input buffer i zeropad it (enough
>for the anti-alisaing filter), generate the output buffer, and i'm done.
>
>the problem is that those last zero-samples at the end of my input
>buffer skew the last two samples of my output buffer (resampled)
>
>so if i'm pumping buffers of sinewaves @ 440Hz ...there is a click on
>the buffer boundaries where the last sample is interpolated with the
>zeropadded samples instead of the next buffer coming in (that I have no
>knowledge of yet)
>
>i know there must be a way to smooth out these boundary clicks ...
>does anyone have any ideas on how to go about this ??


The usual answer is to use data from the previous and following buffers,
instead of zero padding.

But if that isn't possible, wouldn't the interpolations errors at the
ends of each buffer be reduced by using something better than zeros for
the padding? Repeating the end-point value, or mirroring the data around
the boundry are a couple methods I've heard of. But if the waveform is
polynomial smooth, perhaps filling past the ends of the actual data using
extrapolation by the method of finite differences instead of zero padding,
and before the resampling interpolation, would produce even less transition
boundry errors.

Perhaps essentially zero error if the signal was "close enough" (say
a difference beneath the system noise level) to a sufficiently bounded
degree of polynomial.


IMHO. YMMV.
--
Ron Nicholson rhn AT nicholson DOT com http://www.nicholson.com/rhn/
#include <canonical.disclaimer> // only my own opinions, etc.

Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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 On


Similar Threads
Thread Thread Starter Forum Replies Last Post
AURORA streaming HAIR-WAN FPGA 0 07-16-2008 01:01 PM
Streaming data to memory... Marwan Verilog 3 02-24-2007 08:37 PM
USB 2.0 Streaming using FPGAs billu FPGA 18 02-01-2007 12:44 PM
XilNet server data streaming problem from PPC Johan Bernspång FPGA 4 01-28-2006 06:13 AM
GSM AMR Audio Streaming xi xong DSP 0 09-12-2003 09:19 AM


All times are GMT +1. The time now is 02:15 AM.


Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
Copyright 2008 @ FPGA Central. All rights reserved