Gene Heskett wrote:
> On Thursday 11 October 2007, Jonatan Liljedahl wrote:
>> Jonatan Liljedahl wrote:
>>> I'm having problems with distorted sound with ALSA. It's not
>>> clipping distortion but more like a dirty spectra. The test I am
>>> doing is playing a pure 440Hz sawtooth wave, and the sound is
>>> very unclean, there's inharmonic partitials that shouldn't be
>>> there, actually below the fundamental frequency I think. Compared
>>> to an analog sawtooth oscillator it sounds really awful.
>> Here's a picture of the resulting waveform when playing a pure
>> sawtooth and recording it straight in again on my Terratec Phase
>> 26. As you can see, there is some kind of ringing happening...
>> 
>> But, this is interesting, when recording a pure sawtooth from my 
>> analogue modular into my soundcard (through a mixing desk) there
>> was some ringing too, but it didn't sound at all as dirty as the
>> previous computer-generated sawtooth. When playing back this
>> recorded analogue sawtooth, I had a hard time hearing the
>> difference.
>> 
>> So, I guess it's not the ringing this is about. And now when I
>> listen again with different frequencies I definitely hear that the
>> polution of the spectra is subtones, frequencies below the
>> fundamental. Perhaps the problem is some cyclic jitter? But it
>> seems dependent on the high overtones of the computer-generated
>> waveforms since I can't hear it when recording a sawtooth from the
>> outside...
>> 
>> Any ideas what this is and what I can do about it?
> 
> The fall time of that computer generated sawtooth is probably 100x
> the fundamental frequency of the sawtooth.  I suspect what your ears
> are hearing is aliasing because some portions of that exceed the
> sampling frequency, which would be non-harmonically related, and
> translated to a tone that is the difference between the sampling
> frequency and the upper harmonics of that 400hz tone.  This is why
> good digitizers will have a truly brick wall analog filter, cutting
> off by 60+ db, anything that approaches the 'nyquist frequency' of
> the sampler itself.  And it's both expensive in terms of component
> count and cost, board real estate and design time to do that without
> audible group delay effects, which are an entirely different horse, 
> and the filtering _must_ be done before digitization.  Aliasing, once
> in the digital data stream, cannot be removed.

This was indeed it. Though I didn't know that a soundfile must not
contain any sharp discontinuities, I thought that the hardware would
filter it out. But you say this is not possible once it's digital, how
come? Why can't you just run a soundfile through a filter to take out
everything above nyquist? (upsampling it first, I guess)

> Recalculate the sawtooth so that the fall time stays within the
> systems bandwidth, and I'd bet a bottle of suds most of the effect
> you are hearing will go away.  The fall time should not be less than
> 1/frequency, answer is in seconds.

Yes, I found code for bandlimited sawtooth oscillator in the Synthesis
ToolKit which worked very well!

-- 
/Jonatan         [ http://kymatica.com ]

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Alsa-user mailing list
Alsa-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/alsa-user

Reply via email to