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

Re: AUDITORY Digest - 14 Oct 2011 to 17 Oct 2011 - Special issue (#2011-238)



Subject: Audio Glitch in Matlab

The truncation of the auditory signals less than 500 ms was also seen in windows 7 and MATLAB version 10.  I have even noticed this kind of problems in Adobe Audition software. I have not used ASIO sound card. I am not sure about other sound playing softwares.

Vijaya Kumar Narne PhD
Lecturer in Audiology
AIISH
Mysore


Date:    Mon, 17 Oct 2011 09:57:17 -0400
From:    Patrick Zurek <pat@xxxxxxxx>
Subject: Audio Glitch in Matlab

This is a multi-part message in MIME format.
--------------030103020706040808060701
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

I'm writing to notify list readers of a problem playing audio using Matlab.

The problem is that brief signals are truncated, and it happens using
any of the common commands for playing audio (wavplay, sound, and the
play method of the audioplayer object).

I can't specify the exact conditions under which the truncation occurs.
However, with a sample rate of 44.1 kHz, signals shorter than about 500
msec are truncated. I haven't looked much at other sample rates.

A simple work-around for the problem is to pad the end of the signal
with a sufficient number of zeros that truncation occurs during the zero
segment. I've found that at least 2000 zeros need to be added to assure
no truncation of a 10-msec signal (with a sample rate of 44.1kHz).

I've brought this problem to the attention of The Mathworks. They
confirmed the problem, which they attribute to a bug in their driver.

The Mathworks also informed me that the problem has been solved in their
latest release (R2011b) for playing using audioplayer, but not
necessarily for the other audio commands. I've confirmed this in very
limited tests.

The following is a piece of code that you can use to observe the
truncation. It creates a 100-msec, 1-kHz sine wave, applies a hanning
window, and then plays it first with zero-padding and then without. You
should be able to hear the click at the end of the second tone, which is
not present on the first. If not, you can see it on an oscilloscope.

%%%%%%%%%%%%%%%%%%%%
fs = 44100;
f = 1000;
T = 0.1;
nPad = 2000;

nS = round(fs*T);

y = sin(2.*pi*f/fs*(1:nS)');
w = .5*(1 - cos(2*pi*(1:nS)'/(nS+1)));
y = w.*y;
yPad = [y; zeros(nPad,1)];

wavplay(yPad, fs, 'sync')
pause(0.5)
wavplay(y, fs, 'sync')
%%%%%%%%%%%%%%%%%%%%%

--
Patrick M. Zurek
President

Sensimetrics Corporation
14 Summer St.
Suite 403
Malden, MA 02148
Tel: 781-399-0858 x237
Fax: 781-399-0853
email: pat@xxxxxxxx
web: www.sens.com
On Mon, Oct 17, 2011 at 10:02 PM, AUDITORY automatic digest system <LISTSERV@xxxxxxxxxxxxxxx> wrote:
There are 6 messages totalling 1517 lines in this issue.

Topics in this special issue:

 1. CFP: Special Issue on Speech Separation and Recognition in Multisource
    Environments
 2. Audio Glitch in Matlab (5)

----------------------------------------------------------------------

Date:    Mon, 17 Oct 2011 12:29:02 +0100
From:    jon <j.barker@xxxxxxxxxxxxxx>
Subject: CFP: Special Issue on Speech Separation and Recognition in Multisource Environments

--Apple-Mail=_EDC2B160-FC49-4860-979B-9662B080E0E5
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
       charset=windows-1252

[Apologies for multiple postings]

 +++++++++++++++++++++++++++++++++++++++++++

     COMPUTER SPEECH AND LANGUAGE
     http://www.elsevier.com/locate/csl

     Special issue on
     SPEECH SEPARATION AND RECOGNITION IN MULTISOURCE ENVIRONMENTS

     Submission Deadline:  NOVEMBER 30, 2011

+++++++++++++++++++++++++++++++++++++++++++

One of the chief difficulties of building distant-microphone speech =
recognition systems for use in everyday applications is that the noise =
background is typically `multisource'. A speech recognition system =
designed to operate in a family home, for example, must contend with =
competing noise from televisions and radios, children playing, vacuum =
cleaners, and outdoors noises from open windows. Despite their =
complexity, such environments contain structure that can be learnt and =
exploited using advanced source separation, machine learning and speech =
recognition techniques such as those presented at the 1st International =
Workshop on Machine Listening in Multisource Environments (CHiME 2011). =
http://spandh.dcs.shef.ac.uk/projects/chime/workshop/

This special issue solicits papers describing advances in speech =
separation and recognition in multisource noise environments, including =
theoretical developments, algorithms or systems.

Examples of topics relevant to the special issue include:
=95 multiple speaker localization, beamforming and source separation,
=95 hearing inspired approaches to multisource processing,
=95 background noise tracking and modelling,
=95 noise-robust speech decoding,
=95 model combination approaches to robust speech recognition,
=95 datasets, toolboxes and other resources for multisource speech =
separation and recognition.


SUBMISSION INSTRUCTIONS:
Manuscript submissions shall be made through the Elsevier Editorial =
System (EES) at
http://ees.elsevier.com/csl/
Once logged in, click on =93Submit New Manuscript=94 then select =
=93Special Issue: Multisource Environments=94 in the =93Choose Article =
Type=94 dropdown menu.


IMPORTANT DATES:
November 30, 2011: Paper submission
March 30, 2012: First review
May 30, 2012: Revised submission
July 30, 2012: Second review
August 30, 2012: Camera-ready submission


We are looking forward to your submission!


Jon Barker, University of Sheffield, UK
Emmanuel Vincent, INRIA, France

---=20


--Apple-Mail=_EDC2B160-FC49-4860-979B-9662B080E0E5
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
       charset=windows-1252

<html><head></head><body style=3D"word-wrap: break-word; =
-webkit-nbsp-mode: space; -webkit-line-break: after-white-space; =
">[Apologies for multiple =
postings]<div><br></div><div>&nbsp;+++++++++++++++++++++++++++++++++++++++=
++++</div><div><br></div>&nbsp; &nbsp; &nbsp; COMPUTER SPEECH AND =
LANGUAGE<br>&nbsp; &nbsp; &nbsp;&nbsp;<a =
href="" href="http://www.elsevier.com/locate/csl" target="_blank">http://www.elsevier.com/locate/csl">http://www.elsevier.com/locate=
/csl</a><br><br>&nbsp; &nbsp; &nbsp; Special issue on<div>&nbsp; &nbsp; =
&nbsp; SPEECH SEPARATION AND RECOGNITION IN MULTISOURCE =
ENVIRONMENTS<br><br>&nbsp; &nbsp; &nbsp; Submission Deadline: =
&nbsp;NOVEMBER 30, =
2011</div><div><br>+++++++++++++++++++++++++++++++++++++++++++<br><br>> of the chief difficulties of building distant-microphone speech =
recognition systems for use in everyday applications is that the noise =
background is typically `multisource'. A speech recognition system =
designed to operate in a family home, for example, must contend with =
competing noise from televisions and radios, children playing, vacuum =
cleaners, and outdoors noises from open windows. Despite their =
complexity, such environments contain structure that can be learnt and =
exploited using advanced source separation, machine learning and speech =
recognition techniques such as those presented at the 1st International =
Workshop on Machine Listening in Multisource Environments (CHiME =
2011).&nbsp;<a =
href="" href="http://spandh.dcs.shef.ac.uk/projects/chime/workshop/" target="_blank">http://spandh.dcs.shef.ac.uk/projects/chime/workshop/">http://span=
dh.dcs.shef.ac.uk/projects/chime/workshop/</a><br><br>This special issue =
solicits papers describing advances in speech separation and recognition =
in multisource noise environments, including theoretical developments, =
algorithms or systems.<br><br>Examples of topics relevant to the special =
issue include:<br>=95 multiple speaker localization, beamforming and =
source separation,<br>=95 hearing inspired approaches to multisource =
processing,<br>=95 background noise tracking and modelling,<br>=95 =
noise-robust speech decoding,<br>=95 model combination approaches to =
robust speech recognition,<br>=95 datasets, toolboxes and other =
resources for multisource speech separation and =
recognition.<br><br><br>SUBMISSION INSTRUCTIONS:<br>Manuscript =
submissions shall be made through the Elsevier Editorial System (EES) =
at<br><a =
href="" href="http://ees.elsevier.com/csl/" target="_blank">http://ees.elsevier.com/csl/">http://ees.elsevier.com/csl/</a><br>=
Once logged in, click on =93Submit New Manuscript=94 then select =
=93Special Issue: Multisource Environments=94 in the =93Choose Article =
Type=94 dropdown menu.<br><br><br>IMPORTANT DATES:<br>November 30, 2011: =
Paper submission<br>March 30, 2012: First review<br>May 30, 2012: =
Revised submission<br>July 30, 2012: Second review<br>August 30, 2012: =
Camera-ready submission<br><br><br>We are looking forward to your =
submission!<br></div><div><br></div><div><br></div><div>Jon Barker, =
University of Sheffield, UK<br>Emmanuel Vincent, INRIA, =
France<br><br></div><div>---&nbsp;<div><span class=3D"Apple-style-span" =
style=3D"border-collapse: separate; color: rgb(0, 0, 0); font-family: =
Helvetica; font-size: medium; font-style: normal; font-variant: normal; =
font-weight: normal; letter-spacing: normal; line-height: normal; =
orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; =
widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; =
-webkit-border-vertical-spacing: 0px; =
-webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: =
auto; -webkit-text-stroke-width: 0px; "><span class=3D"Apple-style-span" =
style=3D"border-collapse: separate; color: rgb(0, 0, 0); font-family: =
Helvetica; font-size: medium; font-style: normal; font-variant: normal; =
font-weight: normal; letter-spacing: normal; line-height: normal; =
orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; =
widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; =
-webkit-border-vertical-spacing: 0px; =
-webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: =
auto; -webkit-text-stroke-width: 0px; "><div style=3D"word-wrap: =
break-word; -webkit-nbsp-mode: space; -webkit-line-break: =
after-white-space; "></div></span></span></div></div><div>
<span class=3D"Apple-style-span" style=3D"border-collapse: separate; =
color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; =
font-style: normal; font-variant: normal; font-weight: normal; =
letter-spacing: normal; line-height: normal; orphans: 2; text-align: =
auto; text-indent: 0px; text-transform: none; white-space: normal; =
widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; =
-webkit-border-vertical-spacing: 0px; =
-webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: =
auto; -webkit-text-stroke-width: 0px; "><span class=3D"Apple-style-span" =
style=3D"border-collapse: separate; color: rgb(0, 0, 0); font-family: =
Helvetica; font-size: medium; font-style: normal; font-variant: normal; =
font-weight: normal; letter-spacing: normal; line-height: normal; =
orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; =
widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; =
-webkit-border-vertical-spacing: 0px; =
-webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: =
auto; -webkit-text-stroke-width: 0px; "><div style=3D"word-wrap: =
break-word; -webkit-nbsp-mode: space; -webkit-line-break: =
after-white-space; =
"><div><br></div></div></span></span></div></body></html>=

--Apple-Mail=_EDC2B160-FC49-4860-979B-9662B080E0E5--

------------------------------

Date:    Mon, 17 Oct 2011 09:57:17 -0400
From:    Patrick Zurek <pat@xxxxxxxx>
Subject: Audio Glitch in Matlab

This is a multi-part message in MIME format.
--------------030103020706040808060701
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

I'm writing to notify list readers of a problem playing audio using Matlab.

The problem is that brief signals are truncated, and it happens using
any of the common commands for playing audio (wavplay, sound, and the
play method of the audioplayer object).

I can't specify the exact conditions under which the truncation occurs.
However, with a sample rate of 44.1 kHz, signals shorter than about 500
msec are truncated. I haven't looked much at other sample rates.

A simple work-around for the problem is to pad the end of the signal
with a sufficient number of zeros that truncation occurs during the zero
segment. I've found that at least 2000 zeros need to be added to assure
no truncation of a 10-msec signal (with a sample rate of 44.1kHz).

I've brought this problem to the attention of The Mathworks. They
confirmed the problem, which they attribute to a bug in their driver.

The Mathworks also informed me that the problem has been solved in their
latest release (R2011b) for playing using audioplayer, but not
necessarily for the other audio commands. I've confirmed this in very
limited tests.

The following is a piece of code that you can use to observe the
truncation. It creates a 100-msec, 1-kHz sine wave, applies a hanning
window, and then plays it first with zero-padding and then without. You
should be able to hear the click at the end of the second tone, which is
not present on the first. If not, you can see it on an oscilloscope.

%%%%%%%%%%%%%%%%%%%%
fs = 44100;
f = 1000;
T = 0.1;
nPad = 2000;

nS = round(fs*T);

y = sin(2.*pi*f/fs*(1:nS)');
w = .5*(1 - cos(2*pi*(1:nS)'/(nS+1)));
y = w.*y;
yPad = [y; zeros(nPad,1)];

wavplay(yPad, fs, 'sync')
pause(0.5)
wavplay(y, fs, 'sync')
%%%%%%%%%%%%%%%%%%%%%

--
Patrick M. Zurek
President

Sensimetrics Corporation
14 Summer St.
Suite 403
Malden, MA 02148
Tel: 781-399-0858 x237
Fax: 781-399-0853
email: pat@xxxxxxxx
web: www.sens.com


--------------030103020706040808060701
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<html>
 <head>

   <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
 </head>
 <body bgcolor="#FFFFFF" text="#000000">
   <font face="Calibri">I'm writing to notify list readers of a problem
     playing audio using Matlab. <br>
     <br>
     The problem is that brief signals are truncated, and it happens
     using any of the common commands for playing audio (wavplay,
     sound, and the play method of the audioplayer object).<br>
     <br>
     I can't specify the exact conditions under which the truncation
     occurs. However, with a sample rate of 44.1 kHz, signals shorter
     than about 500 msec are truncated. I haven't looked much at other
     sample rates.<br>
     <br>
     A simple work-around for the problem is to pad the end of the
     signal with a sufficient number of zeros that truncation occurs
     during the zero segment. I've found that at least 2000 zeros need
     to be added to assure no truncation of a 10-msec signal (with a
     sample rate of 44.1kHz).<br>
     <br>
     I've brought this problem to the attention of The Mathworks. They
     confirmed the problem, which they attribute to a bug in their
     driver. <br>
     <br>
     The Mathworks also informed me that the problem has been solved in
     their latest release (R2011b) for playing using audioplayer, but
     not necessarily for the other audio commands. I've confirmed this
     in very limited tests. <br>
     <br>
     The following is a piece of code that you can use to observe the
     truncation. It creates a 100-msec, 1-kHz sine wave, applies a
     hanning window, and then plays it first with zero-padding and then
     without. You should be able to hear the click at the end of the
     second tone, which is not present on the first. If not, you can
     see it on an oscilloscope.<br>
     <br>
     %%%%%%%%%%%%%%%%%%%%<br>
     fs = 44100;<br>
     f = 1000; <br>
     T = 0.1;<br>
     nPad = 2000;<br>
     <br>
     nS = round(fs*T);<br>
     <br>
     y = sin(2.*pi*f/fs*(1:nS)');<br>
     w = .5*(1 - cos(2*pi*(1:nS)'/(nS+1)));<br>
     y = w.*y;<br>
     yPad = [y; zeros(nPad,1)];<br>
     <br>
     wavplay(yPad, fs, 'sync')<br>
     pause(0.5)<br>
     wavplay(y, fs, 'sync')<br>
     %%%%%%%%%%%%%%%%%%%%%</font><br>
   <pre class="moz-signature" cols="72">--
Patrick M. Zurek
President

Sensimetrics Corporation
14 Summer St.
Suite 403
Malden, MA 02148
Tel: 781-399-0858 x237
Fax: 781-399-0853
email: <a class="moz-txt-link-abbreviated" href="" href="mailto:pat@xxxxxxxx">pat@xxxxxxxx">pat@xxxxxxxx</a>
web: <a class="moz-txt-link-abbreviated" href="" href="http://www.sens.com" target="_blank">http://www.sens.com">www.sens.com</a></pre>
 </body>
</html>

--------------030103020706040808060701--

------------------------------

Date:    Mon, 17 Oct 2011 10:35:49 -0400
From:    Brian FG Katz <brian.katz@xxxxxxxx>
Subject: Re: Audio Glitch in Matlab

This is a multipart message in MIME format.

------=_NextPart_000_0084_01CC8CB8.8AAFF440
Content-Type: text/plain;
       charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

This bug is quite present in Windows. The solution is to not use the =
default
system driver, but an ASIO supported soundcard. This is also recommended =
for
any sync play/rec situations, as the default Windows driver does not =
assure
good or repeatable synchronization.=20

=20

-Brian FG Katz

--

Brian FG Katz, Ph.D

Audio & Acoustique

LIMSI-CNRS

BP 133

F91403 Orsay

France

tel. (+33) 01 69 85 81 55

fax. (+33) 01.69.85.80.88

e-mail  <mailto:Brian.Katz@xxxxxxxx> Brian.Katz@xxxxxxxx <
<mailto:Brian.Katz@xxxxxxxx> mailto:Brian.Katz@xxxxxxxx>

web_theme:  <http://www.limsi.fr/Scientifique/aa/thmsonesp/>
http://www.limsi.fr/Scientifique/aa/thmsonesp/

web_group:  <http://www.limsi.fr/Scientifique/aa/>
http://www.limsi.fr/Scientifique/aa/

=20

=20

=20

De : AUDITORY - Research in Auditory Perception
[mailto:AUDITORY@xxxxxxxxxxxxxxx] De la part de Patrick Zurek
Envoy=E9 : lundi 17 octobre 2011 09:57
=C0 : AUDITORY@xxxxxxxxxxxxxxx
Objet : [AUDITORY] Audio Glitch in Matlab

=20

I'm writing to notify list readers of a problem playing audio using =
Matlab.=20

The problem is that brief signals are truncated, and it happens using =
any of
the common commands for playing audio (wavplay, sound, and the play =
method
of the audioplayer object).

I can't specify the exact conditions under which the truncation occurs.
However, with a sample rate of 44.1 kHz, signals shorter than about 500 =
msec
are truncated. I haven't looked much at other sample rates.

A simple work-around for the problem is to pad the end of the signal =
with a
sufficient number of zeros that truncation occurs during the zero =
segment.
I've found that at least 2000 zeros need to be added to assure no =
truncation
of a 10-msec signal (with a sample rate of 44.1kHz).

I've brought this problem to the attention of The Mathworks. They =
confirmed
the problem, which they attribute to a bug in their driver.=20

The Mathworks also informed me that the problem has been solved in their
latest release (R2011b) for playing using audioplayer, but not =
necessarily
for the other audio commands. I've confirmed this in very limited tests. =


The following is a piece of code that you can use to observe the =
truncation.
It creates a 100-msec, 1-kHz sine wave, applies a hanning window, and =
then
plays it first with zero-padding and then without. You should be able to
hear the click at the end of the second tone, which is not present on =
the
first. If not, you can see it on an oscilloscope.

%%%%%%%%%%%%%%%%%%%%
fs =3D 44100;
f =3D 1000;=20
T =3D 0.1;
nPad =3D 2000;

nS =3D round(fs*T);

y =3D sin(2.*pi*f/fs*(1:nS)');
w =3D .5*(1 - cos(2*pi*(1:nS)'/(nS+1)));
y =3D w.*y;
yPad =3D [y; zeros(nPad,1)];

wavplay(yPad, fs, 'sync')
pause(0.5)
wavplay(y, fs, 'sync')
%%%%%%%%%%%%%%%%%%%%%



--=20
Patrick M. Zurek
President=20
=20
Sensimetrics Corporation
14 Summer St.
Suite 403
Malden, MA 02148
Tel: 781-399-0858 x237
Fax: 781-399-0853
email: pat@xxxxxxxx
web: www.sens.com

------=_NextPart_000_0084_01CC8CB8.8AAFF440
Content-Type: text/html;
       charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">
<html xmlns:v=3D"urn:schemas-microsoft-com:vml" =
xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" =
xmlns=3D"http://www.w3.org/TR/REC-html40"><head><meta name=3DGenerator =
content=3D"Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
       {font-family:Calibri;
       panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
       {font-family:Tahoma;
       panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
       {font-family:Consolas;
       panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
       {margin:0cm;
       margin-bottom:.0001pt;
       font-size:12.0pt;
       font-family:"Times New Roman","serif";
       color:black;}
a:link, span.MsoHyperlink
       {mso-style-priority:99;
       color:blue;
       text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
       {mso-style-priority:99;
       color:purple;
       text-decoration:underline;}
pre
       {mso-style-priority:99;
       mso-style-link:"Pr=E9format=E9 HTML Car";
       margin:0cm;
       margin-bottom:.0001pt;
       font-size:10.0pt;
       font-family:"Courier New";
       color:black;}
span.PrformatHTMLCar
       {mso-style-name:"Pr=E9format=E9 HTML Car";
       mso-style-priority:99;
       mso-style-link:"Pr=E9format=E9 HTML";
       font-family:Consolas;
       color:black;}
span.EmailStyle19
       {mso-style-type:personal-reply;
       font-family:"Calibri","sans-serif";
       color:#1F497D;}
.MsoChpDefault
       {mso-style-type:export-only;
       font-size:10.0pt;}
@page WordSection1
       {size:612.0pt 792.0pt;
       margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
       {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext=3D"edit">
<o:idmap v:ext=3D"edit" data="" />
</o:shapelayout></xml><![endif]--></head><body bgcolor=3Dwhite =
lang=3DEN-US link=3Dblue vlink=3Dpurple><div class=3DWordSection1><p =
class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497=
D'>This bug is quite present in Windows. The solution is to not use the =
default system driver, but an ASIO supported soundcard. This is also =
recommended for any sync play/rec situations, as the default Windows =
driver does not assure good or repeatable synchronization. =
<o:p></o:p></span></p><p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497=
D'><o:p>&nbsp;</o:p></span></p><p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497=
D'>-Brian FG Katz<o:p></o:p></span></p><div><p class=3DMsoNormal><span =
lang=3DFR =
style=3D'font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D'=
>--<o:p></o:p></span></p><p class=3DMsoNormal><span lang=3DFR =
style=3D'font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D'=
>Brian FG Katz, Ph.D<o:p></o:p></span></p><p class=3DMsoNormal><span =
lang=3DFR =
style=3D'font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D'=
>Audio &amp; Acoustique<o:p></o:p></span></p><p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D'=
>LIMSI-CNRS<o:p></o:p></span></p><p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D'=
>BP 133<o:p></o:p></span></p><p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D'=
>F91403 Orsay<o:p></o:p></span></p><p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D'=
>France<o:p></o:p></span></p><p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D'=
>tel. (+33) 01 69 85 81 55<o:p></o:p></span></p><p =
class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D'=
>fax. (+33) 01.69.85.80.88<o:p></o:p></span></p><p =
class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D'=
>e-mail </span><span lang=3DFR =
style=3D'font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D'=
><a href="" href="mailto:Brian.Katz@xxxxxxxx">Brian.Katz@xxxxxxxx"><span lang=3DEN-US =
style=3D'color:blue'>Brian.Katz@xxxxxxxx</span></a></span><span =
style=3D'font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D'=
> &lt;</span><span lang=3DFR =
style=3D'font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D'=
><a href="" href="mailto:Brian.Katz@xxxxxxxx">Brian.Katz@xxxxxxxx"><span lang=3DEN-US =
style=3D'color:blue'>mailto:Brian.Katz@xxxxxxxx</span></a></span><span =
style=3D'font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D'=
>&gt;<o:p></o:p></span></p><p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D'=
>web_theme: </span><span lang=3DFR =
style=3D'font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D'=
><a href="" href="http://www.limsi.fr/Scientifique/aa/thmsonesp/" target="_blank">http://www.limsi.fr/Scientifique/aa/thmsonesp/"><span =
lang=3DEN-US =
style=3D'color:blue'>http://www.limsi.fr/Scientifique/aa/thmsonesp/</span=
></a></span><span =
style=3D'font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D'=
><o:p></o:p></span></p><p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D'=
>web_group: </span><span lang=3DFR =
style=3D'font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D'=
><a href="" href="http://www.limsi.fr/Scientifique/aa/" target="_blank">http://www.limsi.fr/Scientifique/aa/"><span lang=3DEN-US =
style=3D'color:blue'>http://www.limsi.fr/Scientifique/aa/</span></a></spa=
n><span =
style=3D'font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D'=
><o:p></o:p></span></p><p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D'=
><o:p>&nbsp;</o:p></span></p><p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D'=
><o:p>&nbsp;</o:p></span></p></div><p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497=
D'><o:p>&nbsp;</o:p></span></p><div><div =
style=3D'border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm =
0cm 0cm'><p class=3DMsoNormal><b><span lang=3DFR =
style=3D'font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowt=
ext'>De&nbsp;:</span></b><span lang=3DFR =
style=3D'font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowt=
ext'> AUDITORY - Research in Auditory Perception =
[mailto:AUDITORY@xxxxxxxxxxxxxxx] <b>De la part de</b> Patrick =
Zurek<br><b>Envoy=E9&nbsp;:</b> lundi 17 octobre 2011 =
09:57<br><b>=C0&nbsp;:</b> =
AUDITORY@xxxxxxxxxxxxxxx<br><b>Objet&nbsp;:</b> [AUDITORY] Audio Glitch =
in Matlab<o:p></o:p></span></p></div></div><p =
class=3DMsoNormal><o:p>&nbsp;</o:p></p><p class=3DMsoNormal><span =
style=3D'font-family:"Calibri","sans-serif"'>I'm writing to notify list =
readers of a problem playing audio using Matlab. <br><br>The problem is =
that brief signals are truncated, and it happens using any of the common =
commands for playing audio (wavplay, sound, and the play method of the =
audioplayer object).<br><br>I can't specify the exact conditions under =
which the truncation occurs. However, with a sample rate of 44.1 kHz, =
signals shorter than about 500 msec are truncated. I haven't looked much =
at other sample rates.<br><br>A simple work-around for the problem is to =
pad the end of the signal with a sufficient number of zeros that =
truncation occurs during the zero segment. I've found that at least 2000 =
zeros need to be added to assure no truncation of a 10-msec signal (with =
a sample rate of 44.1kHz).<br><br>I've brought this problem to the =
attention of The Mathworks. They confirmed the problem, which they =
attribute to a bug in their driver. <br><br>The Mathworks also informed =
me that the problem has been solved in their latest release (R2011b) for =""> playing using audioplayer, but not necessarily for the other audio =
commands. I've confirmed this in very limited tests. <br><br>The =
following is a piece of code that you can use to observe the truncation. =
It creates a 100-msec, 1-kHz sine wave, applies a hanning window, and =
then plays it first with zero-padding and then without. You should be =
able to hear the click at the end of the second tone, which is not =
present on the first. If not, you can see it on an =
oscilloscope.<br><br>%%%%%%%%%%%%%%%%%%%%<br>fs =3D 44100;<br>f =3D =
1000; <br>T =3D 0.1;<br>nPad =3D 2000;<br><br>nS =3D =
round(fs*T);<br><br>y =3D sin(2.*pi*f/fs*(1:nS)');<br>w =3D .5*(1 - =
cos(2*pi*(1:nS)'/(nS+1)));<br>y =3D w.*y;<br>yPad =3D [y; =
zeros(nPad,1)];<br><br>wavplay(yPad, fs, =
'sync')<br>pause(0.5)<br>wavplay(y, fs, =
'sync')<br>%%%%%%%%%%%%%%%%%%%%%</span><br><br><o:p></o:p></p><pre>-- =
<o:p></o:p></pre><pre>Patrick M. Zurek<o:p></o:p></pre><pre>President =
<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>Sensimetrics =
Corporation<o:p></o:p></pre><pre>14 Summer =
St.<o:p></o:p></pre><pre>Suite 403<o:p></o:p></pre><pre>Malden, MA =
02148<o:p></o:p></pre><pre>Tel: 781-399-0858 =
x237<o:p></o:p></pre><pre>Fax: 781-399-0853<o:p></o:p></pre><pre>email: =
<a =
href="" href="mailto:pat@xxxxxxxx">pat@xxxxxxxx">pat@xxxxxxxx</a><o:p></o:p></pre><pre>web: =
<a =
href="" href="http://www.sens.com" target="_blank">http://www.sens.com">www.sens.com</a><o:p></o:p></pre></div></bod=
y></html>
------=_NextPart_000_0084_01CC8CB8.8AAFF440--

------------------------------

Date:    Mon, 17 Oct 2011 11:28:33 -0400
From:    Joachim Thiemann <joachim.thiemann@xxxxxxxxx>
Subject: Re: Audio Glitch in Matlab

On Mon, Oct 17, 2011 at 09:57, Patrick Zurek <pat@xxxxxxxx> wrote:
> I'm writing to notify list readers of a problem playing audio using Matlab.

I don't know if the bug you're referring to is Windows-specific; but
the "sound" command on Linux used to have ... issues. (possibly
related to the JVM and the OSS/ALSA/whatever is used now transition)

I wrote a small almost trivial workaround (see
http://signalsprocessed.blogspot.com/2011/02/playing-sounds-from-matlab-on-unix.html)
that would simply write the sound to disk then play it from there:

function [ ] = usound( w, fs )
%USOUND Plays sound on ALSA-based linux machines or macs

if nargin < 2
   fs = 16000;
end

filename = ['/tmp/' getenv('USER') '_matplay.wav'];
wavwrite( w, fs, filename );
if ismac
   eval(['!afplay ' filename ' &']);
else
   eval(['!aplay ' filename ' &']);
end

On a modern machine, the overhead is not perceptible: /tmp should be
in RAM anyways.

Note this also doesn't block, so you can continue working while the
sound is playing (IIRC - this code is a bit old :-)

Joe.

--
Joachim Thiemann :: http://www.tsp.ece.mcgill.ca/~jthiem1

------------------------------

Date:    Mon, 17 Oct 2011 17:52:09 +0200
From:    "Jelfs, Sam" <sam.jelfs@xxxxxxxxxxx>
Subject: Re: Audio Glitch in Matlab

--_000_E4FB19A270B2AE4E99E35D8BF51CEA3FC8FD0DCEFCNLCLUEXM03con_
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

It is also possible to use PortAudio / pa_wavplay to make use of the ASIO4A=
LL drivers with existing non-asio hardware.

http://www.portaudio.com/
http://www.mathworks.com/matlabcentral/fileexchange/4017
http://www.asio4all.com/


Sam Jelfs

From: AUDITORY - Research in Auditory Perception [mailto:AUDITORY@xxxxxxxxx=
ILL.CA] On Behalf Of Brian FG Katz
Sent: Monday 17 October 2011 16:36
To: AUDITORY@xxxxxxxxxxxxxxx
Subject: Re: [AUDITORY] Audio Glitch in Matlab

This bug is quite present in Windows. The solution is to not use the defaul=
t system driver, but an ASIO supported soundcard. This is also recommended =
for any sync play/rec situations, as the default Windows driver does not as=
sure good or repeatable synchronization.

-Brian FG Katz
--
Brian FG Katz, Ph.D
Audio & Acoustique
LIMSI-CNRS
BP 133
F91403 Orsay
France
tel. (+33) 01 69 85 81 55
fax. (+33) 01.69.85.80.88
e-mail Brian.Katz@xxxxxxxx<mailto:Brian.Katz@xxxxxxxx> <mailto:Brian.Katz@l=
imsi.fr>
web_theme: http://www.limsi.fr/Scientifique/aa/thmsonesp/
web_group: http://www.limsi.fr/Scientifique/aa/



De : AUDITORY - Research in Auditory Perception [mailto:AUDITORY@xxxxxxxxxx=
LL.CA] De la part de Patrick Zurek
Envoy=E9 : lundi 17 octobre 2011 09:57
=C0 : AUDITORY@xxxxxxxxxxxxxxx
Objet : [AUDITORY] Audio Glitch in Matlab

I'm writing to notify list readers of a problem playing audio using Matlab.

The problem is that brief signals are truncated, and it happens using any o=
f the common commands for playing audio (wavplay, sound, and the play metho=
d of the audioplayer object).

I can't specify the exact conditions under which the truncation occurs. How=
ever, with a sample rate of 44.1 kHz, signals shorter than about 500 msec a=
re truncated. I haven't looked much at other sample rates.

A simple work-around for the problem is to pad the end of the signal with a=
 sufficient number of zeros that truncation occurs during the zero segment.=
 I've found that at least 2000 zeros need to be added to assure no truncati=
on of a 10-msec signal (with a sample rate of 44.1kHz).

I've brought this problem to the attention of The Mathworks. They confirmed=
 the problem, which they attribute to a bug in their driver.

The Mathworks also informed me that the problem has been solved in their la=
test release (R2011b) for playing using audioplayer, but not necessarily fo=
r the other audio commands. I've confirmed this in very limited tests.

The following is a piece of code that you can use to observe the truncation=
. It creates a 100-msec, 1-kHz sine wave, applies a hanning window, and the=
n plays it first with zero-padding and then without. You should be able to =
hear the click at the end of the second tone, which is not present on the f=
irst. If not, you can see it on an oscilloscope.

%%%%%%%%%%%%%%%%%%%%
fs =3D 44100;
f =3D 1000;
T =3D 0.1;
nPad =3D 2000;

nS =3D round(fs*T);

y =3D sin(2.*pi*f/fs*(1:nS)');
w =3D .5*(1 - cos(2*pi*(1:nS)'/(nS+1)));
y =3D w.*y;
yPad =3D [y; zeros(nPad,1)];

wavplay(yPad, fs, 'sync')
pause(0.5)
wavplay(y, fs, 'sync')
%%%%%%%%%%%%%%%%%%%%%

--

Patrick M. Zurek

President



Sensimetrics Corporation

14 Summer St.

Suite 403

Malden, MA 02148

Tel: 781-399-0858 x237

Fax: 781-399-0853

email: pat@xxxxxxxx<mailto:pat@xxxxxxxx>

web: www.sens.com<http://www.sens.com>

________________________________
The information contained in this message may be confidential and legally p=
rotected under applicable law. The message is intended solely for the addre=
ssee(s). If you are not the intended recipient, you are hereby notified tha=
t any use, forwarding, dissemination, or reproduction of this message is st=
rictly prohibited and may be unlawful. If you are not the intended recipien=
t, please contact the sender by return e-mail and destroy all copies of the=
 original message.

--_000_E4FB19A270B2AE4E99E35D8BF51CEA3FC8FD0DCEFCNLCLUEXM03con_
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<html>
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Diso-8859-=
1">
<meta name=3D"Generator" content=3D"Microsoft Word 12 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
       {font-family:Wingdings;
       panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
       {font-family:Wingdings;
       panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
       {font-family:Calibri;
       panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
       {font-family:Tahoma;
       panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
       {font-family:Consolas;
       panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
       {margin:0cm;
       margin-bottom:.0001pt;
       font-size:12.0pt;
       font-family:"Times New Roman","serif";
       color:black;}
a:link, span.MsoHyperlink
       {mso-style-priority:99;
       color:blue;
       text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
       {mso-style-priority:99;
       color:purple;
       text-decoration:underline;}
pre
       {mso-style-priority:99;
       mso-style-link:"HTML Preformatted Char";
       margin:0cm;
       margin-bottom:.0001pt;
       font-size:10.0pt;
       font-family:"Courier New";
       color:black;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
       {mso-style-priority:34;
       margin-top:0cm;
       margin-right:0cm;
       margin-bottom:0cm;
       margin-left:36.0pt;
       margin-bottom:.0001pt;
       font-size:12.0pt;
       font-family:"Times New Roman","serif";
       color:black;}
span.HTMLPreformattedChar
       {mso-style-name:"HTML Preformatted Char";
       mso-style-priority:99;
       mso-style-link:"HTML Preformatted";
       font-family:Consolas;
       color:black;}
p.PrformatHTML, li.PrformatHTML, div.PrformatHTML
       {mso-style-name:"Pr=E9format=E9 HTML";
       mso-style-link:"Pr=E9format=E9 HTML Car";
       margin:0cm;
       margin-bottom:.0001pt;
       font-size:12.0pt;
       font-family:"Times New Roman","serif";
       color:black;}
span.PrformatHTMLCar
       {mso-style-name:"Pr=E9format=E9 HTML Car";
       mso-style-priority:99;
       mso-style-link:"Pr=E9format=E9 HTML";
       font-family:Consolas;
       color:black;}
span.EmailStyle21
       {mso-style-type:personal;
       font-family:"Calibri","sans-serif";
       color:#1F497D;}
span.EmailStyle22
       {mso-style-type:personal-reply;
       font-family:"Calibri","sans-serif";
       color:#1F497D;}
.MsoChpDefault
       {mso-style-type:export-only;
       font-size:10.0pt;}
@page WordSection1
       {size:612.0pt 792.0pt;
       margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
       {page:WordSection1;}
/* List Definitions */
@list l0
       {mso-list-id:926965819;
       mso-list-type:hybrid;
       mso-list-template-ids:344066808 1943972264 67698691 67698693 67698689 6769=
8691 67698693 67698689 67698691 67698693;}
@list l0:level1
       {mso-level-start-at:0;
       mso-level-number-format:bullet;
       mso-level-text:-;
       mso-level-tab-stop:none;
       mso-level-number-position:left;
       text-indent:-18.0pt;
       font-family:"Calibri","sans-serif";
       mso-fareast-font-family:Calibri;
       mso-bidi-font-family:"Times New Roman";}
ol
       {margin-bottom:0cm;}
ul
       {margin-bottom:0cm;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext=3D"edit">
<o:idmap v:ext=3D"edit" data="" />
</o:shapelayout></xml><![endif]-->
</head>
<body bgcolor=3D"white" lang=3D"EN-US" link=3D"blue" vlink=3D"purple">
<div class=3D"WordSection1">
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt;font-family:&quot;Ca=
libri&quot;,&quot;sans-serif&quot;;color:#1F497D">It is also possible to us=
e PortAudio / pa_wavplay to make use of the ASIO4ALL drivers with existing =
non-asio hardware.<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt;font-family:&quot;Ca=
libri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span><=
/p>
<p class=3D"MsoNormal"><a href="" href="http://www.portaudio.com/" target="_blank">http://www.portaudio.com/">http://www.por=
taudio.com/</a><span style=3D"font-size:11.0pt;font-family:&quot;Calibri&qu=
ot;,&quot;sans-serif&quot;;color:#1F497D"><o:p></o:p></span></p>
<p class=3D"MsoNormal"><a href="" href="http://www.mathworks.com/matlabcentral/fi= leexchange/4017" target="_blank">http://www.mathworks.com/matlabcentral/fi=
leexchange/4017">http://www.mathworks.com/matlabcentral/fileexchange/4017</=
a><span style=3D"font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;san=
s-serif&quot;;color:#1F497D"><o:p></o:p></span></p>
<p class=3D"MsoNormal"><a href="" href="http://www.asio4all.com/" target="_blank">http://www.asio4all.com/">http://www.asio=
4all.com/</a><span style=3D"font-size:11.0pt;font-family:&quot;Calibri&quot=
;,&quot;sans-serif&quot;;color:#1F497D"><o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt;font-family:&quot;Ca=
libri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span><=
/p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt;font-family:&quot;Ca=
libri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span><=
/p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt;font-family:&quot;Ca=
libri&quot;,&quot;sans-serif&quot;;color:#1F497D">Sam Jelfs<o:p></o:p></spa=
n></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt;font-family:&quot;Ca=
libri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span><=
/p>
<div>
<div style=3D"border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm =
0cm 0cm">
<p class=3D"MsoNormal"><b><span style=3D"font-size:10.0pt;font-family:&quot=
;Tahoma&quot;,&quot;sans-serif&quot;;color:windowtext">From:</span></b><spa=
n style=3D"font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif=
&quot;;color:windowtext"> AUDITORY - Research in Auditory Perception [mailt=
o:AUDITORY@xxxxxxxxxxxxxxx]
<b>On Behalf Of </b>Brian FG Katz<br>
<b>Sent:</b> Monday 17 October 2011 16:36<br>
<b>To:</b> AUDITORY@xxxxxxxxxxxxxxx<br>
<b>Subject:</b> Re: [AUDITORY] Audio Glitch in Matlab<o:p></o:p></span></p>
</div>
</div>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt;font-family:&quot;Ca=
libri&quot;,&quot;sans-serif&quot;;color:#1F497D">This bug is quite present=
 in Windows. The solution is to not use the default system driver, but an A=
SIO supported soundcard. This is also recommended for any
 sync play/rec situations, as the default Windows driver does not assure go=
od or repeatable synchronization.
<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt;font-family:&quot;Ca=
libri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span><=
/p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt;font-family:&quot;Ca=
libri&quot;,&quot;sans-serif&quot;;color:#1F497D">-Brian FG Katz<o:p></o:p>=
</span></p>
<div>
<p class=3D"MsoNormal"><span lang=3D"FR" style=3D"font-size:10.0pt;font-fam=
ily:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1F497D">--<o:p></o:p></=
span></p>
<p class=3D"MsoNormal"><span lang=3D"FR" style=3D"font-size:10.0pt;font-fam=
ily:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1F497D">Brian FG Katz, =
Ph.D<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"FR" style=3D"font-size:10.0pt;font-fam=
ily:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1F497D">Audio &amp; Aco=
ustique<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,&quot;sans-serif&quot;;color:#1F497D">LIMSI-CNRS<o:p></o:p></span=
></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,&quot;sans-serif&quot;;color:#1F497D">BP 133<o:p></o:p></span></p=
>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,&quot;sans-serif&quot;;color:#1F497D">F91403 Orsay<o:p></o:p></sp=
an></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,&quot;sans-serif&quot;;color:#1F497D">France<o:p></o:p></span></p=
>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,&quot;sans-serif&quot;;color:#1F497D">tel. (&#43;33) 01 69 85 81 =
55<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,&quot;sans-serif&quot;;color:#1F497D">fax. (&#43;33) 01.69.85.80.=
88<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,&quot;sans-serif&quot;;color:#1F497D">e-mail
</span><span lang=3D"FR" style=3D"font-size:10.0pt;font-family:&quot;Arial&=
quot;,&quot;sans-serif&quot;;color:#1F497D"><a href="" href="mailto:Brian.Katz@li">Brian.Katz@li=
msi.fr"><span lang=3D"EN-US">Brian.Katz@xxxxxxxx</span></a></span><span sty=
le=3D"font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;=
;color:#1F497D">
 &lt;</span><span lang=3D"FR" style=3D"font-size:10.0pt;font-family:&quot;A=
rial&quot;,&quot;sans-serif&quot;;color:#1F497D"><a href="" href="mailto:Brian.Ka">Brian.Ka=
tz@xxxxxxxx"><span lang=3D"EN-US">mailto:Brian.Katz@xxxxxxxx</span></a></sp=
an><span style=3D"font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans=
-serif&quot;;color:#1F497D">&gt;<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,&quot;sans-serif&quot;;color:#1F497D">web_theme:
</span><span lang=3D"FR" style=3D"font-size:10.0pt;font-family:&quot;Arial&=
quot;,&quot;sans-serif&quot;;color:#1F497D"><a href="" href="http://www.limsi.fr/= Scientifique/aa/thmsonesp/" target="_blank">http://www.limsi.fr/=
Scientifique/aa/thmsonesp/"><span lang=3D"EN-US">http://www.limsi.fr/Scient=
ifique/aa/thmsonesp/
</span></a></span><span style=3D"font-size:10.0pt;font-=
family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p></o:p><=
/span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,&quot;sans-serif&quot;;color:#1F497D">web_group:
</span><span lang=3D"FR" style=3D"font-size:10.0pt;font-family:&quot;Arial&=
quot;,&quot;sans-serif&quot;;color:#1F497D"><a href="" href="http://www.limsi.fr/= Scientifique/aa/" target="_blank">http://www.limsi.fr/=
Scientifique/aa/"><span lang=3D"EN-US">http://www.limsi.fr/Scientifique/aa/=
</span></a></span><span style=3D"font-size:10.0pt;font-family:&quot;Arial&q=
uot;,&quot;sans-serif&quot;;color:#1F497D"><o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p=
>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p=
>
</div>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt;font-family:&quot;Ca=
libri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span><=
/p>
<div>
<div style=3D"border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm =
0cm 0cm">
<p class=3D"MsoNormal"><b><span lang=3D"FR" style=3D"font-size:10.0pt;font-=
family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:windowtext">De&nbsp;=
:</span></b><span lang=3D"FR" style=3D"font-size:10.0pt;font-family:&quot;T=
ahoma&quot;,&quot;sans-serif&quot;;color:windowtext"> AUDITORY - Research i=
n Auditory Perception
 [mailto:AUDITORY@xxxxxxxxxxxxxxx] <b>De la part de</b> Patrick Zurek<br>
<b>Envoy=E9&nbsp;:</b> lundi 17 octobre 2011 09:57<br>
<b>=C0&nbsp;:</b> AUDITORY@xxxxxxxxxxxxxxx<br>
<b>Objet&nbsp;:</b> [AUDITORY] Audio Glitch in Matlab<o:p></o:p></span></p>
</div>
</div>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal" style=3D"margin-bottom:12.0pt"><span style=3D"font-f=
amily:&quot;Calibri&quot;,&quot;sans-serif&quot;">I'm writing to notify lis=
t readers of a problem playing audio using Matlab.
<br>
<br>
The problem is that brief signals are truncated, and it happens using any o=
f the common commands for playing audio (wavplay, sound, and the play metho=
d of the audioplayer object).<br>
<br>
I can't specify the exact conditions under which the truncation occurs. How=
ever, with a sample rate of 44.1 kHz, signals shorter than about 500 msec a=
re truncated. I haven't looked much at other sample rates.<br>
<br>
A simple work-around for the problem is to pad the end of the signal with a=
 sufficient number of zeros that truncation occurs during the zero segment.=
 I've found that at least 2000 zeros need to be added to assure no truncati=
on of a 10-msec signal (with a sample
 rate of 44.1kHz).<br>
<br>
I've brought this problem to the attention of The Mathworks. They confirmed=
 the problem, which they attribute to a bug in their driver.
<br>
<br>
The Mathworks also informed me that the problem has been solved in their la=
test release (R2011b) for playing using audioplayer, but not necessarily fo=
r the other audio commands. I've confirmed this in very limited tests.
<br>
<br>
The following is a piece of code that you can use to observe the truncation=
. It creates a 100-msec, 1-kHz sine wave, applies a hanning window, and the=
n plays it first with zero-padding and then without. You should be able to =
hear the click at the end of the
 second tone, which is not present on the first. If not, you can see it on =
an oscilloscope.<br>
<br>
%%%%%%%%%%%%%%%%%%%%<br>
fs =3D 44100;<br>
f =3D 1000; <br>
T =3D 0.1;<br>
nPad =3D 2000;<br>
<br>
nS =3D round(fs*T);<br>
<br>
y =3D sin(2.*pi*f/fs*(1:nS)');<br>
w =3D .5*(1 - cos(2*pi*(1:nS)'/(nS&#43;1)));<br>
y =3D w.*y;<br>
yPad =3D [y; zeros(nPad,1)];<br>
<br>
wavplay(yPad, fs, 'sync')<br>
pause(0.5)<br>
wavplay(y, fs, 'sync')<br>
%%%%%%%%%%%%%%%%%%%%%</span><o:p></o:p></p>
<pre>-- <o:p></o:p></pre>
<pre>Patrick M. Zurek<o:p></o:p></pre>
<pre>President <o:p></o:p></pre>
<pre><o:p>&nbsp;</o:p></pre>
<pre>Sensimetrics Corporation<o:p></o:p></pre>
<pre>14 Summer St.<o:p></o:p></pre>
<pre>Suite 403<o:p></o:p></pre>
<pre>Malden, MA 02148<o:p></o:p></pre>
<pre>Tel: 781-399-0858 x237<o:p></o:p></pre>
<pre>Fax: 781-399-0853<o:p></o:p></pre>
<pre>email: <a href="" href="mailto:pat@xxxxxxxx">pat@xxxxxxxx">pat@xxxxxxxx</a><o:p></o:p></pr=
e>
<pre>web: <a href="" href="http://www.sens.com" target="_blank">http://www.sens.com">www.sens.com</a><o:p></o:p></pre>
</div>
<br>
<hr>
<font face=3D"Arial" color=3D"Gray" size=3D"1">The information contained in=
 this message may be confidential and legally protected under applicable la=
w. The message is intended solely for the addressee(s). If you are not the =
intended recipient, you are hereby notified
 that any use, forwarding, dissemination, or reproduction of this message i=
s strictly prohibited and may be unlawful. If you are not the intended reci=
pient, please contact the sender by return e-mail and destroy all copies of=
 the original message.<br>
</font>
</body>
</html>

--_000_E4FB19A270B2AE4E99E35D8BF51CEA3FC8FD0DCEFCNLCLUEXM03con_--

------------------------------

Date:    Mon, 17 Oct 2011 17:21:23 +0100
From:    Etienne Gaudrain <egaudrain.cam@xxxxxxxxx>
Subject: Re: Audio Glitch in Matlab

--0015175d03cc7857e604af80ffa9
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Hi,

We also had some clicking and truncating issues when using directly the
default (WDM) Windows audio drivers.
Like Brian we solved the problem by using ASIO drivers. You can tap directl=
y
into the ASIO drivers from Matlab using the Playrec (
http://www.playrec.co.uk/) toolbox, based on Portaudio (the audio library
behind Audacity).

And most to our astonishment we discovered that we only needed to initializ=
e
the card using Playrec, and then everything was fine even when using the
standard Matlab functions (sound, audioplay...).

So basically, we do:
playrec('init', 44100, 1, -1);

Then we can call sound(x, fs)... etc... with no clicking and no
truncating...

Maybe the ASIO driver sets the card in a state that is more sensible than
the default state set by the WDM, like putting sensible buffer lengths...
something like that.

The trick works on Windows XP with even older versions of Matlab, and with
E-MU and Asus sound cards.
Haven't tried on Windows 7, and this is probably different as the sound
system is different.

-Etienne

--=20
Etienne Gaudrain, PhD
MRC Cognition and Brain Sciences Unit
15 Chaucer Road
Cambridge, CB2 7EF
United-Kingdom
+44 1223 355 294, ext. 645


On 17 October 2011 15:35, Brian FG Katz <brian.katz@xxxxxxxx> wrote:

> This bug is quite present in Windows. The solution is to not use the
> default system driver, but an ASIO supported soundcard. This is also
> recommended for any sync play/rec situations, as the default Windows driv=
er
> does not assure good or repeatable synchronization. ****
>
> ** **
>
> -Brian FG Katz****
>
> --****
>
> Brian FG Katz, Ph.D****
>
> Audio & Acoustique****
>
> LIMSI-CNRS****
>
> BP 133****
>
> F91403 Orsay****
>
> France****
>
> tel. (+33) 01 69 85 81 55****
>
> fax. (+33) 01.69.85.80.88****
>
> e-mail Brian.Katz@xxxxxxxx <mailto:Brian.Katz@xxxxxxxx<Brian.Katz@xxxxxxx=
r>
> >****
>
> web_theme: http://www.limsi.fr/Scientifique/aa/thmsonesp/****
>
> web_group: http://www.limsi.fr/Scientifique/aa/****
>
> ** **
>
> ** **
>
> ** **
>
> *De :* AUDITORY - Research in Auditory Perception [mailto:
> AUDITORY@xxxxxxxxxxxxxxx] *De la part de* Patrick Zurek
> *Envoy=C3=A9 :* lundi 17 octobre 2011 09:57
> *=C3=80 :* AUDITORY@xxxxxxxxxxxxxxx
> *Objet :* [AUDITORY] Audio Glitch in Matlab****
>
> ** **
>
> I'm writing to notify list readers of a problem playing audio using Matla=
b.
>
>
> The problem is that brief signals are truncated, and it happens using any
> of the common commands for playing audio (wavplay, sound, and the play
> method of the audioplayer object).
>
> I can't specify the exact conditions under which the truncation occurs.
> However, with a sample rate of 44.1 kHz, signals shorter than about 500 m=
sec
> are truncated. I haven't looked much at other sample rates.
>
> A simple work-around for the problem is to pad the end of the signal with=
 a
> sufficient number of zeros that truncation occurs during the zero segment=
.
> I've found that at least 2000 zeros need to be added to assure no truncat=
ion
> of a 10-msec signal (with a sample rate of 44.1kHz).
>
> I've brought this problem to the attention of The Mathworks. They confirm=
ed
> the problem, which they attribute to a bug in their driver.
>
> The Mathworks also informed me that the problem has been solved in their
> latest release (R2011b) for playing using audioplayer, but not necessaril=
y
> for the other audio commands. I've confirmed this in very limited tests.
>
> The following is a piece of code that you can use to observe the
> truncation. It creates a 100-msec, 1-kHz sine wave, applies a hanning
> window, and then plays it first with zero-padding and then without. You
> should be able to hear the click at the end of the second tone, which is =
not
> present on the first. If not, you can see it on an oscilloscope.
>
> %%%%%%%%%%%%%%%%%%%%
> fs =3D 44100;
> f =3D 1000;
> T =3D 0.1;
> nPad =3D 2000;
>
> nS =3D round(fs*T);
>
> y =3D sin(2.*pi*f/fs*(1:nS)');
> w =3D .5*(1 - cos(2*pi*(1:nS)'/(nS+1)));
> y =3D w.*y;
> yPad =3D [y; zeros(nPad,1)];
>
> wavplay(yPad, fs, 'sync')
> pause(0.5)
> wavplay(y, fs, 'sync')
> %%%%%%%%%%%%%%%%%%%%%
>
> ****
>
> -- ****
>
> Patrick M. Zurek****
>
> President ****
>
> ** **
>
> Sensimetrics Corporation****
>
> 14 Summer St.****
>
> Suite 403****
>
> Malden, MA 02148****
>
> Tel: 781-399-0858 x237****
>
> Fax: 781-399-0853****
>
> email: pat@xxxxxxxx****
>
> web: www.sens.com****
>
>

--0015175d03cc7857e604af80ffa9
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<span class=3D"Apple-style-span" style=3D"color: rgb(80, 0, 80); font-famil=
y: arial, sans-serif; font-size: 13px; background-color: rgb(255, 255, 255)=
; ">Hi,=C2=A0<br><br>We also had some clicking and truncating issues when u=
sing directly the default (WDM) Windows audio drivers.=C2=A0<br>
Like Brian we solved the problem by using ASIO drivers. You can tap directl=
y into the ASIO drivers from Matlab using the Playrec (<a href="" href="http://ww" target="_blank">http://ww=
w.playrec.co.uk/" target=3D"_blank" style=3D"color: rgb(0, 0, 204); ">http:=
//www.playrec.co.uk/</a>) toolbox, based on Portaudio (the audio library be=
hind Audacity).=C2=A0<br>
<div class=3D"im" style=3D"color: rgb(80, 0, 80); "><br>And most to our ast=
onishment we discovered that we only needed to initialize the card using Pl=
ayrec, and then everything was fine even when using the standard Matlab fun=
ctions (sound, audioplay...).=C2=A0<br>
<br>So basically, we do:=C2=A0<br>playrec(&#39;init&#39;, 44100, 1, -1);=C2=
=A0<br><br>Then we can call sound(x, fs)... etc... with no clicking and no =
truncating...=C2=A0<br><br>Maybe the ASIO driver sets the card in a state t=
hat is more sensible than the default state set by the WDM, like putting se=
nsible buffer lengths... something like that.=C2=A0<br>
<br>The trick works on Windows XP with even older versions of Matlab, and w=
ith E-MU and Asus sound cards.=C2=A0<br>Haven&#39;t tried on Windows 7, and=
 this is probably different as the sound system is different.=C2=A0<br><br>=
-Etienne=C2=A0<br>
<br><div><span>--=C2=A0<br></span>Etienne Gaudrain, PhD<br>MRC Cognition an=
d Brain Sciences Unit<br>15 Chaucer Road<br>Cambridge, CB2 7EF<br>United-Ki=
ngdom<br><a href="" value=3D"=
+441223355294" target=3D"_blank" style=3D"color: rgb(0, 0, 204); ">+44 1223=
 355 294, ext. 645</a>=C2=A0<br>
</div><div><br></div></div></span><br><div class=3D"gmail_quote">On 17 Octo=
ber 2011 15:35, Brian FG Katz <span dir=3D"ltr">&lt;<a href="" href="mailto:brian">brian=
.katz@xxxxxxxx">brian.katz@xxxxxxxx</a>&gt;</span> wrote:<br><blockquote cl=
ass=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;p=
adding-left:1ex;">

<div bgcolor=3D"white" lang=3D"EN-US" link=3D"blue" vlink=3D"purple"><div><=
p class=3D"MsoNormal"><span style=3D"font-size:11.0pt;color:#1F497D">This b=
ug is quite present in Windows. The solution is to not use the default syst=
em driver, but an ASIO supported soundcard. This is also recommended for an=
y sync play/rec situations, as the default Windows driver does not assure g=
ood or repeatable synchronization. <u></u><u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt;color:#1F497D"><u></=
u>=C2=A0<u></u></span></p><p class=3D"MsoNormal"><span style=3D"font-size:1=
1.0pt;color:#1F497D">-Brian FG Katz<u></u><u></u></span></p><div><p class=
=3D"MsoNormal">
<span lang=3D"FR" style=3D"font-size:10.0pt;color:#1F497D">--<u></u><u></u>=
</span></p><p class=3D"MsoNormal"><span lang=3D"FR" style=3D"font-size:10.0=
pt;color:#1F497D">Brian FG Katz, Ph.D<u></u><u></u></span></p><p class=3D"M=
soNormal">
<span lang=3D"FR" style=3D"font-size:10.0pt;color:#1F497D">Audio &amp; Acou=
stique<u></u><u></u></span></p><p class=3D"MsoNormal"><span style=3D"font-s=
ize:10.0pt;color:#1F497D">LIMSI-CNRS<u></u><u></u></span></p><p class=3D"Ms=
oNormal">
<span style=3D"font-size:10.0pt;color:#1F497D">BP 133<u></u><u></u></span><=
/p><p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;color:#1F497D">F9=
1403 Orsay<u></u><u></u></span></p><p class=3D"MsoNormal"><span style=3D"fo=
nt-size:10.0pt;color:#1F497D">France<u></u><u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;color:#1F497D">tel. =
<a href="" value=3D"+33169858155"=
 target=3D"_blank">(+33) 01 69 85 81 55</a><u></u><u></u></span></p><p clas=
s=3D"MsoNormal">
<span style=3D"font-size:10.0pt;color:#1F497D">fax. <a href=""> %29%2001.69.85.80.88" value=3D"+33169858088" target=3D"_blank">(+33) 01.69.=
85.80.88</a><u></u><u></u></span></p><p class=3D"MsoNormal"><span style=3D"=
font-size:10.0pt;color:#1F497D">e-mail </span><span lang=3D"FR" style=3D"fo=
nt-size:10.0pt;color:#1F497D"><a href="" href="mailto:Brian.Katz@xxxxxxxx">Brian.Katz@xxxxxxxx" target=
=3D"_blank"><span lang=3D"EN-US" style=3D"color:blue">Brian.Katz@xxxxxxxx</=
span></a></span><span style=3D"font-size:10.0pt;color:#1F497D"> &lt;</span>=
<span lang=3D"FR" style=3D"font-size:10.0pt;color:#1F497D"><a href=""> o:Brian.Katz@xxxxxxxx" target=3D"_blank"><span lang=3D"EN-US" style=3D"colo=
r:blue">mailto:Brian.Katz@xxxxxxxx</span></a></span><span style=3D"font-siz=
e:10.0pt;color:#1F497D">&gt;<u></u><u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;color:#1F497D">web_t=
heme: </span><span lang=3D"FR" style=3D"font-size:10.0pt;color:#1F497D"><a =
href="" href="http://www.limsi.fr/Scientifique/aa/thmsonesp/" target="_blank">http://www.limsi.fr/Scientifique/aa/thmsonesp/" target=3D"_blank"><=
span lang=3D"EN-US" style=3D"color:blue">http://www.limsi.fr/Scientifique/a=
a/thmsonesp/
</span></a></span><span style=3D"font-size:10.0pt;color:#1F497D=
"><u></u><u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;color:#1F497D">web_g=
roup: </span><span lang=3D"FR" style=3D"font-size:10.0pt;color:#1F497D"><a =
href="" href="http://www.limsi.fr/Scientifique/aa/" target="_blank">http://www.limsi.fr/Scientifique/aa/" target=3D"_blank"><span lang=
=3D"EN-US" style=3D"color:blue">http://www.limsi.fr/Scientifique/aa/</span>=
</a></span><span style=3D"font-size:10.0pt;color:#1F497D"><u></u><u></u></s=
pan></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;color:#1F497D"><u></=
u>=C2=A0<u></u></span></p><p class=3D"MsoNormal"><span style=3D"font-size:1=
0.0pt;color:#1F497D"><u></u>=C2=A0<u></u></span></p></div><p class=3D"MsoNo=
rmal"><span style=3D"font-size:11.0pt;color:#1F497D"><u></u>=C2=A0<u></u></=
span></p>
<div><div style=3D"border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt=
 0cm 0cm 0cm"><p class=3D"MsoNormal"><b><span lang=3D"FR" style=3D"font-siz=
e:10.0pt;color:windowtext">De=C2=A0:</span></b><span lang=3D"FR" style=3D"f=
ont-size:10.0pt;color:windowtext"> AUDITORY - Research in Auditory Percepti=
on [mailto:<a href="" href="mailto:AUDITORY@xxxxxxxxxxxxxxx">AUDITORY@xxxxxxxxxxxxxxx" target=3D"_blank">AU=
DITORY@xxxxxxxxxxxxxxx</a>] <b>De la part de</b> Patrick Zurek<br>
<b>Envoy=C3=A9=C2=A0:</b> lundi 17 octobre 2011 09:57<br><b>=C3=80=C2=A0:</=
b> <a href="" href="mailto:AUDITORY@xxxxxxxxxxxxxxx">AUDITORY@xxxxxxxxxxxxxxx" target=3D"_blank">AUDITORY@L=
ISTS.MCGILL.CA</a><br><b>Objet=C2=A0:</b> [AUDITORY] Audio Glitch in Matlab=
<u></u><u></u></span></p>
</div></div><div><div></div><div class=3D"h5"><p class=3D"MsoNormal"><u></u=
>=C2=A0<u></u></p><p class=3D"MsoNormal"><span>I&#39;m writing to notify li=
st readers of a problem playing audio using Matlab. <br><br>The problem is =
that brief signals are truncated, and it happens using any of the common co=
mmands for playing audio (wavplay, sound, and the play method of the audiop=
layer object).<br>
<br>I can&#39;t specify the exact conditions under which the truncation occ=
urs. However, with a sample rate of 44.1 kHz, signals shorter than about 50=
0 msec are truncated. I haven&#39;t looked much at other sample rates.<br>
<br>A simple work-around for the problem is to pad the end of the signal wi=
th a sufficient number of zeros that truncation occurs during the zero segm=
ent. I&#39;ve found that at least 2000 zeros need to be added to assure no =
truncation of a 10-msec signal (with a sample rate of 44.1kHz).<br>
<br>I&#39;ve brought this problem to the attention of The Mathworks. They c=
onfirmed the problem, which they attribute to a bug in their driver. <br><b=
r>The Mathworks also informed me that the problem has been solved in their =
latest release (R2011b) for playing using audioplayer, but not necessarily =
for the other audio commands. I&#39;ve confirmed this in very limited tests=
. <br>
<br>The following is a piece of code that you can use to observe the trunca=
tion. It creates a 100-msec, 1-kHz sine wave, applies a hanning window, and=
 then plays it first with zero-padding and then without. You should be able=
 to hear the click at the end of the second tone, which is not present on t=
he first. If not, you can see it on an oscilloscope.<br>
<br>%%%%%%%%%%%%%%%%%%%%<br>fs =3D 44100;<br>f =3D 1000; <br>T =3D 0.1;<br>=
nPad =3D 2000;<br><br>nS =3D round(fs*T);<br><br>y =3D sin(2.*pi*f/fs*(1:nS=
)&#39;);<br>w =3D .5*(1 - cos(2*pi*(1:nS)&#39;/(nS+1)));<br>y =3D w.*y;<br>=
yPad =3D [y; zeros(nPad,1)];<br>
<br>wavplay(yPad, fs, &#39;sync&#39;)<br>pause(0.5)<br>wavplay(y, fs, &#39;=
sync&#39;)<br>%%%%%%%%%%%%%%%%%%%%%</span><br><br><u></u><u></u></p><pre>--=
 <u></u><u></u></pre><pre>Patrick M. Zurek<u></u><u></u></pre><pre>Presiden=
t <u></u><u></u></pre>
<pre><u></u>=C2=A0<u></u></pre><pre>Sensimetrics Corporation<u></u><u></u><=
/pre><pre>14 Summer St.<u></u><u></u></pre><pre>Suite 403<u></u><u></u></pr=
e><pre>Malden, MA 02148<u></u><u></u></pre><pre>Tel: <a href=""> -0858%20x237" value=3D"+17813990858" target=3D"_blank">781-399-0858 x237</a=
><u></u><u></u></pre>
<pre>Fax: <a href="" value=3D"+17813990853" target=3D"_bl=
ank">781-399-0853</a><u></u><u></u></pre><pre>email: <a href="" href="mailto:pat@">pat@=
sens.com" target=3D"_blank">pat@xxxxxxxx</a><u></u><u></u></pre><pre>web: <=
a href="" href="http://www.sens.com" target="_blank">http://www.sens.com" target=3D"_blank">www.sens.com</a><u></u><u>=
</u></pre>
</div></div></div></div></blockquote></div><br>

--0015175d03cc7857e604af80ffa9--

------------------------------

End of AUDITORY Digest - 14 Oct 2011 to 17 Oct 2011 - Special issue (#2011-238)
*******************************************************************************



--
Vijaya Kumar Narne PhD,
India