Jump to content
IGNORED

Help me to understand filters


Recommended Posts

59 minutes ago, manisandher said:

2. The humble FIR is essentially totally transparent from 0 to 19 kHz. So, what’s the point of using anything else?

 

My hunch is that this question is not relevant. But after sitting back and thinking for 10 minutes, it seems hard to find the reason of Why.

 

Of course, for me, this is also about the knowledge of how my filters behave and which would be far from transparent when your means of testing is applied to it.

or

Of course, we can envision that a FIR filter pre-rings (at least technically it does) and that we thus want a Minimum Phase filter. We all know the story ...

 

... which is less than half of the story.

 

Subjective answers *) are also hard to reason out. So as you know, your latest USB cable brings forward an unheard dose of speed and/hence transient harmonics. Just a stupid USB cable. Try that on any ringing filter (hence say all of the ones you showed) and know that this result will be gone.

Still the followers of those filters will be able to reason out why that other group (mine) can only be worse. That is the theory again.

 

*): I just claimed that today's presence is yesterday's history. 🤪  There's still too much other sh*t going on to approach this subjectively. This world of audio changes too fast.

 

This should not become a thread about transients again (unless it was your intention, Mani). But you know quite well it is about that. And they don't show in any of your examples. Also, the subject is for the happy few (like you) because you can subjectively listen to the difference. So:

 

RME says, In theory, a filter should have as little phase deviation as possible over the frequency range, have as short a settling time as possible, an acceptable decay time, and provide the maximum possible frequency range without deviation. The stopband attenuation should be high to prevent aliasing.”

 

RME is right. And I emphasized the In Theory. And:

Firstly they are as vague as possible (e.g. "should have as little" instead of "is not allowed to have") because we all know there will *always* be a trade off.

 

Let's keep in mind that the aliasing RME refers to, is represented by you by means of Imaging. This is not the same thing. Imaging is harmless unless we think that HF is hurtful to electronics or speaker drivers. It is the aliasing of images (folding back in the audio band) which is harmful - more harmful than THD (like my filters would imply more THD).

 

... But I am happy to learn from others why an original of 24/176.4 actually should arrive back in that exact same state, after applying decent downsampling and upsampling plus the filters - as you proposed it. It doesn't seem wrong. It could even be enlightening. One hint is in my mind: The downsampling for RBCD possibly has not been done so well as you just did it (you worked your way to it 😉) but you made a good job out of it. So ... nothing tells me that a means of filtering could not create a better version than the downsampling means (now wrongly applied) followed by the upsampling of your choice, could not work out for the better.

I know, I am now more vague than RME.

 

Peter

 

Lush^3-e      Lush^2      Blaxius^2      Ethernet^2     HDMI^2     XLR^2

XXHighEnd (developer)

Phasure NOS1 24/768 Async USB DAC (manufacturer)

Phasure Mach III Audio PC with Linear PSU (manufacturer)

Orelino & Orelo MKII Speakers (designer/supplier)

Link to post
Share on other sites

Thanks Peter. I really appreciate your thoughts.

 

8 minutes ago, PeterSt said:

And [transients] don't show in any of your examples.

 

As I mentioned, I repeated the above with a 24/176.4 music file, with a dynamic range >20dB, lots of transients, and 'real' content up to 50 kHz. Here's the result with the FIR filter:

 

394935025_RR24_44.1_sinc-Mto24_176.4_FIRvs.Original.thumb.jpg.b5fee7a3e9fc9d43ecfd9f18ad5ecf1c.jpg

 

Again, we get a null of around -190dB. The down- and then up-sampled file is identical to the original from 0 to 19 kHz.

 

If the FIR filter were causing any phase or ringing issues, surely the up-sampled file would not null with the original.

 

What am I missing here?

 

Mani.

 

 

Phasure Mach III audio PC -> HQPlayer/XXHighEnd @24/705.6 -> Phasure NOS1 DAC -> First Watt F5-cloned mono amps -> Tune Audio Anima horn speakers

Link to post
Share on other sites
2 hours ago, manisandher said:

If the FIR filter were causing any phase or ringing issues, surely the up-sampled file would not null with the original.

 

What am I missing here?

 

The fact that we can't use the way too rough FFT for this ?

For fun, if possible, try to have a "bin" with the width of 1000Hz somewhere (could be at 13KHz). If you seem to see a difference now, try to concentrate on the frequency and now make the bin 100Hz in the area of concern. I don't think you can do this with pink noise, so it has to be a music file.

 

Try to envision that the FFT always shows the average of frequencies occurring in the bins you imply (this is about the settings like e.g. 512, 32768, 1M, 2M etc.).

I know, you are not running FFTs but comparisons instead. But it is the same. And then still it is quite undoable when this is about music; Now you also incorporate the period of time of (the) recording. Thus, take 10 seconds and again you'd have an average (one, say, transient which reaches maximum voltage will be averaged with the level of the remaining music in that time period). You won't see back that transient.

 

Of course this can all be related to how the other filters surely are showing the not being "perfect", so if you're after that (must stay perfect) then skip those. But it won't mean that those which you showed as "perfect" are that.

Perfect in this sense is no difference at all. -190dB is not the same by far. And the "inaudible" ? I actually just talked about that. Make it better visible first.

This too is the never ending story (with Nulling). It doesn't work ...

Lush^3-e      Lush^2      Blaxius^2      Ethernet^2     HDMI^2     XLR^2

XXHighEnd (developer)

Phasure NOS1 24/768 Async USB DAC (manufacturer)

Phasure Mach III Audio PC with Linear PSU (manufacturer)

Orelino & Orelo MKII Speakers (designer/supplier)

Link to post
Share on other sites

Yes, the FFTs were really just to determine that I had nulled the the files correctly. I'm not sure if the FFTs can be used for anything more useful.

 

But this might be more helpful. I've taken a spectrogram of 10 seconds or so of the nulled music file, with large transients, and have increased the gain by 60dB:

 

867241506_Transients-spectrogram60dB.thumb.JPG.b959043ec51e1b579deac6f779c61e8d.JPG

 

A single missed sample would show up here, but there seems to be nothing below 21 kHz.

 

Mani.

 

Phasure Mach III audio PC -> HQPlayer/XXHighEnd @24/705.6 -> Phasure NOS1 DAC -> First Watt F5-cloned mono amps -> Tune Audio Anima horn speakers

Link to post
Share on other sites

Steep brickwall linear-phase FIR introduces delay, for example 65535 taps linear FIR causes 32768 samples (0.7 seconds on 44.1kHz signal) delay. This means when digital signal is inputted to the FIR filter, the filter stores those signal for 0.7 seconds in its FIFO memory then output it.

 

One of the practical usage of short delay digital filter is for musical instruments such as digital piano or vocal reverb. Short response time from pressing keys to emitting sound is preferable for players. Something below 10 milliseconds is desirable.

 

Also short delay FIR is used on sub-woofer lowpass digital filter, where shorter delay is desirable to synchronize to main speakers.

 

Short delay sharp roll-off digital filters are used for those purposes.

 

While there is a slow roll-off leaky filters. It seems those filters are early days approach to reproduce original analog sound before low-pass filtering of ADC. There was "Pioneer Legato Link" and "Wadia Spline". I think it is very 1990s way to solve the problem. Nowadays people developing deep learning audio super resolution, more accurate high frequency-component restoration, something like: record various music with high-resolution, convert it to low-resolution and train the neural network of low-resolution input and high-resolution output. Compare the network output with original high resolution sound and adjust network parameters until the neural network learns how typical musical instruments sound and outputs high resolution sound 😁.

Sunday programmer since 1985

Developer of PlayPcmWin

Link to post
Share on other sites

Similar to what I did before, I did the following:

 

1. take a 20 second snippet from a Referenece Recordings 24/176.4 track

2. down-sample to 24/44.1

3. up-sample 24/44.1 back up to 24/176.4, using various HQPlayer filters

4. null up-sampled file against original RR 24/176.4 track

5. take spectrogram of the nulled file

 

With an ideal filter the spectrogram would show absolutely nothing from 0 to 22.05 kHz. But achieving this further down, 0 to 19 kHz say, would still be an excellent result. Anyway, here's how (some of) the filters faired:

 

FIR:

1118565222_1.NULL-Transients-24_44.1_sinc-Mto24_176.4_FIR.thumb.JPG.6a41b91afefe281293bcf36b05a94cf1.JPG

 

The spectrogram shows a null of around -190dB below 19.5 kHz or so. But more importantly, there is nothing correlated with the music signal in this range.

 

poly-sinc-lp:

104023848_2.NULL-Transients-24_44.1_sinc-Mto24_176.4_poly-sinc-lp.thumb.JPG.aa55d5023419fbc1347d6d2a7e7371df.JPG

 

The spectrogram shows a null of around -190dB below 19 kHz or so. Again, there is nothing correlated with the music signal in this range.

 

poly-sinc-mp:

1887094627_3.NULL-Transients-24_44.1_sinc-Mto24_176.4_poly-sinc-mp.thumb.JPG.619ae1ed8176f8bc6c234cd5e546f31f.JPG

 

The non-nulled signal below 19 kHz is clearly correlated to the music signal.

 

minringFIR-lp:

421492242_4.NULL-Transients-24_44.1_sinc-Mto24_176.4_minringFIR-lp.thumb.JPG.473b533690e8a7d052d1d2d811ccf991.JPG

 

Again, the non-nulled signal below 21 kHz is clearly correlated to the music signal, but at a much lower level than the poly-sinc-mp filter.

 

polynomial-2:

614105315_5.NULL-Transients-24_44.1_sinc-Mto24_176.4_polynomial-2.thumb.JPG.acc9473e0fd54d222711c1af737b1e5b.JPG

 

The non-nulled signal below 21 kHz is clearly correlated to the music signal, but to a slightly lesser extent than the poly-sinc-mp filter.

 

Do these prove that the FIR filter is essentially 'perfect' below 19 kHz?

 

Can anyone explain why a 'minimum phase, 'minimum ringing' or 'non-ringing' filter would still be a good thing?

 

Mani.

Phasure Mach III audio PC -> HQPlayer/XXHighEnd @24/705.6 -> Phasure NOS1 DAC -> First Watt F5-cloned mono amps -> Tune Audio Anima horn speakers

Link to post
Share on other sites

Minimum-phase IIR filter is designed using analog lowpass filter design techniques: Design analog lowpass filter circuit then convert it to digital IIR filter circuit using impulse invariance method. So it succeeds all the knowledge of old and well-studied analog filter design techniques, also there is always equivalent analog circuit of the IIR filter exists and it can be realized as analog filter circuit, it is nice to imagine about it 🙂

 

I think, when analog lowpass filter circuit is converted to digital IIR using bilinear transform, resulted filter is not minimum-phase because poll is placed on the unit circle. But it is short delay and impulse response shape is very similar to minimum-phase so it is called as short-delay sharp roll-off or something.

 

It is not possible to see real filter performance using your null-test method because frequency-phase response is not zero-phase for those filters.

 

Also I'd like to add, typically leaked aliasing noise sound is very unmusical and super annoying if you can hear it (I test it with down-sampling to 11.025Hz PCM).

Sunday programmer since 1985

Developer of PlayPcmWin

Link to post
Share on other sites
30 minutes ago, yamamoto2002 said:

It is not possible to see real filter performance using your null-test method because frequency-phase response is not zero-phase for those filters.

 

OK, but why is zero-phase (linear-phase?) not 'good enough'? What problem are these 'minimum-phase', 'minimum-ringing' and 'non-ringing' filters fixing? I just can't see it.

 

Mani.

Phasure Mach III audio PC -> HQPlayer/XXHighEnd @24/705.6 -> Phasure NOS1 DAC -> First Watt F5-cloned mono amps -> Tune Audio Anima horn speakers

Link to post
Share on other sites

One aspect of the situation is that any circuitry in operation during actual playback has the potential to degrade SQ, because of electrical noise factors - no matter what it's doing, and whether its intention is to improve things. Causal links may not be obvious, or from casually considering it, possible - but that doesn't stop things happening, 😉. Filters are a good example - I'm thinking here of an upmarket CD player I listened to, which allowed selection of various filter types; the clear winner was setting the switch such that this bit of the digital circuitry was disabled 🙂 ... quite often, simplicity is the best path.

 

Which doesn't stop people loving the idea of toying with pet theories 😁 - just because something looks great on paper, if the implementation of that idea is not good enough then you're just wasting your time - and then some sort of compromise ends up being decided on, which is just making the best of a less than satisfactory situation.

Frank

 

http://artofaudioconjuring.blogspot.com/

 

 

Over and out.

.

 

Link to post
Share on other sites
7 hours ago, PeterSt said:

But it won't mean that those which you showed as "perfect" are that.

Perfect in this sense is no difference at all. -190dB is not the same by far.

 

But a -190dB null suggests that the difference between the resampled file and the original is 0.000001dB (I think) in the audio band. And bear in mind that the resampled file has been through both an anti-alias and a reconstruction filter.

 

OK, not quite perfect. But orders of magnitude more accurate to the original file than any of the 'minimum-phase', 'minimum-ringing' and 'non-ringing' filters.

 

Mani.

Phasure Mach III audio PC -> HQPlayer/XXHighEnd @24/705.6 -> Phasure NOS1 DAC -> First Watt F5-cloned mono amps -> Tune Audio Anima horn speakers

Link to post
Share on other sites
4 minutes ago, fas42 said:

Which doesn't stop people loving the idea of toying with pet theories 😁

 

All I'm trying to do is to understand what problem 'minimum-phase', 'minimum-ringing' and 'non-ringing' filters are trying to solve.

 

Apart from latency, which @yamamoto2002 brought up, with a linear-phase FIR filter, there is no problem... as far as I can see. And yet almost all modern DACs, and certainly software players, offer a bunch of filters. Why?

 

Mani.

Phasure Mach III audio PC -> HQPlayer/XXHighEnd @24/705.6 -> Phasure NOS1 DAC -> First Watt F5-cloned mono amps -> Tune Audio Anima horn speakers

Link to post
Share on other sites

I thought the problem was, "it should sound better!" 😉 - throwing in filters is like adding rubber bands to hold something together, which actually just needs to be glued properly, as far as I'm concerned. But others found that doing the filter thing made it "sound better", so it's now part of what one does  - so that the consumer can season the playback, to taste.

Frank

 

http://artofaudioconjuring.blogspot.com/

 

 

Over and out.

.

 

Link to post
Share on other sites
6 hours ago, manisandher said:

OK, but why is zero-phase (linear-phase?) not 'good enough'? What problem are these 'minimum-phase', 'minimum-ringing' and 'non-ringing' filters fixing? I just can't see it.

 

Minimum-phase IIR filter is able to achieve the same filtering performance to FIR filter, except frequency-phase response, and IIR filters are more computationally efficient than the same performance FIR. It is something like the order of 100x to 1000x difference so it is not negligible difference. On low-power device, IIR filter can be only option with given filter specification. (Also there is something romantic characteristic on minimum-phase filter: when matching maximum-phase filter is cascaded to the minimum-phase filter, original signal before filtering is completely recovered, theoretically:) )

 

But on PC, massively parallel cores (GPU) become available and FIR is able to use those functionality fully to accelerate FIR computation and now super overkill brickwall linear-phase FIR filter can be run on realtime speed

Sunday programmer since 1985

Developer of PlayPcmWin

Link to post
Share on other sites
5 hours ago, manisandher said:

1. The ‘minimum-phase’, ‘minimum-ringing’ and ‘non-ringing’ filters are clearly not transparent in the audio band. So, what's the point of using them?

 

2. The humble FIR is essentially totally transparent from 0 to 19 kHz. So, what’s the point of using anything else?

 

You are oversimplifying it, to begin with assuming that your source data is "transparent" to the original analog signal without needing fixing...

 

Signalyst - Developer of HQPlayer

Pulse & Fidelity - Software Defined Amplifiers

Link to post
Share on other sites
3 hours ago, manisandher said:

But a -190dB null suggests that the difference between the resampled file and the original is 0.000001dB (I think) in the audio band. And bear in mind that the resampled file has been through both an anti-alias and a reconstruction filter.

 

sinc-S, sinc-M and poly-sinc-ext2, and poly-sinc-xtr have about -240 dB stop-band attenuation. But since this exceeds resolution of 32-bit PCM you cannot get more out of HQPlayer as PCM.

 

3 hours ago, manisandher said:

OK, not quite perfect. But orders of magnitude more accurate to the original file than any of the 'minimum-phase', 'minimum-ringing' and 'non-ringing' filters.

 

First define "accurate"... ;)

 

You are constantly assuming that your source data is accurate representation of the source analog signal. Which is not the case with most modern ADCs.

 

The minimum phase variants have exactly same attenuation and response as the linear phase ones. 

 

 

P.S. Your method seems to have trouble keeping up with sub-sample delays with linear phase filters.

 

Signalyst - Developer of HQPlayer

Pulse & Fidelity - Software Defined Amplifiers

Link to post
Share on other sites
16 hours ago, manisandher said:

 

700831432_4.minringFIR-lpvs.Original.thumb.jpg.0e1d5f936caa3e8291b242bcb0292e70.jpg

 

Mani, I think it would be true that this is an indication that your process somewhere and somehow is failing. I don't see any filter do this in-band (!).

I would not so much claim this for the others (not "nulling").

 

For me it is hard to prove - or to put to words what is wrong with the process in general, but this is very similar to what I tried to tell you:

 

1 hour ago, Miska said:

You are constantly assuming that your source data is accurate representation of the source analog signal.

 

... This almost looks like "our filtering" can improve on the original as how you received it. Still is is not what I would claim.

It could be done though.

Lush^3-e      Lush^2      Blaxius^2      Ethernet^2     HDMI^2     XLR^2

XXHighEnd (developer)

Phasure NOS1 24/768 Async USB DAC (manufacturer)

Phasure Mach III Audio PC with Linear PSU (manufacturer)

Orelino & Orelo MKII Speakers (designer/supplier)

Link to post
Share on other sites
4 hours ago, manisandher said:

But a -190dB null suggests that the difference between the resampled file and the original is 0.000001dB (I think) in the audio band.

 

No, it is not. So I'll try to repeat:

That -190dB is reported over a number of samples. Say it is 1000 of them.

 

Now firstly one sample can be different for the value of +0,5V while a next is different for -0,5V and you won't see it. The -dB reported would be exactly the same.

 

Secondly, if indeed one sample only is different for +0,5V, this will be a huge difference which you still won't find back in the average over the 1000 samples. Oh, it will have risen, but your whatever 0.000001dB will have become 0.000002dB and you'd still have the same idea about it is nulls at : -190dB.

 

Thirdly (and I like this one the best), supposed that indeed one sample is different by +0,5V then this is to be averaged with those other 999 samples (which averaged already to say 0V - yep, is is AC) in order to come up with the new -dB value. But because energy will not be lost (and is also not created), the new net result will again be 0V;

This is because the filter will do other "strange" things, like dropping values because an other value rose.

But this net result is integrated over "a bin", just like you could say that the averaged voltage over the whole 5 minute (is an other dimension bin) song is 0V.

Now make that frequency bin a 100Hz wide (like from 12000 to 12100 Hz) and be assured that things have changed in there. Not that I would know how to make it visible for real music data.

 

Regarding the latter re-read Yamamoto's first post in this thread and know that the whatever original you compare with, may have shifted 32768 samples to the right because of the delay of the filter. And I know, you compare the filterED result with the original, but it just can-not be true that this will be the same. So:

 

image.png.09c5eeac2a61d7da77b0a5cfe8eddd14.png

 

I don't care how much this is calculated as differences at -190dB. It will be wildly different if you would be able to look in a small bin *and* in the representative time span.

 

Peter

 

 

Lush^3-e      Lush^2      Blaxius^2      Ethernet^2     HDMI^2     XLR^2

XXHighEnd (developer)

Phasure NOS1 24/768 Async USB DAC (manufacturer)

Phasure Mach III Audio PC with Linear PSU (manufacturer)

Orelino & Orelo MKII Speakers (designer/supplier)

Link to post
Share on other sites

Thanks Jussi, I appreciate your input.

 

4 hours ago, Miska said:

You are constantly assuming that your source data is accurate representation of the source analog signal. Which is not the case with most modern ADCs.

 

Of course, I have no idea what most of the music I listen to was created with. But I do know the provenance of the two files I've used in this thread:

 

1. The pink noise file was generated in Sound Forge Pro, so didn't pass through an ADC.

 

2. The Reference Recordings 24_176.4 music file wasn't recorded with a modern ADC. The ADC in question used a ladder-pipeline architecture, with a passive analogue filter with group delay correction.

 

Mani.

Phasure Mach III audio PC -> HQPlayer/XXHighEnd @24/705.6 -> Phasure NOS1 DAC -> First Watt F5-cloned mono amps -> Tune Audio Anima horn speakers

Link to post
Share on other sites
4 hours ago, Miska said:

P.S. Your method seems to have trouble keeping up with sub-sample delays with linear phase filters.

 

Is this why I'm getting a null of 'only' -190dB with the linear phase filters?

 

Mani.

Phasure Mach III audio PC -> HQPlayer/XXHighEnd @24/705.6 -> Phasure NOS1 DAC -> First Watt F5-cloned mono amps -> Tune Audio Anima horn speakers

Link to post
Share on other sites
3 hours ago, PeterSt said:

Mani, I think it would be true that this is an indication that your process somewhere and somehow is failing. I don't see any filter do this in-band (!).

 

I checked it and re-checked it. It shows the same behaviour with music file too:

 

1892398372_NULL-Transients-24_44.1_sinc-Mto24_176.4_minringFIR-lp.thumb.JPG.843c554e82c44d017b1df4194f61e4c8.JPG

 

I'm pretty confident it's correct.

 

Mani.

Phasure Mach III audio PC -> HQPlayer/XXHighEnd @24/705.6 -> Phasure NOS1 DAC -> First Watt F5-cloned mono amps -> Tune Audio Anima horn speakers

Link to post
Share on other sites
2 hours ago, PeterSt said:

I don't care how much this is calculated as differences at -190dB. It will be wildly different if you would be able to look in a small bin *and* in the representative time span.

 

OK. So what about the spectrograms showing absolutely no signal correlated with the music in the audio band? Surely there would be something there if there were any phase or ringing issues introduced by the anti-alias and/or reconstruction filter?

 

As an example, here are two vinyl rips I captured simultaneously (using a splitter) with two different ADCs:

 

1129803294_2A-noglitchat3_08.thumb.JPG.64436d3610ab21f126e7e6e2100a22fc.JPG

 

338492155_2C-glitchat3_08.thumb.JPG.9f291b51db1f13b40e4a74302c1c9237.JPG

 

 

That extra blue line in the second is not a scratch on the record, and it doesn't appear in the first. It's actually caused by a single missed sample (due to a buffer issue). This hasn't been averaged out by the analysis software.

 

Mani.

Phasure Mach III audio PC -> HQPlayer/XXHighEnd @24/705.6 -> Phasure NOS1 DAC -> First Watt F5-cloned mono amps -> Tune Audio Anima horn speakers

Link to post
Share on other sites

Hi Mani,

 

1 hour ago, manisandher said:

That extra blue line in the second is not a scratch on the record

 

Which extra blue line ?

 

image.png.a1a2c147cb4f60d71899e86ddf6be8c4.png

 

I only see this one (at the bottom of the picture) but this is not from a missing sample. It is a continuous tone.

 

And FWIW :

 

image.png.3508b6bb3966b02d92497ee587aecae0.png

 

Apart from that line in the top one (your bottom one), these are not the same at all (this is at the far right hand side). But I am not sure why you showed those both captures.

 

For fun you could shift two of the exact same files (the file you originally used) by a few dozen or so samples (make a copy of the file and cut out a few dozen samples from the beginning out of one of them). Now look at the nulling result. I am not sure what to expect, but I guess we will learn something from it ...

 

Peter

Lush^3-e      Lush^2      Blaxius^2      Ethernet^2     HDMI^2     XLR^2

XXHighEnd (developer)

Phasure NOS1 24/768 Async USB DAC (manufacturer)

Phasure Mach III Audio PC with Linear PSU (manufacturer)

Orelino & Orelo MKII Speakers (designer/supplier)

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...