• Welcome to ASR. There are many reviews of audio hardware and expert members to help answer your questions. Click here to have your audio equipment measured for free!

The Perfect CD Sample Rate Converter (Shannon Interpolation)

Just to be clear, I am not some audiophile voodoo guru. I take "high fidelity" literally—my goal with the DSP isn't to "enhance," "repair," or alter the sound in any way. I explicitly want errors and flaws to be reproduced as purely as possible, without adding any unnecessary ones myself, no matter how trivial.
Don’t get me wrong, I can appreciate the technical achievement for sure. I just question the practical point of all of this.
 
In music production you often need to resample from different sampling rates into the project rate, at which point you start doing some amount of DSP. So I could imagine this algorithm being used for final rendering steps in a DAW or something.
This is totally impractical for audio production, other than the final export.

This isn’t something you can practically do in real-time, because for this to work you need both the full future and past for every sample available. Fine if the file already exists, not if it being made on the fly.
 
This is totally impractical for audio production, other than the final export.

This isn’t something you can practically do in real-time, because for this to work you need both the full future and past for every sample available. Fine if the file already exists, not if it being made on the fly.
Yes, which is why I mentioned final rendering. IME in a DAW while working, these days you use a low-tier Sinc interpolation to keep your CPU from catching on fire. :)

Even for final export I could imagine this being too slow, but I do think it's interesting in an academic sense.
 
Even for final export I could imagine this being too slow, but I do think it's interesting in an academic sense.
Besides, a final export would usually do downsampling ;)

As to that question: you’ll still need a brick wall filter for this to work, making the use of the algo for downsampling rather pointless.

Which brings me to another interesting point: the upsampling works perfectly for a correctly bandwidth limit source. Sadly with modern music and highly compressed mastering, this isn’t always the case. I’m not sure what side effects this will have, but I’m sure there will be something.
 
Depends, if you are using a sampler and pitching samples up and down, you might need both
That doesn’t sound like final export ;) Besides, pitch correction is a whole different ballgame to the 2x upsampling.
 
Don’t get me wrong, I can appreciate the technical achievement for sure. I just question the practical point of all of this.

Besides, a final export would usually do downsampling ;)

As to that question: you’ll still need a brick wall filter for this to work, making the use of the algo for downsampling rather pointless.

Which brings me to another interesting point: the upsampling works perfectly for a correctly bandwidth limit source. Sadly with modern music and highly compressed mastering, this isn’t always the case. I’m not sure what side effects this will have, but I’m sure there will be something.
Right now, Im working on a Multi SRC Version for 16, 24, 32, 32 float, 64 float Input

44.1, 48, 88.2, 96, 176.4, 192 Version for every case (up and down sampling)
 
@JulianW I'm sorry you're getting so many comments about nowy this is useless or a waste or whatever. I think it's a very interesting theoretical exercise in precision. Although I tend to agree there is no practical application for most home listeners, I still think it's cool that this exists.

Well said. Whenever I see something like this, and wonder why I would even need such a thing, the answer is probably: it's a failure of my imagination. The practical benefits may not be so obvious. I did not even think that processing biquads at a higher sample rate reduces frequency warping, especially for higher frequencies - as @JulianW pointed out. So thank you, I have learnt something today.
 
That doesn’t sound like final export ;) Besides, pitch correction is a whole different ballgame to the 2x upsampling.
I can't claim to know exactly how it works under the hood, but I think FL Studio (what I'm familiar with, AFAIK other DAWs are similar) does resampling in realtime using one algorithm (including for pitching up and down, I guess) and applies whatever algorithm you select at final render / export to repeat the same processes at a higher quality. More than once I've actually noticed some sounds actually came out wrong on final render because the ("nice") artifacts I heard using the 'cheap' algorithm while working went away at render time.
 
wrt my questioning, definitely not just failure of my imagination but self aware of and open about my sheer ignorance

Not just trying to understand how a new tool might fit into my use cases, but asking questions simply to increase my understanding.

Even if "only" exploration of new ground "for science" that is indeed admirable
 
wrt my questioning, definitely not just failure of my imagination but self aware of and open about my sheer ignorance

Not just trying to understand how a new tool might fit into my use cases, but asking questions simply to increase my understanding.

Even if "only" exploration of new ground "for science" that is indeed admirable
There’s really no magic or scientific breakthrough involved here. It’s simply the pure Shannon interpolation formula applied to the complete finite file, without windowing, without blockwise truncation of the sinc, and therefore without introducing an arbitrary transition band.


The additional part is numerical rigor: the interpolated values are computed with sufficient precision to determine their correctly rounded IEEE-754 binary64 values — i.e. the correct points on the 64-bit floating-point “grid.”


So the idea isn’t to invent a new resampling theory. It’s essentially the opposite: take the textbook Shannon interpolation as literally as practical and avoid the usual engineering approximations that are useful for making conventional SRCs finite and fast.
 
Shannon Exact64 — Quick Start


No installation is required.
No Visual Studio, runtime, or additional software is needed.


  1. Download ShannonExact64.exe.
  2. Drag and drop a 44.1 kHz / 16-bit stereo WAV file onto the EXE.
  3. Do not press Enter or click anything while SRC is running. Processing can take some time — this is normal and does not mean the application has frozen.
  4. When finished, the 88.2 kHz / 64-bit float WAV and _LOG.txt will appear in the same folder as the original WAV.

That’s it. Do not double-click the EXE — drag the WAV onto it instead.

https://drive.google.com/drive/folders/11l4urcGNRxS_3lqxpRJt7nOcFVn89gs0?usp=sharing
 
Thank you for sharing ring your work. Hopefully we can see an opportunity to implement it as it evolves.
 
I use Jriver to upsample 44.1 to 88.2. I listen to music using Jriver. what's the difference between Jriver upsampling and this Software? Can I hear the difference between the two?
 
There’s really no magic or scientific breakthrough involved here. It’s simply the pure Shannon interpolation formula applied to the complete finite file, without windowing, without blockwise truncation of the sinc, and therefore without introducing an arbitrary transition band.


The additional part is numerical rigor: the interpolated values are computed with sufficient precision to determine their correctly rounded IEEE-754 binary64 values — i.e. the correct points on the 64-bit floating-point “grid.”


So the idea isn’t to invent a new resampling theory. It’s essentially the opposite: take the textbook Shannon interpolation as literally as practical and avoid the usual engineering approximations that are useful for making conventional SRCs finite and fast.
How is what you are doing different from PGGB? My pea brain understanding is that you are doing pretty much the same thing, but you have some clever tricks to make computations a lot faster.
 
How is what you are doing different from PGGB? My pea brain understanding is that you are doing pretty much the same thing, but you have some clever tricks to make computations a lot faster.
PGGB is a resampler that aims for extremely high numerical accuracy, whereas Exact64 targets one explicitly defined Shannon reconstruction and certifies every result to the correctly rounded binary64 value.
PGGB is a precision instrument; Exact64 is a mathematical ruler that refuses to have any markings between the exact answer and the last bit binary64 can represent.
 
PGGB is a resampler that aims for extremely high numerical accuracy, whereas Exact64 targets one explicitly defined Shannon reconstruction and certifies every result to the correctly rounded binary64 value.
PGGB is a precision instrument; Exact64 is a mathematical ruler that refuses to have any markings between the exact answer and the last bit binary64 can represent.
I sincerely appreciate the reply, but I still do not get it. I thought both have the goal of using as close to a perfect brick wall as can be done with a certain precision. Are you saying PGGB is less precise than Exact64, or that PGGB would give something other than a perfect brick wall no matter what precision it uses?
 
I sincerely appreciate the reply, but I still do not get it. I thought both have the goal of using as close to a perfect brick wall as can be done with a certain precision. Are you saying PGGB is less precise than Exact64, or that PGGB would give something other than a perfect brick wall no matter what precision it uses?
The algorithm @JulianW uses does not do brickwall filtering, which makes it operate fairly differently from the more traditional upsamplers. Where traditional upsamplers approximate the ideal, Shannon interpolation is the ideal (within the confines of the math precision).
 
The algorithm @JulianW uses does not do brickwall filtering, which makes it operate fairly differently from the more traditional upsamplers. Where traditional upsamplers approximate the ideal, Shannon interpolation is the ideal (within the confines of the math precision).
Maybe I should give up because I don't understand the math or coding. But how is it possible to get a single solution for values between the original samples without implementing a filter in some way.
 
Back
Top Bottom