[sdiy] saw vs ramp, audible?

René Schmitz synth at schmitzbits.de
Tue Dec 10 18:18:13 CET 2024


Am 10.12.2024 um 15:34 schrieb Roman Sowa:
> I regret to admit that I hear the difference too. One direction seems 
> to have more lower end than the other. I thought maybe mp3 conversion 
> messed up something so I generated super clean totally harmonic 96Hz 
> ramps and the difference is not as aparent but still there. The 
> difference disappears however if volume is turned lower than "slightly 
> anoying". Maybe the way my desk (and belly) is shaken by the sound 
> also matters.
> Before that I made 441Hz test and there was no audible difference at 
> any loudness.
> I think it's because 10ms between saw edges (like in 100Hz) is pretty 
> close to 17ms threshold of perceiving sound as separate events rather 
> than a tone.
>
If you'd asked me two days ago, I would have said no, this can't be. I 
notice too that this depends on volume. It needs to be a beefy listening 
volume.

If anyone is interested, I can post the wav file.


> Here's another one:
> Play 2 pure sine waves one octave apart. Then add some phase delay 
> between them. They sound different. The only explanation I can imagine 
> is distortion in whole audio chain and my ears (probably mostly ears).
> Looks like phase sensitivity is a lot more complex phenomenon than 
> just perception of direction of the sound source.

This affects the crest factor, so peaks could start clipping earlier, 
when the peaks of the sine align.


Best,

  René

>
> Roman
>
> W dniu 2024-12-10 o 14:22, René Schmitz pisze:
>> I found that that raw aliased oscillator tended to mask the effect 
>> for me. Really couldn't hear it.
>>
>> Today I've done some experiments, using an anti-aliased oscillator 
>> (well, polyblep).
>>
>> I've encoded the output with mp3 (stereo, 320k), I can still hear it 
>> even after the encoding, on headphones as well as speakers. So the 
>> influence of the equipment in the chain is probably not that big.
>>
>> To rule out that the transients play a significant role, I added fade 
>> in and fade out.
>>
>> I find that it works better for lower frequencies. Above 500Hz-1kHz I 
>> can't hear any difference.
>>
>> Could be a clue as to what is going on. Maybe the perceived 
>> difference is due to the relative arrival time of the partials. I.e. 
>> different areas on the basilar membrane get excited in different orders.
>>
>>
>> Best,
>>
>>   René
>>
>>
>> Am 10.12.2024 um 12:07 schrieb Ben Stuyts via Synth-diy:
>>> Yes, I agree and fully understand that the aliasing damage has 
>>> already been done when you start with a perfect sawtooth. The 
>>> low-pass filter was meant as a bit of damage limitation. However, I 
>>> wanted to have a quick blind a-b check if there was any merit in 
>>> phase vs. anti-phase sound. In my (old) ears I couldn’t find any 
>>> difference in tone or pitch.
>>>
>>> Your method sounds like the way to go if you want a clean signal. So 
>>> you are basically adding weighted sine waves up to a certain 
>>> (nyquist?) frequency?
>>>
>>> Ben
>>>
>>>
>>>> On 10 Dec 2024, at 00:47, brianw <brianw at audiobanshee.com> wrote:
>>>>
>>>> It is impossible to remove aliasing with a filter after sampling. 
>>>> The filtering must be done before sampling. The reason it is 
>>>> impossible is that the desired harmonics of the saw/ramp are all 
>>>> around the undesired aliased frequencies. No filter can select only 
>>>> aliased frequencies without also removing desired harmonics.
>>>>
>>>> In the analog domain, the signal and filter have "infinite" 
>>>> bandwidth, so the frequencies above Nyquist can be "removed" before 
>>>> sampling. Any time sample rate conversion reduces the rate, the 
>>>> filtering must be done at the higher sample rate, before conversion.
>>>>
>>>> In your ideal sawtooth, there are infinite harmonics, so you're 
>>>> technically downsampling from an infinite rate to some finite rate. 
>>>> By filtering at 4400 Hz, you're removing both aliases and sawtooth 
>>>> harmonics above that, while there are still aliased frequencies 
>>>> before that - although they're really faint because each higher 
>>>> harmonic has a lower amplitude (1/N). When generating waveforms, 
>>>> the only way to avoid aliasing is to avoid generating any 
>>>> frequencies above Nyquist. For a sawtooth, a simple sum of sinusoid 
>>>> waveforms is the way to do it.
>>>>
>>>> I have a macOS program that can synthesize bandlimited waveforms 
>>>> without aliasing, with controls for odd-even polarity, the number 
>>>> of harmonics, and the weight of the harmonics 1/1, 1/N, 1/(N^2). I 
>>>> need to update this for the latest macOS so I can upload a new 
>>>> version. For folks that have an old version of macOS, the latest 
>>>> version is at http://audiobanshee.com/software/Waves-1.2p.dmg
>>>>
>>>> Brian Willoughby
>>>>
>>>> p.s. An older version of my program would write waveshapes in 
>>>> Evolver format for uploading, but that code depended upon another 
>>>> library I wrote that isn't very portable.
>>>>
>>>>
>>>> On Dec 9, 2024, at 1:20 PM, Ben Stuyts wrote:
>>>>> On 9 Dec 2024, at 19:37, Jonatan Liljedahl wrote:
>>>>>> Yes, all but the 4th one is the same. I don’t think it’s 
>>>>>> interesting or important to know/hear if it’s up or down ramp, 
>>>>>> the interesting thing is that it’s a clear difference. I also 
>>>>>> perceive it as lower pitch. They are all aliasing a lot too :)
>>>>> Agreed about the aliasing. These were ideal sawtooth waveforms 
>>>>> without any filtering. Here is a slightly improved version with an 
>>>>> 8 pole low-pass Butterworth filter at 4.4 kHz. I have uploaded the 
>>>>> resulting .wav to https://synth-diy.org/files/sawtooth_waves.wav 
>>>>> to save bandwidth on the list.
>>>>>
>>>>> Attached is the Python script. There is a bit of a DC shift 
>>>>> between the inverted and regular wave forms, so I have to look 
>>>>> into that.
>>>>>
>>>>> The info about which is which is here: 
>>>>> https://synth-diy.org/files/sawtooth_inversion_info.txt
>>>>>
>>>>> Ben
>>>>>
>>>>>> /Jonatan
>>>>>> http://kymatica.com
>>>>>>
>>>>>>
>>>>> mån 9 dec. 2024 kl. 19:14 skrev Ingo Debus via Synth-diy 
>>>>> <synth-diy at synth-diy.org>:
>>>>>> Am 09.12.2024 um 17:44 schrieb Ben Stuyts via Synth-diy 
>>>>>> <synth-diy at synth-diy.org>:
>>>>>>> Here is a Python script to generate some random non-/inverted 
>>>>>>> sawtooth waves after each other in a single wav file, plus a 
>>>>>>> text file saying which is which. You can play with the 
>>>>>>> parameters in the script to change the sample rate, length of 
>>>>>>> each sample, etc.
>>>>>> Thanks for sharing!
>>>>>> I listened to them several times (via Yamaha NS-10M speakers), 
>>>>>> and the 4th one sounds slightly lower in pitch to me than the 
>>>>>> first three. Any one else noticing this too?
>>>>>>
>>>>>> Ingo
>>>>
>>>
>>> ________________________________________________________
>>> This is the Synth-diy mailing list
>>> Submit email to: Synth-diy at synth-diy.org
>>> View archive at: https://synth-diy.org/pipermail/synth-diy/
>>> Check your settings at: 
>>> https://synth-diy.org/mailman/listinfo/synth-diy
>>> Selling or trading? Use marketplace at synth-diy.org
>>
>>
>> ________________________________________________________
>> This is the Synth-diy mailing list
>> Submit email to: Synth-diy at synth-diy.org
>> View archive at: https://synth-diy.org/pipermail/synth-diy/
>> Check your settings at: https://synth-diy.org/mailman/listinfo/synth-diy
>> Selling or trading? Use marketplace at synth-diy.org

-- 
--
synth at schmitzbits.de
http://schmitzbits.de



More information about the Synth-diy mailing list