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: Saracon-like resampler (Read 2744 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Saracon-like resampler

The coeffs folder contains cff files which have the FIR filter coefficients for PCM/DSD to PCM resampling. Byte order is little endian. The cff file has a 16 byte header:
Code: [Select]
uint32_t up
uint32_t down
uint32_t srate
uint32_t N

where up = upsampling rate, down = downsampling rate, srate = source sample rate, N = filter length.
The header is followed by N 64 bit floats which are the coefficients of the filter.

For instance, 44.1-to-48.0-V2.cff is used for 44.1 to 48 kHz conversion, where up = 160, down = 147 (44100*160/147 = 48000), srate = 44100,  N = 23022. You can load the coefficients into MATLAB/Octave and use
Code: [Select]
upfirdn(x, coeff, 160, 147)
to convert the 44.1 kHz input signal x to 48 kHz. The result should be equal to what Saracon produces, except for rounding errors.

Some conversions use multiple stages, 44.1 to 96 kHz is done using 44.1 to 48 kHz and then 48 to 96 kHz, using the appropriate coefficients for each stage.

The coefficients are copyrighted but something similar can be created using an FIR filter design tool. The short filters are equiripple, the long filters look like Kaiser windowed sinc.

Saracon-like resampler

Reply #1
Is this related to any ongoing discussion? Otherwise this will be binned.
It's only audiophile if it's inconvenient.


Saracon-like resampler

Reply #3
44.1 to 48 kHz in Matlab:

Code: [Select]
n = 23022;
p = 160;
q = 147;
fs = 44100*p;

h = fir1(n-1, 22050/(fs/2), kaiser(n, 21.08126));

x = wavread('in.wav');
y = upfirdn(x, h*p, p, q);
wavwrite(single(y), 48000, 32, 'out.wav');

out.wav will be a 32 bit floating point WAV, the samples are bit-exact to what Saracon produces.

The equiripple filters such as the 48 to 96 kHz are harder to recreate exactly but any FIR filter with similar characteristics (passband ripple, transition band, stopband attenuation) will do.

Saracon-like resampler

Reply #4
I've been using a 44.1 to 96 kHz resampler in foobar2000 with a filter similar to Saracon SRC. This is the only supported conversion, the others are passed unmodified and handled another resampler in the DSP plugin chain. This and 44.1 to 192 kHz are probably the most common conversions. If anyone's interested I will make them available.

Saracon-like resampler

Reply #5
Please tell me how any of this stuff is supposed to have people engage in a discussion. Hydrogenaudio is not a pastebin to store your random ideas. Consider this to be the second strike regarding this topic.
It's only audiophile if it's inconvenient.

Saracon-like resampler

Reply #6
Please tell me how any of this stuff is supposed to have people engage in a discussion. Hydrogenaudio is not a pastebin to store your random ideas. Consider this to be the second strike regarding this topic.


I'm sorry if my posts are not worthy of further discussion, I thought someone might be interested on how an expensive sample rate converter works. I believe this is not a random idea since I've spent hours studying the Saracon filters and implementing a foobar2000 DSP plugin based on that.

If you are right and there is no interest in this topic, you may delete this thread.

Is this related to any ongoing discussion? Otherwise this will be binned.

I didn't know this was a warning, didn't realize binned was a typo for banned.