Skip to main content

Topic: Custom FIR Filter Implementation (Read 11326 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
  • tkrieger
  • [*]
  • Banned
Custom FIR Filter Implementation
Is there a way to either alter the coefficients of an existing FIR filter or design a new FIR filter, which can be used to convolve with the raw CD data in real time??  I would be interested in trying a Lanczos filter, which works great with image files- I'm very curious to see if such implementation would also work with audio playback.

Responses are appreciated!!

Todd

  • SebastianG
  • [*][*][*][*][*]
  • Developer
Custom FIR Filter Implementation
Reply #1
Quote
Is there a way to either alter the coefficients of an existing FIR filter or design a new FIR filter, which can be used to convolve with the raw CD data in real time??  I would be interested in trying a Lanczos filter, which works great with image files- I'm very curious to see if such implementation would also work with audio playback.

Responses are appreciated!!

Todd
[a href="index.php?act=findpost&pid=227622"][{POST_SNAPBACK}][/a]


I'm pretty sure it can be done via Foobar2000 - get a CDDA reading plugin and the convolver plugin. The convolver plugin loads a certain impulse response (wave file) and uses it for convolution.

But...
What's your goal ?
Lanczos is AFAIK for interpolation / resampling.
It's probably less useful for audio.
Better do "sinc interpolation"

Funny thing: I'm currently working on a real-time-convolver in Java

bye,
Sebi
  • Last Edit: 20 July, 2004, 05:38:27 PM by SebastianG

  • tkrieger
  • [*]
  • Banned
Custom FIR Filter Implementation
Reply #2
Quote
I'm pretty sure it can be done via Foobar2000 - get a CDDA reading plugin and the convolver plugin. The convolver plugin loads a certain impulse response (wave file) and uses it for convolution.

But...
What's your goal ?
Lanczos is AFAIK for interpolation / resampling.
It's probably less useful for audio.
Better do "sinc interpolation"

Funny thing: I'm currently working on a real-time-convolver in Java

bye,
Sebi
[a href="index.php?act=findpost&pid=227642"][{POST_SNAPBACK}][/a]


I want to replace the classic "windowed sinc" function with the Lanczos3 function.  It has characteristic like "sinc" except it has a faster build-up and decay.  I think it would strike a happy medium between the classic "windowed sinc" (poor time response) and "filter less" implementations (excessive HF modulation).  If Lanczos works with audio as it does with picture images, I think it would closest to restoring the digital signal to its "pre-digitized" state.

So I want to replace the "sinc interpolation" with the "Lanczos3 interpolation."  And I'm pretty sure this is done by modifying the coefficients in the FIR filter.  Either take a customizable "FIR filter" plug-in or change the coefficients in the existing FIR filter in source code with re-compile.

  • Axon
  • [*][*][*][*][*]
  • Members (Donating)
Custom FIR Filter Implementation
Reply #3
Quote
I want to replace the classic "windowed sinc" function with the Lanczos3 function.  It has characteristic like "sinc" except it has a faster build-up and decay.  I think it would strike a happy medium between the classic "windowed sinc" (poor time response) and "filter less" implementations (excessive HF modulation).  If Lanczos works with audio as it does with picture images, I think it would closest to restoring the digital signal to its "pre-digitized" state.

So I want to replace the "sinc interpolation" with the "Lanczos3 interpolation."  And I'm pretty sure this is done by modifying the coefficients in the FIR filter.  Either take a customizable "FIR filter" plug-in or change the coefficients in the existing FIR filter in source code with re-compile.
[a href="index.php?act=findpost&pid=227725"][{POST_SNAPBACK}][/a]


I don't think you can't do this in foobar without either writing your own plugin or modifying somebody else's. What you are proposing to do is a lowpass filter operation, which makes no sense from a playback point of view unless the sample rate is increased as well - but you cannot use the built-in resampler, because it will, in effect, do the lowpass operation for you through its own filtering.

  • SebastianG
  • [*][*][*][*][*]
  • Developer
Custom FIR Filter Implementation
Reply #4
Quote
I want to replace the classic "windowed sinc" function with the Lanczos3 function.  It has characteristic like "sinc" except it has a faster build-up and decay.  I think it would strike a happy medium between the classic "windowed sinc" (poor time response) and "filter less" implementations (excessive HF modulation).  If Lanczos works with audio as it does with picture images, I think it would closest to restoring the digital signal to its "pre-digitized" state.

So I want to replace the "sinc interpolation" with the "Lanczos3 interpolation."  And I'm pretty sure this is done by modifying the coefficients in the FIR filter.  Either take a customizable "FIR filter" plug-in or change the coefficients in the existing FIR filter in source code with re-compile.
[a href="index.php?act=findpost&pid=227725"][{POST_SNAPBACK}][/a]


? what source code ? which implementation ? replace which FIR filter ?
what are you talking about ???

It seems that you've dangerous smattering.
If you don't like how your soundcard does digital-analog-conversion then build your own soundcard.

bye,
Sebi

  • tkrieger
  • [*]
  • Banned
Custom FIR Filter Implementation
Reply #5
I got *really* lucky...  I was looking at the "impulse" files, which come with the "convolver" utility.  The "impulse" is the FIR function convolved with the signal.  It so happens, by luck (and I mean luck) that the "Unitpulse2K" impulse function is a "Lanczos4" (four) function, which is very similar to the "Lanczos3" function I was hoping to use.  So I implemented it in the Foobar2000, and the result is some of the best Redbook playback I've ever heard.

So now, I hope to develop a PC-based CD playback system that implements this FIR function.  From a sonic standpoint, this digital filter should have a decided advantage over systems that use either typical windowed "sinc" functions or the newly-popular "filterless" designs.

You may want to try the Convolver using the Unitpulse2K impulse response.  This is a big step forward in Redbook CD playback, in my humble opinion.

Thanks for the feedback!
Todd

Custom FIR Filter Implementation
Reply #6
Quote
I got *really* lucky...  I was looking at the "impulse" files, which come with the "convolver" utility.  The "impulse" is the FIR function convolved with the signal.  It so happens, by luck (and I mean luck) that the "Unitpulse2K" impulse function is a "Lanczos4" (four) function, which is very similar to the "Lanczos3" function I was hoping to use.  So I implemented it in the Foobar2000, and the result is some of the best Redbook playback I've ever heard.

So now, I hope to develop a PC-based CD playback system that implements this FIR function.  From a sonic standpoint, this digital filter should have a decided advantage over systems that use either typical windowed "sinc" functions or the newly-popular "filterless" designs.

You may want to try the Convolver using the Unitpulse2K impulse response.  This is a big step forward in Redbook CD playback, in my humble opinion.

Thanks for the feedback!
Todd
[a href="index.php?act=findpost&pid=227886"][{POST_SNAPBACK}][/a]

What exactly are you hearing and why?

  • dev0
  • [*][*][*][*][*]
  • Developer
Custom FIR Filter Implementation
Reply #7
Hello and welcome to Hydrogenaudio Forums,
Your post violates Terms of Service point 8:
Quote
8. Any statement about sound quality must be supported by the author responsible for such statements by a double blind listening test demonstrating that he can hear a difference, together with a test sample.
Graphs, non-blind listening tests, subtracting two files and so on are definetely not considered as valid evidences of sound quality.

Hydrogenaudio is supposed to be an objectively minded community that relies on double-blind testing and relevant methods of comparison in discussion about sound quality. The usual "audiophile" speak of non-audio related terms which are completely subjective and open to redefinition on a whim, are useless for any sort of progression in discussion.

This rule is the very core of Hydrogenaudio, so it is very important that you follow it.

Here is a discussion explaining why
http://www.hydrogenaudio.org/forums/index....showtopic=11442

You can read how to easily perform double blind listening tests here :
http://doc.hydrogenaudio.org/wikis/hydrogenaudio/ABX
Please verify your claims, or your further posts on this topic will be removed by moderation.
Thank you.

FYI: Unitpulse2k is an impulse which does not alter the signal in any way. I doubt that you are actually hearing any difference.
  • Last Edit: 21 July, 2004, 04:35:47 PM by dev0
"To understand me, you'll have to swallow a world." Or maybe your words.

Custom FIR Filter Implementation
Reply #8
Quote
FYI: Unitpulse2k is an impulse which does not alter the signal in any way. I doubt that you are actually hearing any difference.
[a href="index.php?act=findpost&pid=227916"][{POST_SNAPBACK}][/a]

That's exactly what I was asking.

  • tkrieger
  • [*]
  • Banned
Custom FIR Filter Implementation
Reply #9
Quote
What exactly are you hearing and why?
[a href="index.php?act=findpost&pid=227900"][{POST_SNAPBACK}][/a]


The "why" part is based on what I've seen with Lanczos filters with picture images.  I figured, if it works with picture images, why not try it with audio?  The Lanczos interpolation strikes a happy medium between the poor time response of standard sinc filters and the HF modulation of filter-less playback.

The best answer to what I perceive is a more "realistic" harmonic structure to intruments and vocals.  A more-palpable presentation.  Since this is not particularly difficult to implement the convolver with the impulse function to convolve the signal with, so the best explanation would be trying it for yourself.

  • dev0
  • [*][*][*][*][*]
  • Developer
Custom FIR Filter Implementation
Reply #10
Please re-read my comment and make sure you understand TOS Rule #8.
"To understand me, you'll have to swallow a world." Or maybe your words.

  • kode54
  • [*][*][*][*][*]
  • Administrator
Custom FIR Filter Implementation
Reply #11
I have never seen Lanczos3 or Lanczos4 used in image processing for anything other than scaling. Please cite an example of where this filter is used for "improving" images.

  • KikeG
  • [*][*][*][*][*]
  • Developer
Custom FIR Filter Implementation
Reply #12
Quote
It so happens, by luck (and I mean luck) that the "Unitpulse2K" impulse function is a "Lanczos4" (four) function


Ahem, unitpulse2K is just what its name says, a unitary impulse (all zero samples but a single nonzero sample). The funcion it implements is the unitary function, and that's why convolving any signal with this function does nothing to the signal.

Quote
So I implemented it in the Foobar2000, and the result is some of the best Redbook playback I've ever heard.


This looks like a clear example of placebo in action, and as such, clearly shows the need of TOS rule #8.

Quote
From a sonic standpoint, this digital filter should have a decided advantage over systems that use either typical windowed "sinc" functions or the newly-popular "filterless" designs.


The filtering you can do with foobar2000 + convolution plugin as you propose, has not much to do with the filtering inside a DAC. The DAC filters oversampled data in order to remove unwanted ultrasonic images over fs/2, that are just garbage. The convolver plugin filters non-oversampled data, and will have an effect just over frequencies below fs/2. After this filter, the DAC at your soundcard or cd player will unavoidably do its filtering as I just explained.

You can't remove this last filtering by using foobar convolver the way you tried,  but you can "act before" this filtering and, using an appropiate filtering before, improve time response in some (minor) aspects, using foobar convolver, at the expense of losing a little bit of the upper frequency range. But not by using unitpulse2k (which, again, does nothing to the signal!!)

Also, any data recorded on a cd has already been filtered at the AD stage (antialiasing filter), with similar results to DAC filtering in regards to time response.
  • Last Edit: 22 July, 2004, 08:09:40 AM by KikeG

  • dev0
  • [*][*][*][*][*]
  • Developer
Custom FIR Filter Implementation
Reply #13
The troll decided to continue the discussion about TOS#8 via Report to Mod/PM, but I decided to share one of his responses:

Quote
I'm not into that stuff. If I cannot state simple opinions, I just won't post here anymore. I don't have the resources (scopes, measuring devices, comparators, etc.) to undergo such validation. And I think such validation doesn't really gain anything.

If you want to see further opinions of this from me, click the links below:

http://db.audioasylum.com/cgi/m.mpl?forum=prophead&n=7310
http://db.audioasylum.com/cgi/m.mpl?forum=prophead&n=7253
http://db.audioasylum.com/cgi/m.mpl?forum=prophead&n=7993
http://db.audioasylum.com/cgi/m.mpl?forum=general&n=253177
http://db.audioasylum.com/cgi/m.mpl?forum=general&n=188990
http://db.audioasylum.com/cgi/m.mpl?forum=general&n=229657

I think it should be up to the readers, not the moderators, to determine if one's claim is or is not valid. There's nothing unequivocal here. The Cable Asylum in Audio Asylum has a similar intolerance toward discussing DBT, which I don't agree with either. I just think it's wrong to suppess opinion, simply because it might be controversial. Whether it's DBT or subjective opinion.

Todd
  • Last Edit: 22 July, 2004, 07:27:29 AM by dev0
"To understand me, you'll have to swallow a world." Or maybe your words.