[sdiy] saw vs ramp, audible?
Jonatan Liljedahl
lijon at kymatica.com
Tue Dec 10 18:22:28 CET 2024
I clearly hear the difference on 4th and 10th, again slightly lower
pitch, when listening on headphones (ATH-M50x) but not in my macbook
built-in speakers.
My guess is that the diffusion happening in the room with speakers
garbles the phases enough to make the difference disappear (or harder
to hear), while the more direct speaker-to-ear interface of headphones
make it more audible.
Cheers
On Tue, Dec 10, 2024 at 2:29 PM René Schmitz <synth at schmitzbits.de> wrote:
>
> 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
>
> --
> --
> synth at schmitzbits.de
> http://schmitzbits.de
> ________________________________________________________
> 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
--
/Jonatan
http://kymatica.com
More information about the Synth-diy
mailing list