Jump to content

Extreme filtering software upscaling


Recommended Posts

This thread could go either in DACs or software, but I think it's better suited to DACs in this case.

 

I was inspired by a recent audition of the Chord MScaler in my system, courtesy of @Sime V2 as many would have read about on the thread below:

https://www.stereo.net.au/forums/topic/260051-chord-hugo-m-scaler-discussion-and-impressions-thread/

 

My experience was only positive with the upscaling from this device, which attempts to recreate a perfect sinc approximation by using their proprietary Watts Transient Aligned filter and up to 1 million taps for the upscaling. Apart from the WTA, there is nothing unknown about sinc upscaling and it's perfectly doable in PC, but the MScaler provides a very convenient single box to do the upscaling. However the disadvantage is that to get the maximum benefit, you need to upscale to over 700kHz from either 44 or 48 sources, and use Chord's proprietary interface out which only Chord DACs have. What I set out to do was hack away on the existing free software code to allow it to do obscene upscale levels and find the realistic limits of doing it on PC. The fun part was I did exactly what Sox told me not to do "note that band-width values greater than 99% are not recommended for normal use as they can cause excessive transient echo" which is of course echo above the limits of human hearing and is exactly what the Chord upscalers do already.

 

The limits I found on PC were mainly to do with the fact that the upscaling software (sox) is running single threaded but can still run faster than real time up to levels limited only by ram. I did not run out of ram on my PC per se, but the method of allocating ram in the sox rescaler could not allocate larger than 4GB (a common 32 bit limitation.) Nonetheless, this hit a limit at quite obscene levels, with a brick wall filter of 99.999996% bandwidth and impulse recreation (over 22 bits) and a rejection of 204dB coming to a total of 78 million taps. The difference, however, is I'm only doubling the sample rates to either 88.2 or 96, making the resultant files much more usable. Whilst it is possible to start with higher sample rates and go to any levels (such as the MScaler does), I can't feed those into my DSP since it would just downsample them to 88 or 96 again, and I can still use the ridiculous number of taps with just the one doubling of sample rate, unlike the MScaler.

 

So what's the audible advantage? Note that I'm running into an MSB Reference DAC which is a ladder type DAC, and interaction between device and source could make for very different results. None of these are earth shattering improvements that would make you drop everything and try to do this ASAP, but on a very resolving system are appreciable. There is a focusing and recession of the sound stage back, the bass tends to be more focused, the top end sweeter, but with more bloom around it so there's more natural sparkle and presence to cymbals and high frequencies. Voices and midrange instrument timbres have a hard edge taken off them and added warmth. There's an extra depth to detail - vibratos sound somehow more present as though they're doing it more vigorously. String instruments which have certain strident notes just sound warmer and more listenable.

 

I briefly experimented with doing it on the fly with my existing files but that particular code was very unhappy and will need a lot more attention to make it work. The other thing is when I first start the conversion, there's a 4 second startup time as it fills buffers and allocates ram, even though later on it proceeds much faster than real time, which would need a workaround in the real world. The media player would likely dump a ton of music into the buffer rapidly and not know where it's really up to so that would need to be accounted for in the playback. I'm not actually sure that this would work as a standalone "device" in the real world because most players assume that what they're streaming is being played with no to minimal latency and wouldn't dump many seconds worth of music happily. This is the advantage of pre-converting files and then storing them upscaled. These changes were of enough benefit that I've run a script through all my lower resolution files to upscale them for my own use.

 

If any of you have a short 44 or 48kHz reference wav or flac file they would like to try it on, and have somewhere to upload it to, I'd be happy to upscale it for you. Just message me. These files get unwieldy and large so it has to be short, and most files will need to have their volume lowered by 2dB during the conversion to prevent them clipping, which you'd need to account for when doing comparisons.

Edited by Ittaku
  • Like 6
Link to comment
Share on other sites



I have locked in my Dac to a R2R dac, so this intrigues me to try upsampling in software. If anyone releases a m scaler type product for USB, I would sure like to try it.

I was playing around with HQPlayer but really unimpressed with the interface. (Scaling of the options interface is so hard to read). I use a 65" TV and scale fonts to the recommended 130% and all my software works perfect, except for HQplayer. Even all my free software, Foobar, Aimp etc... no problems. But a $200+ bit of software, no. I take it is being ported from another OS, but still think its been around a while? 

I could not hear any difference with initial use of HQPlayer. Will read up more on it and try again some time.

 

Edited by rocky500
Link to comment
Share on other sites

I read most of the MScaler thread and now this new one. I have some (maybe dumb) questions.

One question I have is if you are upsampling and using a filter the file will no longer be bit perfect with the original will it?

Another area I don't understand is if you apply a filter to the file and then input it to your DAC the DAC will also be applying a filter/s as well so what is going on.

  • Like 1
Link to comment
Share on other sites

9 minutes ago, a.dent said:

I read most of the MScaler thread and now this new one. I have some (maybe dumb) questions.

One question I have is if you are upsampling and using a filter the file will no longer be bit perfect with the original will it?

Another area I don't understand is if you apply a filter to the file and then input it to your DAC the DAC will also be applying a filter/s as well so what is going on.

That's correct. We're screwing with the bits. You're left with a different file with different bits, and extrapolated bits to make up the 24 bits and higher frequency sample rate. If you try to convert it back to its original format you will never get the same file. One thing you have to understand is that most DACs will oversample it anyway before playing it back at a higher frequency, so doing this step in software is (theoretically) moving the most critical part of the filtering into a separate upsampling that takes a lot more time and computing power than can be done 'live' on a DAC. The DAC will then (depending on design) almost certainly oversample it further to whatever sample rate it likes running at, but any filtering it then applies happens at a higher frequency and bit rate which has almost no impact in the audible range. It's fair to say that my DAC is extreme in its approach and its oversampling is (in my opinion) very good, and regular upscaling that I did previously didn't sound as good as sending it the native format. However that's not the case when I upscale it with this ridiculous approach (and an 80 million tap filter is quite ridiculous, and unusable in real time.)

  • Like 1
Link to comment
Share on other sites



@Ittaku

 

Did this a while ago in an earlier thread. Getting the frequency up as far as possible as obvious time domain effects which can be advantageous depending on the material. Some DACs are setup to run as such natively (e.g. Phasure etc).

 

Would probably be not too hard to implement this to some limited degree on a RasPi, plenty of DSP solutions exist if you're happy handling all the extra work involved. Piping SoX isn't too hard.

Link to comment
Share on other sites

1 hour ago, Ittaku said:

That's correct. We're screwing with the bits. You're left with a different file with different bits, and extrapolated bits to make up the 24 bits and higher frequency sample rate. If you try to convert it back to its original format you will never get the same file. One thing you have to understand is that most DACs will oversample it anyway before playing it back at a higher frequency, so doing this step in software is (theoretically) moving the most critical part of the filtering into a separate upsampling that takes a lot more time and computing power than can be done 'live' on a DAC. The DAC will then (depending on design) almost certainly oversample it further to whatever sample rate it likes running at, but any filtering it then applies happens at a higher frequency and bit rate which has almost no impact in the audible range. It's fair to say that my DAC is extreme in its approach and its oversampling is (in my opinion) very good, and regular upscaling that I did previously didn't sound as good as sending it the native format. However that's not the case when I upscale it with this ridiculous approach (and an 80 million tap filter is quite ridiculous, and unusable in real time.)

I've got HQPlayer and have tried many different filters and settings. I tried converting to DSD.

All in all I think the native file straight into my Accuphase DP-560 sounds the best. i.e. not using HQPlayer.

Is the Accuphase doing this type of upsampling? It apparently has a FPGA chip in it.

Link to comment
Share on other sites

1 minute ago, a.dent said:

I've got HQPlayer and have tried many different filters and settings. I tried converting to DSD.

All in all I think the native file straight into my Accuphase DP-560 sounds the best. i.e. not using HQPlayer.

Is the Accuphase doing this type of upsampling? It apparently has a FPGA chip in it.

That was also my experience with regular PC upscalers, even on the most extreme settings. However I've hacked it to do ludicrous things the upscalers don't normally do, and find the sound better this way. It is likely to be system and or DAC dependant. No DAC upscales the way I'm doing here, and couldn't even if they wanted to for lack of processing power, ram, and the massive latency it would add (about 10 seconds). The chord upscaler is what does a smaller version of this and inspired this experiment.

Link to comment
Share on other sites

17 minutes ago, rmpfyf said:

@Ittaku

 

Did this a while ago in an earlier thread. Getting the frequency up as far as possible as obvious time domain effects which can be advantageous depending on the material. Some DACs are setup to run as such natively (e.g. Phasure etc).

 

Would probably be not too hard to implement this to some limited degree on a RasPi, plenty of DSP solutions exist if you're happy handling all the extra work involved. Piping SoX isn't too hard.

Interesting. How would you go about handling

80 million taps on an RPi?

Link to comment
Share on other sites

12 minutes ago, Ittaku said:

Interesting. How would you go about handling

80 million taps on an RPi?

 

I wouldn't! Hence 'limited degree'. 

 

DSP job, though the necessity of so many taps somewhat extreme, would suggest much of the effect has much to do with output sample rates. 

 

PM if interested!

Link to comment
Share on other sites



A bit of calculation suggests that the way RW targets 16 bit regeneration requires 1 million taps means that 24 bit regeneration would require 500 million. Since I'm just pulling numbers out of my arse and am using the most that the software can without crapping out, I figure I'll see if I can actually hack the code to get to that arbitrary number.

Link to comment
Share on other sites

I sent @Ittaku a 44/16 version of Kamen 'Robin Hood' from Telarc's collection of their "finest recordings" CD-89110 and he kindly upsampled it to 88k using his extreme filtering software with 77 m taps.

 

The piece starts with cellos playing rhythmically and the first thing I noticed was the notes started & stopped more quickly so that they were much better differentiated.  Then the tympani comes in - and it had greater power and definition.  Later there is some very complicated full orchestral playing that was again better differentiated (one of the reasons I chose the piece) with the triangle seeming much clearer & sparklier.  And I found myself head-nodding/foot-tapping more through the piece so was more emotionally involved.

 

I also tried upsampling the recording to 88k using my freebie r8btrain program that I have used extensively in the past but although gave some of the above effects they were nowhere near a great.

 

So many thanks Con.  All I need to now be able to do it myself!

  • Like 3
Link to comment
Share on other sites

1 hour ago, legend said:

I sent @Ittaku a 44/16 version of Kamen 'Robin Hood' from Telarc's collection of their "finest recordings" CD-89110 and he kindly upsampled it to 88k using his extreme filtering software with 77 m taps.

 

The piece starts with cellos playing rhythmically and the first thing I noticed was the notes started & stopped more quickly so that they were much better differentiated.  Then the tympani comes in - and it had greater power and definition.  Later there is some very complicated full orchestral playing that was again better differentiated (one of the reasons I chose the piece) with the triangle seeming much clearer & sparklier.  And I found myself head-nodding/foot-tapping more through the piece so was more emotionally involved.

 

I also tried upsampling the recording to 88k using my freebie r8btrain program that I have used extensively in the past but although gave some of the above effects they were nowhere near a great.

 

So many thanks Con.  All I need to now be able to do it myself!

Thanks @legend. What DAC were you feeding? Would you also like to try an even higher resolution - what's the highest your DAC supports? I won't be able to get the taps any higher but it might be advantageous, I'm not sure. I suspect it'll just be the same with the same number of taps but at higher resolution.

Edited by Ittaku
Link to comment
Share on other sites

1 hour ago, legend said:

I sent @Ittaku a 44/16 version of Kamen 'Robin Hood' from Telarc's collection of their "finest recordings" CD-89110 and he kindly upsampled it to 88k using his extreme filtering software with 77 m taps.

 

The piece starts with cellos playing rhythmically and the first thing I noticed was the notes started & stopped more quickly so that they were much better differentiated.  Then the tympani comes in - and it had greater power and definition.  Later there is some very complicated full orchestral playing that was again better differentiated (one of the reasons I chose the piece) with the triangle seeming much clearer & sparklier.  And I found myself head-nodding/foot-tapping more through the piece so was more emotionally involved.

 

I also tried upsampling the recording to 88k using my freebie r8btrain program that I have used extensively in the past but although gave some of the above effects they were nowhere near a great.

 

So many thanks Con.  All I need to now be able to do it myself!

Would suggest asking for a second at a higher freq.. then this was posted"

 

Just now, Ittaku said:

Thanks @legend. What DAC were you feeding? Would you also like to try an even higher resolution - what's the highest your DAC supports? I won't be able to get the taps any higher but it might be advantageous, I'm not sure.

Yes - go as high as he'll take, it'll be audible.

Link to comment
Share on other sites



16 hours ago, a.dent said:

One question I have is if you are upsampling and using a filter the file will no longer be bit perfect with the original will it?

Yes.... but the whole idea of "it must always be bitperfect to the original, otherwise that's bad" is autiophile mythology.

 

16 hours ago, a.dent said:

the DAC will also be applying a filter/s as well so what is going on.

It might (likely) be.... it also might not be, depending on the DAC (or how the DAC can be configured)

Link to comment
Share on other sites

14 hours ago, a.dent said:

I've got HQPlayer and have tried many different filters and settings. I tried converting to DSD.

All in all I think the native file straight into my Accuphase DP-560 sounds the best. i.e. not using HQPlayer.

Is the Accuphase doing this type of upsampling? It apparently has a FPGA chip in it.

It uses the ESS Sabre DACs.   I've never been really convinced on paper that feeding a Sabre DA with a really fast 1-bit signal is going to help it, due to the way it works internally (with it's own internal sample rate converter, and conversion into ~6bit words)

Link to comment
Share on other sites

I don't mean to throw in Vinyl here but could this be one factor that many find vinyl has had something over their digital playback?

From RW and this thread, we are finding that improving to recreate a perfect sinc approximation like having software do it or m scaler it is improving on normal playback of CD by a noticeable margin.

Has the basic filters been holding back digital playback for some to keep going to their vinyl? The missing link maybe?

Or even why R2R NOS dacs can have that something that people find better for their playback. 

 

ADDED: I might not have used the right terms in the above, but hopefully you get what I am trying to say.

Edited by rocky500
  • Like 1
Link to comment
Share on other sites

Just a thought - as some move toward multi million tapped filter for playback, it's worth noting that on the ADC side,

there are ADC's available with choice of short / long anti aliasing filter. Most rec engineers prefer the sound of the short filter

stating that it sounds more natural.

I have a subtle voice in my head which keeps saying, for PCM, recording with a true multibit (non DS) ADC at 384k/24, no filters

and played back the same would probably sound the best. It's a lot of bandwidth though.

Just a thought :)

 

  • Like 1
Link to comment
Share on other sites

Just now, zenelectro said:

Just a thought - as some move toward multi million tapped filter for playback, it's worth noting that on the ADC side,

there are ADC's available with choice of short / long anti aliasing filter. Most rec engineers prefer the sound of the short filter

stating that it sounds more natural.

I have a subtle voice in my head which keeps saying, for PCM, recording with a true multibit (non DS) ADC at 384k/24, no filters

and played back the same would probably sound the best. It's a lot of bandwidth though.

Just a thought :)

 

That's true, and the same arguments exist for the DAC side. However, their definition of long is a filter with a few thousand taps. I'm looking at 10s of millions, so perhaps the target was never set high enough when they defined "long".

Link to comment
Share on other sites



After an extensive debugging session and a very long conversion process with the 500 million tap version (it takes 2 minutes just to start converting) I did some listening and no matter how hard I squinted and made funny faces, I couldn't differentiate it from the 78 million tap one. So for my hearing at least, there is some point beyond which there is no point to taking things further, even though a perfect sinc function is infinite (no music runs infinitely long anyway.) It's likely an exponential curve with ever diminishing gains and almost certainly not a binary phenomenon so there is no way of knowing how many taps is "enough" to get the best of this effect. My guess is probably around the 20 bits mark is the sweet spot, which works out to about 30 million taps. I'm just pulling numbers out of my arse yet again, but I'll do some listening to see if 78 is better than 30.

Edited by Ittaku
  • Like 1
Link to comment
Share on other sites

3 hours ago, rocky500 said:

I don't mean to throw in Vinyl here but could this be one factor that many find vinyl has had something over their digital playback?

In short no .... Even in light of the "digital reconstruction problems" being discussed, the digital approach is more accurate than vinyl.

 

 

Link to comment
Share on other sites

4 minutes ago, Ittaku said:

I'm just pulling numbers out of my arse yet again, but I'll do some listening to see if 78 is better than 30.

Never doubt the accuracy of your a**. Care to share code/command line?

Link to comment
Share on other sites

6 minutes ago, Ittaku said:

It's likely an exponential curve with ever diminishing gains and almost certainly not a binary phenomenon so there is no way of knowing how many taps is "enough" to get the best of this effect.

Definitely.   You can make some very educated guesses like RW did.... and I'm not surprised he ended up saying he ended up at "quality over quantity".

 

Quote

My guess is probably around the 20 bits mark is the sweet spot

Why.   Depending on how you squint at the issue, 16 bits is already excessive for sane signals.... but given the dynamic range of people and systems, also seems like about the right target to aim for to make sure you never get caught out.

Edited by davewantsmoore
Link to comment
Share on other sites

1 hour ago, rmpfyf said:

Never doubt the accuracy of your a**. Care to share code/command line?

sox -V4 input.flac -b 24 output.flac vol -2dB rate -b 99.9999 -d 32 -c 2147483647 88200


You'll have to hack sox to accept a higher bw_3dB_pc (max is normally 99.7) and there were a couple of overflows in some stack arrays that need to be expanded to cope. I hacked a few of these defaults into it to save me manually entering 32 bits and 2^31 and so on, but I've given you all the required command line options for the 30m taps.

 

Debug output:

/usr/bin/sox DBUG effects_i_dsp: make_lpf(n=30150865 Fc=0.4999996 β=21.1104 ρ=0.5 dc-norm=0 scale=1)
/usr/bin/sox DBUG rate: fir_len=30150865 dft_length=67108864 Fp=0.9999982171310080 Fs=1.000000 Fn=2.000000 att=198.68 2/1

 

Use -b 99.99996 for 78 million taps. After that you get overflows galore and it needs a major overhaul.

 

EDIT: Left out the -2dB adjustment above

Edited by Ittaku
  • Like 1
Link to comment
Share on other sites



  • Recently Browsing   0 members

    • No registered users viewing this page.




×
×
  • Create New...
To Top