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: Improving the sound color of linear interpolation (Read 4117 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Improving the sound color of linear interpolation

Hello. As I already said in other topics, I think linear interpolation greatly improves the sound of lower sampling rates (for example 11025Hz). But, linear interpolation is not perfect. On some sounds, I can feel the lack of the ideal brightness, and I want to have another option with higher brightness. Zero-order hold is brighter, but because it's reflections of low frequencies are very loud, it sounds bad to my ears in most cases. So, I want to improve linear interpolation by increasing the trebles. I made it sound better with TDR Nova (10kHz, 15dB, 0.6q, 3.option sounds good for 11025Hz), but I want a perfect algorithm. Here's my wishes:

1: I want a roughly flat frequency response between 0Hz and the Nyquist frequency (not a roughly flat boost).

2: I want two different options for brightenings of anything higher than the Nyquist frequency: a mild one (should give about 6dB boost on 3x the Nyquist frequency) and a strong one (should give about 12dB boost on 3x the Nyquist frequency). Of course, their frequency responses should differ more in the higher frequencies, and their frequency responses should differ very slightly or not differ below the Nyquist frequency.

3: When comparing the same points of two different hills, the point of the hill that is at the higher frequency should not exceed the point of the other hill (in the frequency response, not the boost).

4: The frequency response should never exceed 0dB at any point.

5: From 0Hz to the sampling frequency, the level of a frequency should not exceed the level of a lower frequency (in the frequency response).

6: I want a smooth boost curve.

7: I want a lightweight algorithm, if possible.

8: I want to see both the boost curves and the frequency response curves of the both modes.

How can I find or make a such algorithm?

Re: Improving the sound color of linear interpolation

Reply #1
Here is a paper on more or less that exact topic:

Quote
This paper discusses piece-wise polynomial interpolators used in audio resampling
and presents new low-order designs that are optimized for high-quality resampling
of oversampled audio. Source code and useful tables for using the interpolators are
included

https://yehar.com/blog/wp-content/uploads/2009/08/deip.pdf

You can see each interpolator compared to linear and pick the one you want. 

Re: Improving the sound color of linear interpolation

Reply #2
Here is a paper on more or less that exact topic:

Quote
This paper discusses piece-wise polynomial interpolators used in audio resampling
and presents new low-order designs that are optimized for high-quality resampling
of oversampled audio. Source code and useful tables for using the interpolators are
included

https://yehar.com/blog/wp-content/uploads/2009/08/deip.pdf

You can see each interpolator compared to linear and pick the one you want. 

Thanks, but I could not see anything brighter than linear interpolation.

Re: Improving the sound color of linear interpolation

Reply #3
Here is a paper on more or less that exact topic:

Quote
This paper discusses piece-wise polynomial interpolators used in audio resampling
and presents new low-order designs that are optimized for high-quality resampling
of oversampled audio. Source code and useful tables for using the interpolators are
included

https://yehar.com/blog/wp-content/uploads/2009/08/deip.pdf

You can see each interpolator compared to linear and pick the one you want. 

Thanks, but I could not see anything brighter than linear interpolation.

What does that mean?

Re: Improving the sound color of linear interpolation

Reply #4
Here is a paper on more or less that exact topic:

Quote
This paper discusses piece-wise polynomial interpolators used in audio resampling
and presents new low-order designs that are optimized for high-quality resampling
of oversampled audio. Source code and useful tables for using the interpolators are
included

https://yehar.com/blog/wp-content/uploads/2009/08/deip.pdf

You can see each interpolator compared to linear and pick the one you want. 

Thanks, but I could not see anything brighter than linear interpolation.

What does that mean?

Brighter means has more trebles.

Re: Improving the sound color of linear interpolation

Reply #5
I can certainly understand that if your source is
Hello. As I already said in other topics, I think linear interpolation greatly improves the sound of lower sampling rates (for example 11025Hz). But, linear interpolation is not perfect. On some sounds, I can feel the lack of the ideal brightness, and I want to have another option with higher brightness. Zero-order hold is brighter, but because it's reflections of low frequencies are very loud, it sounds bad to my ears in most cases. So, I want to improve linear interpolation by increasing the trebles. I made it sound better with TDR Nova (10kHz, 15dB, 0.6q, 3.option sounds good for 11025Hz), but I want a perfect algorithm. Here's my wishes:

You EQ it up at 10 kHz and then sample at 11025 killing everyting above 5.5k - and complain that it has little treble?

Suggestion: have a look into perceptual noise substitution. ( https://www.audiolabs-erlangen.de/content/resources/aesCodingTutorial/pns.html , https://ccrma.stanford.edu/~kapilkm/422/Audio%20Compression%20using%20Entropy%20Coding%20and%20PNS-1.pdf )
In principle you can code up something that does the following:
 * Scan the original audio. Get an idea of the levels of the frequency bands.
 * Upon encoding, replace everything above 5.5 kHz with "put noise at <volume> instead". AAC (and IIRC, Musepack in the "radio" settings) can generate that "for cheap" in terms of storage.
 * ... and of course that is distortion, but it preserves part of the original signal (the frequency response). But once you are doing that, you can boost the 10 kHz range.

(Or, use an EQ upon playback?)


Re: Improving the sound color of linear interpolation

Reply #6
I can certainly understand that if your source is
Hello. As I already said in other topics, I think linear interpolation greatly improves the sound of lower sampling rates (for example 11025Hz). But, linear interpolation is not perfect. On some sounds, I can feel the lack of the ideal brightness, and I want to have another option with higher brightness. Zero-order hold is brighter, but because it's reflections of low frequencies are very loud, it sounds bad to my ears in most cases. So, I want to improve linear interpolation by increasing the trebles. I made it sound better with TDR Nova (10kHz, 15dB, 0.6q, 3.option sounds good for 11025Hz), but I want a perfect algorithm. Here's my wishes:

You EQ it up at 10 kHz and then sample at 11025 killing everyting above 5.5k - and complain that it has little treble?

Suggestion: have a look into perceptual noise substitution. ( https://www.audiolabs-erlangen.de/content/resources/aesCodingTutorial/pns.html , https://ccrma.stanford.edu/~kapilkm/422/Audio%20Compression%20using%20Entropy%20Coding%20and%20PNS-1.pdf )
In principle you can code up something that does the following:
 * Scan the original audio. Get an idea of the levels of the frequency bands.
 * Upon encoding, replace everything above 5.5 kHz with "put noise at <volume> instead". AAC (and IIRC, Musepack in the "radio" settings) can generate that "for cheap" in terms of storage.
 * ... and of course that is distortion, but it preserves part of the original signal (the frequency response). But once you are doing that, you can boost the 10 kHz range.

(Or, use an EQ upon playback?)



I EQ it up at 10kHz after sampling at 11025Hz, so there's lots of sounds above 5512.5Hz.

Re: Improving the sound color of linear interpolation

Reply #7
I can certainly understand that if your source is
Hello. As I already said in other topics, I think linear interpolation greatly improves the sound of lower sampling rates (for example 11025Hz). But, linear interpolation is not perfect. On some sounds, I can feel the lack of the ideal brightness, and I want to have another option with higher brightness. Zero-order hold is brighter, but because it's reflections of low frequencies are very loud, it sounds bad to my ears in most cases. So, I want to improve linear interpolation by increasing the trebles. I made it sound better with TDR Nova (10kHz, 15dB, 0.6q, 3.option sounds good for 11025Hz), but I want a perfect algorithm. Here's my wishes:

You EQ it up at 10 kHz and then sample at 11025 killing everyting above 5.5k - and complain that it has little treble?

Suggestion: have a look into perceptual noise substitution. ( https://www.audiolabs-erlangen.de/content/resources/aesCodingTutorial/pns.html , https://ccrma.stanford.edu/~kapilkm/422/Audio%20Compression%20using%20Entropy%20Coding%20and%20PNS-1.pdf )
In principle you can code up something that does the following:
 * Scan the original audio. Get an idea of the levels of the frequency bands.
 * Upon encoding, replace everything above 5.5 kHz with "put noise at <volume> instead". AAC (and IIRC, Musepack in the "radio" settings) can generate that "for cheap" in terms of storage.
 * ... and of course that is distortion, but it preserves part of the original signal (the frequency response). But once you are doing that, you can boost the 10 kHz range.

(Or, use an EQ upon playback?)



I EQ it up at 10kHz after sampling at 11025Hz, so there's lots of sounds above 5512.5Hz.

Do you mean EQ it after upsampling from 11025 to something higher?  You could not apply 10k EQ to an 11025 Hz signal for obvious reasons. 

Regardless I think you are going about this the wrong way.  Upsample first using accurate resampler to preserve maximum high frequency information, then once everything is safely at the higher sampling rate look into spectral extension DSPs.  This will work much better.

Re: Improving the sound color of linear interpolation

Reply #8
I can certainly understand that if your source is
Hello. As I already said in other topics, I think linear interpolation greatly improves the sound of lower sampling rates (for example 11025Hz). But, linear interpolation is not perfect. On some sounds, I can feel the lack of the ideal brightness, and I want to have another option with higher brightness. Zero-order hold is brighter, but because it's reflections of low frequencies are very loud, it sounds bad to my ears in most cases. So, I want to improve linear interpolation by increasing the trebles. I made it sound better with TDR Nova (10kHz, 15dB, 0.6q, 3.option sounds good for 11025Hz), but I want a perfect algorithm. Here's my wishes:

You EQ it up at 10 kHz and then sample at 11025 killing everyting above 5.5k - and complain that it has little treble?

Suggestion: have a look into perceptual noise substitution. ( https://www.audiolabs-erlangen.de/content/resources/aesCodingTutorial/pns.html , https://ccrma.stanford.edu/~kapilkm/422/Audio%20Compression%20using%20Entropy%20Coding%20and%20PNS-1.pdf )
In principle you can code up something that does the following:
 * Scan the original audio. Get an idea of the levels of the frequency bands.
 * Upon encoding, replace everything above 5.5 kHz with "put noise at <volume> instead". AAC (and IIRC, Musepack in the "radio" settings) can generate that "for cheap" in terms of storage.
 * ... and of course that is distortion, but it preserves part of the original signal (the frequency response). But once you are doing that, you can boost the 10 kHz range.

(Or, use an EQ upon playback?)



I EQ it up at 10kHz after sampling at 11025Hz, so there's lots of sounds above 5512.5Hz.

Do you mean EQ it after upsampling from 11025 to something higher?  You could not apply 10k EQ to an 11025 Hz signal for obvious reasons. 

Yes, of course. To 44100Hz with linear interpolation.

Re: Improving the sound color of linear interpolation

Reply #9
Here is a paper on more or less that exact topic:

Quote
This paper discusses piece-wise polynomial interpolators used in audio resampling
and presents new low-order designs that are optimized for high-quality resampling
of oversampled audio. Source code and useful tables for using the interpolators are
included

https://yehar.com/blog/wp-content/uploads/2009/08/deip.pdf

You can see each interpolator compared to linear and pick the one you want. 

I want to try some of the interpolators written in this document, how can I do that (MultiResampler only supports ZOH, linear, cubic, and sinc)?

Re: Improving the sound color of linear interpolation

Reply #10
Here is a paper on more or less that exact topic:

Quote
This paper discusses piece-wise polynomial interpolators used in audio resampling
and presents new low-order designs that are optimized for high-quality resampling
of oversampled audio. Source code and useful tables for using the interpolators are
included

https://yehar.com/blog/wp-content/uploads/2009/08/deip.pdf

You can see each interpolator compared to linear and pick the one you want. 

I want to try some of the interpolators written in this document, how can I do that (MultiResampler only supports ZOH, linear, cubic, and sinc)?

The paper gives the code for each interpolator (see section 6), but you have to be able to program to use it yourself. 

Re: Improving the sound color of linear interpolation

Reply #11
Seems like you has fallen down to the placebo perception self lying for listening a bunch of aliased signals.
I recommend you to use (if you use foobar2000) a component that ads something living to the high frequencies content, that is the component called Noise sharpening (foo_dsp_delta).
Regards.

Re: Improving the sound color of linear interpolation

Reply #12
Am I confused? The resamplers in saratoga's link seem to target transparency. Klymins' goal is to introduce noise.

Re: Improving the sound color of linear interpolation

Reply #13
The paper gives the code for each interpolator (see section 6), but you have to be able to program to use it yourself. 

Thanks.

Seems like you has fallen down to the placebo perception self lying for listening a bunch of aliased signals.
I recommend you to use (if you use foobar2000) a component that ads something living to the high frequencies content, that is the component called Noise sharpening (foo_dsp_delta).
Regards.

It's absolutely not placebo. Here's how I first noticed this: I ripped the music of a flash game and played in it a player but noticed it sounds bad. Then I ran the game and noticed it sounds very good. Back then I didn't know what causes that and I though Flash Player processes the sound in a magical way to improve it. Now I see the reality is the opposite: Modern players and mixers process the sound to make it muffled and dull. Ruffle (flash emulator) uses linear interpolation too, though it has a problem with sampling rates of MP3's ( https://github.com/ruffle-rs/ruffle/issues/18389 ).

This DSP does not add anything beyond the nyquist point, though it sounds good when placed after the resampler (linear interpolation) but I can't use it for anything unless I know how does it work exactly.

Have you really compared linear interpolation with something stronger?
(You can do this by either using MultiResampler with foobar or ripping a music from a flash game and comparing it to what does it sound like in the game. If you want to do the latter, I can recommend a flash game that uses 11025Hz MP3's: https://archive.org/details/tails-nightmare (Ruffle doesn't show the visual effects but it plays the sound correctly).)

Am I confused? The resamplers in saratoga's link seem to target transparency. Klymins' goal is to introduce noise.

You're right while I think your choices of words are wrong (I think "transparency" is relative in this context and my goal is to indroduce rich reflections, not noise), but I want to try them because I wonder what do they sound like (especially lagrange).

Re: Improving the sound color of linear interpolation

Reply #14
@Klymins I'll point out that linear interpolation can also smear transits and cause things to become slightly muffled.  32 KHz to 44.1 KHz for example.  The point is that kind of interpolation is crap as it adds crap that's not even there to begin with.  It's used because it tends to be quite fast.  What you're hearing with better re-sampling is what the audio actually sounds like with nothing added, which is going to be muffled because the sampling rate is not enough in that case.  DirectX for example uses linear interpolation because it is very fast and that's important for games (the fact is it needs to be quite fast and the lowest possible latency) not because it provides a better audio experience for lower sampling rates.  Developers want to save space and so one of the ways they do it is to drop the quality of the recording used and many developers will exploit the shortcomings of any platform to their advantage even if it is technically wrong to do so.  These people know exactly what they're doing.  You'd be quite surprised how developers will use various kind of tricks and techniques to get a game to do what they want it to do based on what a platform allows or is capable of.

You like noise and distortion and that's it.  There's nothing to improve here.  You can play around with filters and very low quality interpolation all day long everyday for the rest of your life.  The real improvement came in not actually adding crap that wasn't there (or that muffled sound you don't like).

Re: Improving the sound color of linear interpolation

Reply #15
@Klymins I'll point out that linear interpolation can also smear transits and cause things to become slightly muffled.  32 KHz to 44.1 KHz for example.  The point is that kind of interpolation is crap as it adds crap that's not even there to begin with.  It's used because it tends to be quite fast.  What you're hearing with better re-sampling is what the audio actually sounds like with nothing added, which is going to be muffled because the sampling rate is not enough in that case.  DirectX for example uses linear interpolation because it is very fast and that's important for games (the fact is it needs to be quite fast and the lowest possible latency) not because it provides a better audio experience for lower sampling rates.  Developers want to save space and so one of the ways they do it is to drop the quality of the recording used and many developers will exploit the shortcomings of any platform to their advantage even if it is technically wrong to do so.  These people know exactly what they're doing.  You'd be quite surprised how developers will use various kind of tricks and techniques to get a game to do what they want it to do based on what a platform allows or is capable of.

You like noise and distortion and that's it.  There's nothing to improve here.  You can play around with filters and very low quality interpolation all day long everyday for the rest of your life.  The real improvement came in not actually adding crap that wasn't there (or that muffled sound you don't like).

Linear interpolation works very well when the target sampling rate is bigger than and a multiply of the source, which is not the case in 32000Hz to 44100Hz. But I think linear interpolation also works good enough when the target sampling rate is not multiply of the source sampling rate like in your example, though using it together with sinc intepolation works better in these cases.

Re: Improving the sound color of linear interpolation

Reply #16
Regardless I think you are going about this the wrong way.  Upsample first using accurate resampler to preserve maximum high frequency information, then once everything is safely at the higher sampling rate look into spectral extension DSPs.  This will work much better.
I recommend you to use (if you use foobar2000) a component that ads something living to the high frequencies content

After making some experiments with xHE-AAC, I found that I hate the sound color of SBR. (It's a type of the thing that is recommended on the quoted posts, right?) It can sound good in not-so-low bitrates, but I won't prefer anything other than interpolation (as the base extending method) for Flash.

Re: Improving the sound color of linear interpolation

Reply #17
Quote
In psychology, an idée fixe is a preoccupation of mind believed to be firmly resistant to any attempt to modify it, a fixation. The name originates from the French idée [i.de], "idea" and fixe [fiks], "fixed."

Re: Improving the sound color of linear interpolation

Reply #18
+1  ;)