[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Trasients when playing silence with Matlab



Hi,
 
Some things to check might be... (appologies if these are too obvious)
 
- Make sure all your sound files have the exact same specifications (sampling freq., bit depth, coding, etc.)
- If you are creating the "silence" file in Matlab also check whether the samples are signed or unsigned integer and that the zeroes you are writing for the file are not just giving a 0dBFS DC component, which would result in a large pop at the start
- Try adding dither to the "silence" sample (some DACs switch state, with an associated glitch, after recieving a continuous sequence of samples having all zeros)
- If you aren't already using ASIO drivers try replaying the "silence" sample in a dedicated audio replay software that has ASIO driver support to see if the problem still exists
- If you have samples preceding the "silence" sample try fading them over the last ~500 samples so there isn't a large sample transition to "silence".
 
Dave


From: AUDITORY - Research in Auditory Perception [mailto:AUDITORY@xxxxxxxxxxxxxxx] On Behalf Of ext Sylvain Choisel
Sent: 08 February, 2008 09:55
To: AUDITORY@xxxxxxxxxxxxxxx
Subject: Re: Trasients when playing silence with Matlab


Enrique,

If you want to exclude the possibility that these clicks come from Windows (if that is the OS
you are using), I suggest you try the user-contributed function "pa_wavplay" that makes
use of the ASIO drivers.  It has the advantage of bypassing the Windows sound mixer.
You can find this function here:
http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=4017&objectType=file

Another source of clicks is a change of sampling frequency, that will cause the soundcard
to loose the clock for a short while. Check the clock settings in the sound card's control panel,
you can monitor the current sampling frequency, and see if it changes at the same time as
you hear the click.

Best regards,

Sylvain


AUDITORY - Research in Auditory Perception <AUDITORY@xxxxxxxxxxxxxxx> wrote on 07/02/2008 17:25:40:

> Dear Enrique,
>
> the issue your are experiencing may come from many things. I would
> suggest you to try with a different soundcard first to discard the
> soundcard issue.
>
> Then, Matlab does not handle sound cards directly, but rather uses some
> OS calls. So your issue may also come from your operating system (Linux,
> Mac OS X, ...). If you replicate the same behavior with a different
> soundcard,  I would suggest to contact Matlab support directly with a
> complete description of your issue with code, they usually answer in a
> day or two.
>
> That said, I know that the command "sound" is very brittle on many OSes.
> You can try the "audioplayer" that uses JAVA calls and may behave better
> for your purpose (type "doc audioplayer" in your Matlab command prompt
> for usage).
>
> Cheers,
>
> Mathieu Lagrange
> Lopez-Poveda, Enrique A. a écrit :
> > Dear friends,
> >
> > Here is a technical question on a problem that is driving us crazy.
> >
> > We want to play sounds from Matlab through an RME Fireface 400 sound
> > card. The problem is that when we play a "silence" interval (array of
> > zeros) we can hear (and even record) a clear transient at the onset of
> > the _silence_ signal. We would very much like to get rid of that onset
> > transient. Any cues as to how to get rid of it?
> >
> > Thank you so much in advance.
> >
> > - Enrique
> >
> > Enrique A. Lopez-Poveda, Ph.D.
> > Instituto de Neurociencias de Castilla y León
> > Universidad de Salamanca
> > Av. Alfonso X El Sabio S/N, 37007 Salamanca, Spain.
> > Phone: (+34) 923 294 500 ext. 1957
> > Fax: (+34) 923 294 750
> > E-mail: ealopezpoveda@xxxxxxx
> > http://web.usal.es/~ealopezpoveda/
>