advertisement


Noise Shaping

Is the limit an ALSA one, or somewhere else in the chain?

It's the USB driver and DAC firmware.

Doing over/up/resampling, etc, isn't inherently difficult provided you have some filter values, etc, in mind. So an open source player doing this and tweakable by the user should be possible. Has no-one done anything like this for Linux?

Sox can; but that's command line. I haven't come across a player with a good GUI that enables you to manipulate the various parameters. Squeezelite allows some parameter setting using the sox library. Maybe other players do, but I haven't explored them.

- Richard.
 
It's the USB driver and DAC firmware.



Sox can; but that's command line. I haven't come across a player with a good GUI that enables you to manipulate the various parameters. Squeezelite allows some parameter setting using the sox library. Maybe other players do, but I haven't explored them.

- Richard.


OK. So the limit you referred to is down to the specific USB DACs requirement for a 'driver'? (i.e. it isn't compliant with the standard USB Audio Classes) Or?...

I can recall that SoX lets you specify coefficients for a TDA FIR resampling filter. But not if it lets you specify alternative conversion architechtures or Noise Shaping filters. But then I've never looked into that. It does have a 'play' command, but again I've never checked if that lets you use all the other facilities it has! But presumably its libraries, etc, could let a good programmer base something on them.
 
As high as 192?
In the case of HQ player as I understand it is more of a software version of (most of a) delta sigma dac rather than being about playing hirez files as such.
Even if it did make sense I do wonder whether it would be better using some sort of multi bit like most delta sigma dacs, but then you'd have to find a dac to accept the input.

Well, my comment was based on not having ever noticed a difference between lower rates than that! :)

I suspect what might be 'best' in any *player* conversion would depend on the specifics of the DAC hardware. In effect, trying to tweak around any imperfections or limits it has.

As I think I've said before, I'm not personally very keen on 'one bit' anyway. And as has been pointed out, if you have the power and flexibility of a computer program/system then, yes, it probably makes sense to capitalise on the high bit-depths available for all intermediate processing.
 
As per earlier comments I've now written a 'first rough version' of a simple program that will generate a 16bit LPCM wave file from a named 24bit LPCM wave file. This first version has some limitations, and is for RISC OS. However the results agree with the earlier demo when I feed it 24bit input files with test waveforms, etc. e.g. Have a look at

http://jcgl.orpheusweb.co.uk/temp/shaped.png

if interested. Note that the right-hand scale is nominally wrt bits per sample for a white noise background limit. And that in reality I suspect the bulk of 24bit real-world recorded files actually have noise levels around 20bits or higher, anyway!

I'll make a tidied up version of the program (with source code) avalable on the web when I get a chance - fingers crossed, tomorrow sometime. That will let 'C' programmers see the code in its basic form. I'll then do a Linux (ROX) version and maybe add some tweaks, etc.
 
I've now put up an initial demo version of a program that will generate 16bit Noise Shaped files from 24bit ones. It is quite limited and is currently only a RISC OS demo example. But it does include the source code in a version of 'C' along with a 'Help file'. Anyone interested can find it here

http://jcgl.orpheusweb.co.uk/temp/WAVNoiseShaping.zip

All being well, I'll do a Linux/GCC version sometime. But anyone who wants to is welcome to do something better. :)
 
According to http://stackoverflow.com/questions/3578615/mp3-bitrate-detection-through-frequency-spectrum-analysis the frequency cut offs for MP3 depend on presets, so you can check using Audacity the behaviour of your MP3 converter at various bitrates (if it's not configurable). I always recommend VBR with MP3.

The sub-20kHz roll off of MP3 might explain why some people claim MP3 sounds "nicer" than CD.

When I checked using my MP3 converter (soundconverter using lame) 256VBR seemed to be flat to around 19kHz with a not cliff-like roll off above that. I'll probably switch from 192VBR and 256VBR for mobile duty.
 
Hi Jim,

I don't know if this is of any interest but HQPlayer allows user selection of different noise shaping patterns.
Might be worth a listen.

Best,
Ricardo
 
Have been playing with linear versus minimum phase filters lately.

My summary at 44.1kHz
Linear phase: slightly digital and cold on some recordings.
Minimum phase: slightly less sound-stage.

I feel both improve at higher rates i.e. the difference is less.

On the weekend I found this from Archimago http://archimago.blogspot.com/2018/01/musings-more-fun-with-digital-filters.html?m=1

It certainly looks like an additional clever way to close the gap alongside higher rates. The result of moving gradually between linear and minimum phase doesn't seem, well, linear - giving up just a small bit of phase linearity makes a surprising difference in the filter response. Measurements and graphs and stuff as usual from Archimago.

I'll report back on long-term feelings.
 
Maybe someone can point me at an explanation of the 'upsample setting' values that would let me model it. As it stands, the term "v::4:28:95:105:45" means nothing to me. What is the filter design and what are the coefficients, etc?

BTW am I the only person who finds grey text on a midpinkish background almost unreadable? Makes my eyes water to try!

BTW2 If people want a similar graded output a standard well-done sinc DAC followed with an analogue LPF also works. :) FWIW I added a filter to the output of my first (Marantz) CD player and it helped that. Sadly, Toko don't sell decent passive filters any more.
 
Maybe someone can point me at an explanation of the 'upsample setting' values that would let me model it. As it stands, the term "v::4:28:95:105:45" means nothing to me. What is the filter design and what are the coefficients, etc?

BTW am I the only person who finds grey text on a midpinkish background almost unreadable? Makes my eyes water to try!

BTW2 If people want a similar graded output a standard well-done sinc DAC followed with an analogue LPF also works. :) FWIW I added a filter to the output of my first (Marantz) CD player and it helped that. Sadly, Toko don't sell decent passive filters any more.
Jim- I think that squeezelite (which is what arch was using) uses SoX under the hood, so those are probably SoX parameters.
If you are not familar with the SX commands (I'm sure you are) they are
sox.sourceforge.net/soxformat.pdf

If you need more detail can I suggest that you contact Mansr over on Computer Audiophile. He is the current custodian of SoX and a very orthodox engineer. I'm sure he would be able to help with precise filter coefficients for intermediary phase.
 
Maybe someone can point me at an explanation of the 'upsample setting' values that would let me model it. As it stands, the term "v::4:28:95:105:45" means nothing to me. What is the filter design and what are the coefficients, etc?
The resampler is SoX - it's open source. I have never looked at the source code so I don't know how easy it is to understand.

For resampling parameter details, see post #5 at https://forums.slimdevices.com/showthread.php?99088-Upsampling-Impressions and see http://manpages.ubuntu.com/manpages/trusty/man1/squeezelite.1.html.

EDIT: See also from the bottom of page 26 at http://sox.sourceforge.net/sox.pdf

I also have experimented with SoX's upsampling and filtering in picoreplayer on my Raspberry Pi. But I found it makes so little difference that I leave the audio at the original sample rate and leave my DAC to handle it.
 
Jim- I think that squeezelite (which is what arch was using) uses SoX under the hood, so those are probably SoX parameters.
If you are not familar with the SX commands (I'm sure you are) they are
sox.sourceforge.net/soxformat.pdf

If you need more detail can I suggest that you contact Mansr over on Computer Audiophile. He is the current custodian of SoX and a very orthodox engineer. I'm sure he would be able to help with precise filter coefficients for intermediary phase.

Thanks to you and John. :)

Yes, I often use sox for various tasks, so should be able to find out that way. :)

FWIW I've always found the sox code works very well. Although their standard noise shaping wasn't ideal for when I wanted to noise shape keeping the same sample rate.

I'll investigate...
 
If you need more detail can I suggest that you contact Mansr over on Computer Audiophile. He is the current custodian of SoX and a very orthodox engineer. I'm sure he would be able to help with precise filter coefficients for intermediary phase.

I'll have a look. Would I need to sign up to the forum to be able to contact him?

I'd also like to ask about adding resampling control for noise shaping down the bits-per-sample without changing the sample rate. Makes a good alternative to 'MQA'. 8-]
 
I'll have a look. Would I need to sign up to the forum to be able to contact him?

I'd also like to ask about adding resampling control for noise shaping down the bits-per-sample without changing the sample rate. Makes a good alternative to 'MQA'. 8-]
email sent
 
The SoX resampling works well, here are some notes.

Increase bit depth before up-sampling. I did some tests and ISTR some funnies if I didn't do this. Not 100% sure this isn't an LMS-specific interaction though.

gain -6.02059991327962390427
placed before the rate command, this works as a 1 bit down shift according to my file tests.

rate -v -b 89
VHQ, and bandwidth 89 gives an optimally smooth roll off after 19kHz when I eyeball a noise track, this is what I like. I used -b 92.5 for flat to 20kHz.

-p 45
The phase setting Archimago suggests for the rate command

dither
Again IIRC, at >=24 bits you need to tell SoX to do this. It does do it if asked. Make it the last command.
 
PS: What I'm also saying, in a round about way: I expect "-p 45" to have a similar kind of benefit with other filter slopes and rates. (Though personally I prefer non-leaky filters like Archimago.)
 
Mansr is extremely sensible do we know who he is, does he work in the sound reproduction industry ?
Keith
His name, which is no secret, is Måns Rullgård. Have you checked out his troll audio website? I have an impression that he is a professional audio engineer but i'm not sure beyond that.if you send him a pm on CA I'm sure he'll be happy to tell you.
 


advertisement


Back
Top