Reply by turboii September 28, 20092009-09-28
thanks for the help.  I think i will end up designing a new filter for
250kHz after all and try to get as close as possible to the filter i am
trying model.  I tried interpolation the filter's coefficients, but all it
caused was mirroring at +/-62.5 kHz, just like when i decimated the input
stream
Reply by Jerry Avins September 23, 20092009-09-23
Martin Eisenberg wrote:
> Tim Wescott wrote: >> On Tue, 22 Sep 2009 16:11:40 -0500, turboii wrote: > >>> so to double the smapling rate, i would simply double the >>> number of taps and interpolate between each coefficient? so >>> for example, if my taps were: >>> [3, 5, 10, 10, 5, 3] >>> and i just used linear interpolation, the new coefficients >>> would be: [3, 4, 5, 7.5, 10, 10, 10, 7.5, 5, 4, 3] >>> >>> is that correct? >> Yes. > > Actually, you'd have to interpolate from the end values to the > notional zeros beyond as well because linear interpolation is > convolution with a triangle function. In general, any interpolator > will lengthen the new impulse response. > > Also note that interpolation does the job only if the original filter > is lowpass. To extend a nonzero response at old Nyquist over the new > bandwidth, you'll need to redesign a filter for the new rate.
This makes me impatient. "I don't know in detail what this filter does, what specifications it was designed to meet, but I want to double the sample rate." That's possible, and necessary in some rare circumstances, but wasteful in general. A newly designed filter would likely meet the design desiderata more closely and use fewer taps than one doubled by formula. The difficulty is that the filter's optimum function needs to be found from documentation unlikely to exist, or deduced from its purpose in the design. That requires thought, an activity to be avoided whenever possible. Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
Reply by Martin Eisenberg September 23, 20092009-09-23
Tim Wescott wrote:
> On Tue, 22 Sep 2009 16:11:40 -0500, turboii wrote:
>> so to double the smapling rate, i would simply double the >> number of taps and interpolate between each coefficient? so >> for example, if my taps were: >> [3, 5, 10, 10, 5, 3] >> and i just used linear interpolation, the new coefficients >> would be: [3, 4, 5, 7.5, 10, 10, 10, 7.5, 5, 4, 3] >> >> is that correct? > > Yes.
Actually, you'd have to interpolate from the end values to the notional zeros beyond as well because linear interpolation is convolution with a triangle function. In general, any interpolator will lengthen the new impulse response. Also note that interpolation does the job only if the original filter is lowpass. To extend a nonzero response at old Nyquist over the new bandwidth, you'll need to redesign a filter for the new rate. Martin -- Quidquid latine scriptum est, altum videtur.
Reply by Michael Plante September 23, 20092009-09-23
>On Tue, 22 Sep 2009 16:11:40 -0500, turboii wrote: > > >>>> if i run the filter as is (at 250kS/s), the spectrum of the filter
is
>>>> stretched by 2. Is there an easy way to modify the filter taps to >> change >>>> the filter's sampling rate? >>> >>>A dull bruteforce solution is increase the number of taps by the
factor
>>>of 2 by sinc interpolation. The better way is usung two stages: one is >>>the legacy filter, the other is the filter to upsample the result by
the
>> >>>factor of 2. >>> >>> >> so to double the smapling rate, i would simply double the number of
taps
>> and interpolate between each coefficient? so for example, if my taps >> were: >> [3, 5, 10, 10, 5, 3] >> and i just used linear interpolation, the new coefficients would be: >> [3, 4, 5, 7.5, 10, 10, 10, 7.5, 5, 4, 3] >> >> is that correct? > >Yes.
At the risk of pointing out the obvious, that's one short of doubled in length...
Reply by Randy Yates September 22, 20092009-09-22
"turboii" <gtu89rx7@yahoo.com> writes:
> [...] > what is the advantage by using a sinc interpolator?
A more accurate frequency response. Model the interpolation as a convolution of the interpolating function (linear, sinc) with the upsampled coefficients. Convolution in time ==> multiplication in frequency, and the sinc interpolator has a rectangular frequency response. -- Randy Yates % "I met someone who looks alot like you, Digital Signal Labs % she does the things you do, mailto://yates@ieee.org % but she is an IBM." http://www.digitalsignallabs.com % 'Yours Truly, 2095', *Time*, ELO
Reply by Tim Wescott September 22, 20092009-09-22
On Tue, 22 Sep 2009 16:11:40 -0500, turboii wrote:


>>> if i run the filter as is (at 250kS/s), the spectrum of the filter is >>> stretched by 2. Is there an easy way to modify the filter taps to > change >>> the filter's sampling rate? >> >>A dull bruteforce solution is increase the number of taps by the factor >>of 2 by sinc interpolation. The better way is usung two stages: one is >>the legacy filter, the other is the filter to upsample the result by the > >>factor of 2. >> >> >>Vladimir Vassilevsky >>DSP and Mixed Signal Design Consultant http://www.abvolt.com >> >> > so to double the smapling rate, i would simply double the number of taps > and interpolate between each coefficient? so for example, if my taps > were: > [3, 5, 10, 10, 5, 3] > and i just used linear interpolation, the new coefficients would be: [3, > 4, 5, 7.5, 10, 10, 10, 7.5, 5, 4, 3] > > is that correct?
Yes.
> what is the advantage by using a sinc interpolator?
For most filters, better performance because the sinc interpolator does a better job of retaining the frequency-domain characteristics of the filter. -- www.wescottdesign.com
Reply by turboii September 22, 20092009-09-22
> >> if i run the filter as is (at 250kS/s), the spectrum of the filter is >> stretched by 2. Is there an easy way to modify the filter taps to
change
>> the filter's sampling rate? > >A dull bruteforce solution is increase the number of taps by the factor >of 2 by sinc interpolation. The better way is usung two stages: one is >the legacy filter, the other is the filter to upsample the result by the
>factor of 2. > > >Vladimir Vassilevsky >DSP and Mixed Signal Design Consultant >http://www.abvolt.com >
so to double the smapling rate, i would simply double the number of taps and interpolate between each coefficient? so for example, if my taps were: [3, 5, 10, 10, 5, 3] and i just used linear interpolation, the new coefficients would be: [3, 4, 5, 7.5, 10, 10, 10, 7.5, 5, 4, 3] is that correct? what is the advantage by using a sinc interpolator?
Reply by Vladimir Vassilevsky September 22, 20092009-09-22

turboii wrote:

> I need to implement a particular filter that has 240 taps and it > works/designed for a sampling rate of 125kHz.
What is the purpose of this filter? Usually, a FIR filter with more then few dozens of taps indicates a lousy design. The task could be accomplished in more optimal way.
> I want to change the sampling rate of the filter from 125kS/s to 250kS/s > to match the the hardware I am using, which operates at 250kS/s
So the length is going to be 480 taps. Incredible.
> if i run the filter as is (at 250kS/s), the spectrum of the filter is > stretched by 2. Is there an easy way to modify the filter taps to change > the filter's sampling rate?
A dull bruteforce solution is increase the number of taps by the factor of 2 by sinc interpolation. The better way is usung two stages: one is the legacy filter, the other is the filter to upsample the result by the factor of 2. Vladimir Vassilevsky DSP and Mixed Signal Design Consultant http://www.abvolt.com
Reply by turboii September 22, 20092009-09-22
I need to implement a particular filter that has 240 taps and it
works/designed for a sampling rate of 125kHz.

I want to change the sampling rate of the filter from 125kS/s to 250kS/s
to match the the hardware I am using, which operates at 250kS/s

if i run the filter as is (at 250kS/s), the spectrum of the filter is
stretched by 2.  Is there an easy way to modify the filter taps to change
the filter's sampling rate?