Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: SSRC 1.31 (Read 24542 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

SSRC 1.31

Does anyone still have interest in SSRC sampling rate converter?
I released a new version 1.31, 10 years after the last release.

In this release, the FFT subroutine is replaced and conversion is now 2 times as fast as the last version on computers with AVX instructions. On computers with Atom CPU, the new version is around 50% faster.

http://shibatch.sourceforge.net

Re: SSRC 1.31

Reply #1
Hello Naoki! Long time not seen. I hope you are fine.
I sometimes used SSRC and others do most likely without knowing build in their software.
In case you did miss it, foobar and dbpoweramp use the resampling based on your code but with slightly changed lowpass behaviour.
At http://src.infinitewave.ca/ you can compare these. People found the SSRC filter was to much on the edge.
Also our member bandpass reported a bug for upsampling but i can't find the post anymore.

Edit: found the post https://hydrogenaud.io/index.php/topic,99286.msg824292.html#msg824292
Is troll-adiposity coming from feederism?
With 24bit music you can listen to silence much louder!

Re: SSRC 1.31

Reply #2
Thank you for your comment.
I need to know the condition on which the bug can be reproduced.
Is it ssrc_hp? If so, that bug is probably the one I fixed in this release.

I have another question: does ssrc in foobar use double precision calculation?
It is hard to achieve >130dB SNR with single precision FFT.
It could be possible if the parameters are set carefully, though.

Re: SSRC 1.31

Reply #3
I am of no help here, sorry. spoon for dbpoweramp and bandpass may tell us.
I know that may be asked to much but one of the reasons i like SoX resampling is the option to avoid dither on silence. SoX offers your noise shapes so you may use their silence detection?
Is troll-adiposity coming from feederism?
With 24bit music you can listen to silence much louder!

Re: SSRC 1.31

Reply #4
Silence detection is easy.
Several people sent me e-mails complaining that SSRC does not read/write proper WAV files.

Re: SSRC 1.31

Reply #5
Here are some observations of 44100 -> 96000 with SSRC v1.31 (using SoX v14.4.2 as a reference):



Code: [Select]
#!/bin/sh
set -e

[ $# -eq 1 ] || {
        for n in `seq 0 5`; do $0 $n; done
        convert -delay 400 [0-5].png sox-ssrc.gif
        exit
}

case `expr $1 % 2` in
        0) z=150; t=SoX-HQ/SSRC;;
        1) z=180; t=SoX-VHQ-steep/SSRC_HP; sox=-vs; ssrc=_hp;;
esac

synth="sox -r44100 -n -t wavpcm 0.wav synth"
X=20
case `expr $1 / 2` in
        0) sig=Tone;  $synth 20 sin 6k                 gain -2 fade h 2 0 2;;
        1) sig=Sweep; $synth 64 sin 0:88200 trim 30 20 gain -2 fade h 2 0 2;;
        2) sig=Ringing; $synth 1s sq pad .12 .12; X=1667;;
esac

sox 0.wav 1.wav rate $sox 96000
./ssrc$ssrc --rate 96000 0.wav 2.wav > /dev/null
sox -M [12].wav -n spectrogram -X$X -hwk -z$z -t"$sig $t" -o $1.png
rm [012].wav

Re: SSRC 1.31

Reply #6
This is interesting.
It basically shows that the artifact noise level is under -110 or -120dB, which is good.
As you know, even -96dB noise floor of CD quality sound cannot be easily heard by people with average hearing, even with good equipment.
For the ringing, the noise is present only at around 22kHz range, which is what it should be. The noise level is also very low.
I would say that small noise is overly exaggerated in these figures.
Last night, I tested the latest version of SoX a little, and it looks like the default setting of SoX resampling is not linear phase. That can cause other problems. I would prefer SSRC over SoX, with their default settings.

Re: SSRC 1.31

Reply #7

Last night, I tested the latest version of SoX a little, and it looks like the default setting of SoX resampling is not linear phase. That can cause other problems. I would prefer SSRC over SoX, with their default settings.

But the ringing of SSRC seems to be much larger (on those graphs and also here http://sox.sourceforge.net/rate-44k1-96k.png ) that SoX's.

Re: SSRC 1.31

Reply #8
Okay, I need to explain what it means.
You are basically just seeing the signal in the digital domain.
When that signal is converted to analog, that signal will become continuous, and that means that there are non-zero voltage between samples.
The resulting analog signal is the sum of all samples, and each sample corresponds to a sinc function.
When you see a few samples in digital domain, you don't see the signal between samples, because at those positions, sinc function becomes zero.
When you resample the signal, the non-zero voltage between samples become visible in digital domain. That is these ringing.
So, it is that you are not seeing the signal between samples, but it is present before resampling.
Sox is just pruning away this signal.

Re: SSRC 1.31

Reply #9
Okay, I need to explain what it means.
You are basically just seeing the signal in the digital domain.
When that signal is converted to analog, that signal will become continuous, and that means that there are non-zero voltage between samples.
The resulting analog signal is the sum of all samples, and each sample corresponds to a sinc function.
When you see a few samples in digital domain, you don't see the signal between samples, because at those positions, sinc function becomes zero.
When you resample the signal, the non-zero voltage between samples become visible in digital domain. That is these ringing.
So, it is that you are not seeing the signal between samples, but it is present before resampling.
Sox is just pruning away this signal.

So it means that the SoX "shorter ringing" is not an advantage ? And what about its audibility ?

Re: SSRC 1.31

Reply #10
And one more question. Does the setting of ssrc_hp

4 : less dither amplitude than type 3

correspond to SoX's low-shibata dither curve?

Thank you

Re: SSRC 1.31

Reply #11
This is 22kHz pseudo artifact, right?
And duration is very short. Intensity is also small.
I cannot say there is absolutely no person who can hear the difference, but if there is, I would say that the filters in the DAC is not properly configured.


Re: SSRC 1.31

Reply #13
I would say that small noise is overly exaggerated in these figures.
Yes, the conversion to animated-gif (limited number of colours) lost some precision in the graphs—if you can run the script, the original PNGs should be more accurate.

What looks odd to me is the vertical lines at roughly half-second intervals in the SSRC tone & sweep graphs.  Unlikely to be audible as you say, but I've not seen anything like that before that wasn't due to an implementation error.  Of course, if they are intentional, then nothing to worry about; otherwise I'd be concerned that the problem might manifest itself less benignly under other conditions.

Quote
Last night, I tested the latest version of SoX a little, and it looks like the default setting of SoX resampling is not linear phase.
SoX should be linear phase by default; so perhaps a typo in the command line, or a stored setting in a GUI?

Re: SSRC 1.31

Reply #14
And not to forget: thank you N. Shibata for keeping SSRC alive, regardless of any debates about it !  ;)

Re: SSRC 1.31

Reply #15
Yes, the conversion to animated-gif (limited number of colours) lost some precision in the graphs—if you can run the script, the original PNGs should be more accurate.

What I meant is that noise under -100dB should not be indicated in conspicuous colors.
Noise at this level is almost inaudible.

Quote
What looks odd to me is the vertical lines at roughly half-second intervals in the SSRC tone & sweep graphs.  Unlikely to be audible as you say, but I've not seen anything like that before that wasn't due to an implementation error.  Of course, if they are intentional, then nothing to worry about; otherwise I'd be concerned that the problem might manifest itself less benignly under other conditions.

There are many possibility as to the origin of this noise. Very slight difference in floating point calculation can result in this kind of noise.  What I was actually concerning was the noise or error introduced by single precision calculation of FFT. But it looks like there is no problem with FFT precision.

Quote
SoX should be linear phase by default; so perhaps a typo in the command line, or a stored setting in a GUI?

I need to check this again. There are too many command line options.
I cannot find the explanation for -v -M and -I options in http://sox.sourceforge.net/sox.html




Re: SSRC 1.31

Reply #19
-v option does VHQ resampling and that is linear by default.

By default, all algorithms have a ‘linear’ phase response; for ‘medium’, ‘high’ and ‘very high’, the phase response is configurable (see below).

http://sox.sourceforge.net/sox.html

Re: SSRC 1.31

Reply #20
By the way, which command line of SSRC_HP do you recommend for converting to CD 16/44.1?

ssrc_hp.exe --rate 44100 --bits 16 --dither 4 input output ?

I prefer as low dither noise as possible/adequate.


edit: should have added --tpdf 1.

Re: SSRC 1.31

Reply #21
What looks odd to me is the vertical lines at roughly half-second intervals in the SSRC tone & sweep graphs.  Unlikely to be audible as you say, but I've not seen anything like that before that wasn't due to an implementation error.  Of course, if they are intentional, then nothing to worry about; otherwise I'd be concerned that the problem might manifest itself less benignly under other conditions.

Indeed, 22050 -> 192000 resampling results in very audible clicks:
Quote
>ssrc_hp.exe --rate 192000 input.wav output.wav
Shibatch sampling rate converter version 1.31(high precision)

frequency : 22050 -> 192000
attenuation : 0dB
bits per sample : 24 -> 24
nchannels : 1
length : 661500 bytes, 10 secs
dither type : none

Re: SSRC 1.31

Reply #22
So it means that the SoX "shorter ringing" is not an advantage ? And what about its audibility ?
There are different theories what is best to use for resampling.
SSRC keeps the complete signal up to 22kHz and creates a strong ringing only there around 22kHz. Every DAC that plays back 44.1kHz material has his own lower, softer cut off. So what you will (theoretical) hear on playback can only be the DACs ringing.
For upsampling it is different.
Is troll-adiposity coming from feederism?
With 24bit music you can listen to silence much louder!

Re: SSRC 1.31

Reply #23
So it means that the SoX "shorter ringing" is not an advantage ? And what about its audibility ?
There are different theories what is best to use for resampling.
SSRC keeps the complete signal up to 22kHz and creates a strong ringing only there around 22kHz. Every DAC that plays back 44.1kHz material has his own lower, softer cut off. So what you will (theoretical) hear on playback can only be the DACs ringing.
For upsampling it is different.

Thanks for explaining, from what you wrote the DACs performs in such a way that SSRC's "bigger ringing" is outside the range that is kept by majority of DACs.

Re: SSRC 1.31

Reply #24
Yes. Regarding that thread i guess we let the chosen ones better the SSRC code. I doubt Naoki came here to ask what setting for resampling jjf5 prefers.
Is troll-adiposity coming from feederism?
With 24bit music you can listen to silence much louder!