Re: [AUDITORY] Chirps with Cochlear Delay (Marc Schoenwiesner )


Subject: Re: [AUDITORY] Chirps with Cochlear Delay
From:    Marc Schoenwiesner  <marcs@xxxxxxxx>
Date:    Wed, 18 Jan 2023 21:22:24 +0100

--Apple-Mail=_D4A4385A-2C39-4B27-94B8-0374DB7BA343 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Dear Andrew, dear all, since this might be interesting to others as well, I=E2=80=99m replying = to the list: I used Torsten Dau=E2=80=99s optimal chirp about 20 years ago in am MEG = experiment and had asked him about a Matlab implementation, which he = kindly shared under a license that allows distribution. Please find it = attached. Since it is now archived on the list server, it will hopefully = remain accessible in the future. A Python reimplementation will also be = available in the slab toolbox in a week or two. Cheers, Marc --Apple-Mail=_D4A4385A-2C39-4B27-94B8-0374DB7BA343 Content-Disposition: attachment; filename=bmchirp.m Content-Type: application/octet-stream; x-unix-mode=0777; name="bmchirp.m" Content-Transfer-Encoding: quoted-printable function=20sig=20=3D=20bmchirp(f1,f2,fs,len,flat)=0D=0A%=20=20BMCHIRP=20= generates=20optimized=20Chirp=20described=20in=20Dau=20et=20al.=20(2000)=0D= =0A%=0D=0A%=09sig=20=3D=20bmchirp(f1,f2,fs,len,flat)=0D=0A%=09generates=20= the=20``approximated''=20optimized=20chirp=20developed=20by=20Dau=20et=20= al.=0D=0A%=09(2000).=20This=20chirp=20compensates=20for=20travel-time=20= differences=20along=20the=0D=0A%=09cochlear=20partition.=20The=20= equations=20were=20derived=20on=20the=20basis=20of=20a=20linear=0D=0A%=09= cochlea=20model=20(de=20Boer,=201980).=0D=0A%=0D=0A%=09A=20vector=20sig=20= is=20returned.=20The=20vector=20is=20filled=20with=20zeros=20to=20match=20= the=0D=0A%=09length=20of=20len.=20If=20len=20equals=20zero=20the=20= minimum=20length=20for=20the=20chirp=20will=0D=0A%=09be=20calculated.=0D=0A= %=0D=0A%=09f1=20=20:=20lower=20(start)=20frequency=20of=20the=20chirp=20= (in=20Hz)=0D=0A%=09f2=20=20:=20upper=20(stop)=20frequncy=20of=20the=20= chirp=20(in=20Hz)=0D=0A%=09fs=20=20:=20sampling=20frequency=20in=20Hz=20= (standard:=2025000=20Hz)=0D=0A%=09len=20:=20length=20of=20the=20chirp=20= in=20s=20(standard:=200=20s)=0D=0A%=09flat:=20flat=20spectrum=20(1)=20or=20= not=20(0)=20(standard:=200)=0D=0A%=09sig=20:=20the=20resulting=20chirp=20= (output)=0D=0A%=0D=0A%=09This=20script=20is=20based=20upon=20the=20= article=20by=0D=0A%=09T.=20Dau,=20O.=20Wegner,=20V.=20Mellert=20and=20B.=20= Kollmeier=20(2000):=20"Auditory=0D=0A%=09brainstem=20response=20with=20= optimized=20chirp=20signals=20compensating=0D=0A%=09basilar-membrane=20= dispersion."=20J=20Acoust=20Soc=20Am=20107(3):=201530-1540.=0D=0A%=0D=0A= %=09Derivation=20of=20traveling=20wave=20velocity:=0D=0A%=09E=20de=20= Boer=20(1980):=20"Auditory=20physics.=20Physical=20principles=20in=20= hearing=0D=0A%=09theory=20I",=20Phys=20Rep=20(62),=2087-174.=0D=0A%=0D=0A= %=09Cochlear=20frequency-position=20function:=0D=0A%=09DD=20Greenwood=20= (1990):=20"A=20cochlear=20frequency-position=20function=20for=0D=0A%=09= several=20species=20--=2029=20years=20later",=20J=20Acoust=20Soc=20Am=20= (87),=202592-2605.=0D=0A%=0D=0A%=20(c)=20O.=20Wegner,=20T.=20Dau=2009/96=0D= =0A%=20$Revision:=201.9=20$=20=20$Date:=202003/06/24=2013:25:41=20$=0D=0A= =0D=0A%=20All=20numbered=20equations=20refer=20to=20the=20corresponding=20= equations=20in=20the=0D=0A%=20JASA=20article=20by=20Dau=20et=20al.=20= (2000).=0D=0A=0D=0A%=20check=20for=20f1=20and=20f2=0D=0Aif=20(=20nargin=20= <=202=20)=0D=0A=20=20help=20bmchirp=0D=0A=20=20return=0D=0Aend=0D=0A=0D=0A= if=20(f1=20>=20f2)=0D=0A=20=20error('f1=20>=20f2:=20not=20allowed');=0D=0A= end=0D=0A=0D=0A%=20standard=20values:=0D=0Alen_std=20=3D=200.0;=09=09=09=20= %=20standard=20value=20for=20len=20(means=20minimum=20length)=0D=0A= flat_std=20=3D=200;=09=09=09=20%=20standard=20value=20for=20= flat-spectrum=20switch=0D=0Afs_std=20=3D=2025000.0;=09=09=20%=20standard=20= value=20for=20fs=0D=0A=0D=0A%=20check=20for=20flat=0D=0Aif=20= (exist('flat')=20~=3D=201)=0D=0A=20=20flat=20=3D=20flat_std;=0D=0Aelseif=20= isempty(flat)=0D=0A=20=20flat=20=3D=20flat_std;=0D=0Aend=0D=0A=0D=0A%=20= check=20for=20len=0D=0Aif=20(exist('len')=20~=3D=201)=0D=0A=20=20len=20=3D= =20len_std;=0D=0Aelseif=20isempty(len)=0D=0A=20=20len=20=3D=20len_std;=0D= =0Aend=0D=0A=0D=0A%=20check=20for=20fs=0D=0Aif=20(exist('fs')=20~=3D=20= 1)=0D=0A=20=20fs=20=3D=20fs_std;=0D=0Aelseif=20isempty(fs)=0D=0A=20=20fs=20= =3D=20fs_std;=0D=0Aend=0D=0A=0D=0Alen=20=3D=20ceil(len*fs);=09=09=20%=20= len=20in=20samples=20(rounded=20towards=20next=20integer)=0D=0At0=20=3D=20= bmtime(0);=09=09=09=20%=20time=20for=200=20Hz=20(reference)=0D=0At1=20=3D=20= t0=20-=20bmtime(f1);=09=09=20%=20time=20for=20f1=0D=0At2=20=3D=20t0=20-=20= bmtime(f2);=09=09=20%=20time=20for=20f2=0D=0Asamples=20=3D=20ceil((t2=20= -=20t1)=20*=20fs);=09=20%=20samples=20needed=20(rounded=20towards=20next=20= integer)=0D=0Aif=20(len=20=3D=3D=200)=20len=20=3D=20samples;=20end=20%=20= len=20=3D=200=20=3D>=20optimal=20fill=0D=0Aif=20(samples=20>=20len)=09=09= =20%=20is=20len=20long=20enough?=0D=0A=20=20error(sprintf('at=20least=20= %f=20s=20are=20needed',samples/fs));=0D=0Aend=0D=0At=20=3D=20t1=20:=20= 1/fs=20:=20t2;=09=09=20%=20time-axis=0D=0Asig=20=3D=20amplitude(t,flat)=20= .*=20sin(instphas(t)-instphas(t1));=09%=20generate=20chirp=0D=0Asig=20=3D=20= [sig=20zeros(1,len-length(t))];=09=09=09=09%=20fill=20up=20with=20zeros=0D= =0A=0D=0A= %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%= %%%%%=0D=0Afunction=20time=20=3D=20bmtime(f)=0D=0A%BMTIME=20=20=20= traveling=20time=20on=20the=20basilar=20membrane=0D=0A%=0D=0A%=09time=20= =3D=20bmtime(f)=0D=0A%=09returns=20the=20time=20(in=20s)=20a=20pulse=20= needs=20to=20get=20to=20the=0D=0A%=09position=20on=20the=20basilar=20= membrane=20which=20represents=20the=0D=0A%=09frequency=20f=20(in=20Hz).=0D= =0A%=0D=0A%=20(c)=20O.=20Wegner,=20T.=20Dau=2009/96=0D=0A=0D=0A%=20= Constants:=0D=0A%=20from=20de=20Boer=20(1980),=20p.=20147:=0D=0AC0=20=3D=20= 10^9;=09=09=09=09%=2010^9=20g=20s^(-2)=20cm^(-2)=20=3D=3D=2010^4=20N=20= cm^(-3)=0D=0Ah=20=3D=200.1;=09=09=09=09%=20cm=0D=0Arho=20=3D=201.0;=09=09= =09=09%=20g=20cm^(-3)=0D=0Aalpha=20=3D=203.0;=09=09=09=09%=201/cm=0D=0A%=20= from=20Greenwood=20(1990):=0D=0Aa=20=3D=200.006046;=09=09=09=09%=201/Hz=0D= =0Ac=20=3D=201.67/log(10);=09=09=09%=20cm=0D=0AL=20=3D=203.485;=09=09=09=09= %=20cm=0D=0A=0D=0Abeta=20=3D=202/alpha*sqrt(2*rho/(h*C0));=09%=20s=0D=0A=0D= =0Atime=20=3D=20beta*((a*f+1).^-(alpha*c/2)*exp(L*alpha/2)-1);=09%=20rf.=20= eq.=20(13)=0D=0A=0D=0A= %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%= %%%%%=0D=0Afunction=20phi=20=3D=20instphas(t)=0D=0A%INSTPHAS=20= instantaneous=20phase=0D=0A%=0D=0A%=09phi=20=3D=20instphas(t)=0D=0A%=09= calculates=20the=20instantaneous=20phase=20at=20a=20given=20time=20t=0D=0A= %=09(in=20s)=20for=20a=20stimulus=20that=20should=20compensate=20the=0D=0A= %=09spatial=20dispersion=20on=20the=20basilar=20membrane.=20It=20is=20= used=0D=0A%=09by=20the=20function=20bmchirp.=0D=0A%=0D=0A%=20(c)=20O.=20= Wegner,=20T.=20Dau=2009/96=0D=0A=0D=0A%=20Constants:=0D=0A%from=20de=20= Boer=20(1980):=0D=0AC0=20=3D=2010^9;=09=09%=2010^4=20N=20cm^(-3)=0D=0Ah=20= =3D=200.1;=09=09%=20cm=0D=0Arho=20=3D=201.0;=09=09%=20g=20cm^(-3)=0D=0A= alpha=20=3D=203.0;=09=09%=201/cm=0D=0A%=20from=20Greenwood=20(1990):=0D=0A= a=20=3D=200.006046;=09=09=09=09%=201/Hz=0D=0Ac=20=3D=201.67/log(10);=09=09= =09%=20cm=0D=0AL=20=3D=203.485;=09=09=09=09%=20cm=0D=0A%=0D=0At0=20=3D=20= bmtime(0);=09=09=09=09%=20time=20for=200=20Hz=20(reference)=0D=0Abeta=20= =3D=202/alpha*sqrt(2*rho/(h*C0));=0D=0Agamma=20=3D=20-2/(alpha*c);=0D=0A= tau0=20=3D=20t0+beta;=09=0D=0A=0D=0Aphi=20=3D=20-2*pi/a=20*=20(t+=20(=20= (tau0-t).^(gamma+1)=20-=20tau0^(gamma+1)=20)=20/=20...=0D=0A=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= ((beta*exp(alpha*L/2))^gamma=20*=20(gamma+1))=20);=0D=0A=0D=0A=0D=0A= %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%= %%%%%=0D=0Afunction=20amp=20=3D=20amplitude(t,o_flat)=0D=0A%=20AMMPLITUD=09= calculates=20the=20amplitude=20factors=0D=0A%=0D=0A%=09amp=20=3D=20= amplitude(o_flat)=0D=0A%=09calculates=20the=20tiem=20dependent=20= amplitude=20factors=20for=20the=20normal=20chirp=0D=0A%=09(o_flat=20=3D=20= 0)=20or=20the=20flat-spectrum=20chirp=20(o_flat=3D1).=0D=0A%=0D=0A%=09t=09= time=20axis=0D=0A%=09o_flat=09flat-spectrum=20(1)=20or=20not=20(0)=0D=0A= %=0D=0A%=20(c)=20O.=20Wegner=2011/00=0D=0A=0D=0A%=20Constants:=0D=0A= %from=20de=20Boer=20(1980):=0D=0AC0=20=3D=2010^9;=09=09%=2010^4=20N=20= cm^(-3)=0D=0Ah=20=3D=200.1;=09=09%=20cm=0D=0Arho=20=3D=201.0;=09=09%=20g=20= cm^(-3)=0D=0Aalpha=20=3D=203.0;=09=09%=201/cm=0D=0A%=20from=20Greenwood=20= (1990):=0D=0Aa=20=3D=200.006046;=09=09=09=09%=201/Hz=0D=0Ac=20=3D=20= 1.67/log(10);=09=09=09%=20cm=0D=0AL=20=3D=203.485;=09=09=09=09%=20cm=0D=0A= %=0D=0At0=20=3D=20bmtime(0);=09=09=09=09%=20time=20for=200=20Hz=20= (reference)=0D=0Abeta=20=3D=202/alpha*sqrt(2*rho/(h*C0));=0D=0Agamma=20=3D= =20-2/(alpha*c);=0D=0A=0D=0Aif=20o_flat,=0D=0A=20=20amp=20=3D=20= sqrt(1/a*(-gamma*exp(-L*alpha/2)/beta*=20= (exp(-L*alpha/2)*(1+(t0-t)/beta)).^(gamma-1)));=0D=0A=20=20amp=20=3D=20= amp=20/=20max(abs(amp));=0D=0Aelse=0D=0A=20=20amp=20=3D=201;=0D=0Aend=0D=0A= =0D=0A= %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%= %%%%%=0D=0A%%=0D=0A%%=09Copyright=20(C)=201996=09Torsten=20Dau,=20Oliver=20= Wegner=0D=0A%%=09=09=09=09Carl=20von=20Ossietzky=20Universitaet=20= Oldenburg=0D=0A%%=0D=0A%%=09Permission=20to=20use,=20copy,=20and=20= distribute=20this=20software/file=20and=20its=0D=0A%%=09documentation=20= for=20any=20purpose=20without=20permission=20by=20the=20author=0D=0A%%=09= is=20strictly=20forbidden.=0D=0A%%=0D=0A%%=09Permission=20to=20modify=20= the=20software=20is=20granted,=20but=20not=20the=20right=20to=0D=0A%%=09= distribute=20the=20modified=20code.=0D=0A%%=0D=0A%%=09This=20software=20= is=20provided=20"as=20is"=20without=20expressed=20or=20implied=20= warranty.=0D=0A%%=0D=0A%%=0D=0A%%=09AUTHORS=0D=0A%%=0D=0A%%=09=09Torsten=20= Dau=20/=20Oliver=20Fobel=0D=0A%%=09=09Acoustic=20Technology,=20= =D8rsted=B7DTU=0D=0A%%=09=09Centre=20for=20Applied=20Hearing=20Research=0D= =0A%%=09=09Technical=20University=20of=20Denmark,=20Building=20352=0D=0A= %%=09=09=D8rsteds=20Plads=0D=0A%%=09=09DK-2800=20Kgs.=20Lyngby=0D=0A%%=09= =09Denmark=0D=0A%%=0D=0A%%=09=09e-mail:=09=09tda@xxxxxxxx=0D=0A%%=09= =09=09=09of@xxxxxxxx=0D=0A%%=0D=0A= %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%= %%%%%=0D=0A= --Apple-Mail=_D4A4385A-2C39-4B27-94B8-0374DB7BA343 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Dean, Dept of Life Sciences Professor of Neurobiology Department of Biology University of Leipzig Talstrasse 33 __o 04103 Leipzig _`\<,_ +493419736723 (+) / (+) & Department of Psychology University of Montreal Montreal, Quebec, Canada www.uni-leipzig.de/~neuro/ =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > On 17. Jan 2023, at 23:29, Andrew Levitsky <alevitsk@xxxxxxxx> = wrote: >=20 > Hello Auditory List, >=20 > I have been working on a masked ABR experiment and wanted to generate = a chirp that compensated for basilar membrane traveling wave delay, akin = to what was discussed in the 2010 Chertoff = (https://asa.scitation.org/doi/full/10.1121/1.3372756) and 2004 Fobel & = Dau (https://asa.scitation.org/doi/pdf/10.1121/1.1787523) articles. = While the articles do include the formulas that they used, I am not sure = how to actually apply said formulas in Matlab, or if they are compatible = with the built-in chirp function that Matlab has. Does anyone have any = advice for generating them in our script? >=20 > Thank you, > Andrew >=20 > --=20 > Andrew Levitsky > Research Associate > Carnegie Mellon Neuroscience Institute > alevitsk@xxxxxxxx > M: (908) 420-9917 --Apple-Mail=_D4A4385A-2C39-4B27-94B8-0374DB7BA343--


This message came from the mail archive
src/postings/2023/
maintained by:
DAn Ellis <dpwe@ee.columbia.edu>
Electrical Engineering Dept., Columbia University