Skip to search.
praat-users · Praat Users Group

Group Information

? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
You can search the group for older messages.

Messages

  Messages Help
Advanced
Messages 58 - 87 of 6385   Oldest  |  < Older  |  Newer >  |  Newest
Messages 58 - 87 of 6385   Oldest  |  < Older  |  Newer >  |  Newest
Messages: Show Message Summaries Sort by Date ^  
#58 From: Matt Davis <matt.davis@...>
Date: Wed Jan 10, 2001 2:29 pm
Subject: Speech shaped noise
matt.davis@...
Send Email Send Email
 
Dear Praat Users,

I am trying to make speech shaped noise using Praat (i.e. noise with the
same spectral profile as an original speech file). The following code seems
to do the right thing, but for reasons that I can't understand, produces an
output file that is approximately 2 seconds longer than the original sound
file.

###############################

select Sound Speech
durn = Get duration
sr = Get sample rate
To Spectrum

Create Sound... Noise 0 'durn' 'sr' randomGauss(0,0.1)
To Spectrum

select Spectrum Noise
Formula... 1000 * self * Spectrum_Speech[col]

select Spectrum Noise
To Sound

###############################

Can anyone help me figure out what I am doing wrong.

Thanks for your help (and for such an excellent program),

Matt


****************************************************
  Matt Davis
  MRC Cognition and Brain Sciences Unit
  15 Chaucer Road, Cambridge, CB2 2EF

  email: matt.davis@...
    tel: 01223 355 294 (#621)
    Fax: 01223 359 062

****************************************************

#59 From: Paul Boersma <paul.boersma@...>
Date: Thu Jan 11, 2001 3:18 pm
Subject: Re: Speech shaped noise
paul.boersma@...
Send Email Send Email
 
Matt Davis wrote:

>I am trying to make speech shaped noise using Praat (i.e. noise with the
>same spectral profile as an original speech file). The following code seems
>to do the right thing, but for reasons that I can't understand, produces an
>output file that is approximately 2 seconds longer than the original sound
>file.
>
>###############################
>
>select Sound Speech
>durn = Get duration
>sr = Get sample rate
>To Spectrum
>
>Create Sound... Noise 0 'durn' 'sr' randomGauss(0,0.1)
>To Spectrum
>
>select Spectrum Noise
>Formula... 1000 * self * Spectrum_Speech[col]
>
>select Spectrum Noise
>To Sound
>
>###############################

The Sound-to-Spectrum procedure is implemented as a Fast Fourier Transform,
which only works for a number of samples that is a power of two.
For instance, if the Sound has 20,000 samples, the first thing
that Praat does is adding 12,768 samples at the end, filled with zeroes,
giving a total of 32,768 samples, which is the fifteenth power of 2.
This is followed by the FFT to give a Spectrum. Then if you go back
to Sound, you get a sound with 32,768 samples again.
To make the resulting sound equally long as the original, add the line

    Extract part... 0 durn Rectangular 1.0 no

at the end of your script.

By the way, your script does not produce speech-shaped noise.
The formula multiplies the first "rows" (real parts) of two spectra,
and it multiplies the second "rows" (imaginary parts) of two spectra.

To get speech-shaped noise, you first create a sequence
of phases uniformly distributed between 0 and 2pi:

    select Spectrum Speech
    nbin = Get number of bins
    Create Sound... Phases 0 1 nbin randomUniform (0, 2 * pi)

You then create a new Spectrum object with the same power
as the original, but with a random phase:

    select Spectrum Speech
    Copy... Ranphas
    Formula... if row = 1
    ... then Spectrum_Speech [1, col] * cos (Sound_Phases [1, col])
    ... + Spectrum_Speech [2, col] * sin (Sound_Phases [1, col])
    ... else Spectrum_Speech [1, col] * sin (Sound_Phases [1, col])
    ... + Spectrum_Speech [2, col] * cos (Sound_Phases [1, col])
    ... fi
    To Sound
    Extract part... 0 durn Rectangular 1.0 no

Alternatively, you might replace the single formula by the following
three formulas:

    select Spectrum Speech
    Formula... if row = 1 then sqrt (self [1, col] ^ 2 + self [2, col] ^ 2) else
0 fi
    Formula... if row = 1 then self else self [1, col] * sin (Sound_Phases [1,
col]) fi
    Formula... if row = 1 then self * cos (Sound_Phases [1, col]) else self fi
    To Sound
    Extract part... 0 durn Rectangular 1.0 no

which also saves a Copy operation.

Best wishes,
    Paul
--

Paul Boersma
Institute of Phonetic Sciences, University of Amsterdam
Herengracht 338, 1016CG Amsterdam, The Netherlands
http://www.fon.hum.uva.nl/paul/

#60 From: "Doina Trandafir" <dtrandafir@...>
Date: Fri Feb 2, 2001 8:32 am
Subject: I'm interested in voive analysis
dtrandafir@...
Send Email Send Email
 
Hello!
I am Doina Trandafir, psychologist in Romania. I work for National
Institute of Aerospatial Medicine. I'm interested in voice analysis
field, in correlation between emotions and language, especially under
stress and fatigue conditions. I read some paper about PRAAT.
I would some information about PRAAT, in fact if it's adequate for my
purpose and if  it's another better. I'm interested in a finely
analyses of the vocal parameters.
I am at the start of my research and I found nothing to read in my
country. The only source for me is the Internet and the communication
with people who study this subject. Now I am a little confused
because I found here a lot of papers and I must to "organize" them.
Any messages will be welcome.
Thank you very much,
Doina

#61 From: gandour@...
Date: Wed Feb 7, 2001 9:06 pm
Subject: Adjusting pitch using script instead of by hand
gandour@...
Send Email Send Email
 
Task: increase pitch of all non-zero frames within a file by a constant Hz
value, i.e. change pitch height but preserve pitch contour and duration of
original file

Implementation: by hand simply hold SHIFT key down and drag pitch
contour to desired pitch level

Problem: hundreds of files; tried using pitch tier and matrix but it filled in
all zero frames as well as nonzero frames

Advice requested: either example of script file or point to feature in Praat
that will permit us to program this task in script language

Tnx.

#62 From: Daniel Hirst <daniel.hirst@...>
Date: Thu Feb 8, 2001 5:41 am
Subject: Re: Adjusting pitch using script instead of by hand
daniel.hirst@...
Send Email Send Email
 
Just a question on why you would want to do this before someone gives
you a practical answer. You say you want to

>    increase pitch of all non-zero frames within a file by a constant
Hz
>   value, i.e. change pitch height but preserve pitch contour and
duration of
>   original file

but adding a constant Hz value will NOT preserve the pitch contour - a
pitch rise from say 100 Hz to 120 Hz will appear to be a much smaller
rise than one from 200 to  220 Hz. There is no reason to think that the
linear Hz scale is any more "theory neutral" than any other scale.

A better solution would be to increase all pitch values by a constant
ratio so that a rise from 100 Hz to 120 Hz would be transformed into a
rise from 200 Hz to 240 Hz. This could be  implemented as a constant
rise on a log scale (ie 1.2 octaves) - a more sophisticated solution
would be to use the ERB scale which, it has been argued, is the most
appropriate scale for comparing pitch changes in different registers.

Both log scales and ERB scales can be used in Praat as well as the
linear Hz scale.


--
---------------------------------------------------------------
   Laboratoire Parole et Langage, CNRS, Université de Provence
   Equipe Prosodie et Représentation Formelle du Langage
    29 Avenue Schuman, 13621 Aix-en-Provence cedex 1 FRANCE
tel:+33 4 4295 3628  secr:+33 4 4295 3634  fax: +33 4 4259 5096
           web: http://www.lpl.univ-aix.fr/~hirst
---------------------------------------------------------------
If (you are interested in Speech Prosody) {
   subscribe to the SProSIG list;
} #        http://www.egroups.com/group/sprosig/
---------------------------------------------------------------

#63 From: Daniel Hirst <daniel.hirst@...>
Date: Thu Feb 8, 2001 5:52 am
Subject: Re: Adjusting pitch using script instead of by hand
daniel.hirst@...
Send Email Send Email
 
Oops - I wrote my last message too quickly sorry :

Multiplying by a constant ratio of 1.2 is equivalent to adding a
constant of (about) 0.263 on an octave scale and not (of course) 1.2
octaves as I wrote. If you are more used to using semitones this would
be about 3.156 semitones...

--
---------------------------------------------------------------
   Laboratoire Parole et Langage, CNRS, Université de Provence
   Equipe Prosodie et Représentation Formelle du Langage
    29 Avenue Schuman, 13621 Aix-en-Provence cedex 1 FRANCE
tel:+33 4 4295 3628  secr:+33 4 4295 3634  fax: +33 4 4259 5096
           web: http://www.lpl.univ-aix.fr/~hirst
---------------------------------------------------------------
If (you are interested in Speech Prosody) {
   subscribe to the SProSIG list;
} #        http://www.egroups.com/group/sprosig/
---------------------------------------------------------------

#64 From: Paul Boersma <paul.boersma@...>
Date: Thu Feb 8, 2001 12:47 pm
Subject: Re: Adjusting pitch using script instead of by hand
paul.boersma@...
Send Email Send Email
 
Jack Gandour wrote:

> Task: increase pitch of all non-zero frames within a file by a constant Hz
> value, i.e. change pitch height but preserve pitch contour and duration of
> original file

Daniel Hirst wrote:

> A better solution would be to increase all pitch values by a constant ratio
...
> a more sophisticated solution would be to use the ERB scale

*******

The following script works on a selected PitchTier object.
It shifts all F0 values by a number of Hertz, semitones, octaves, Mels, or ERBs:

form Shift the pitch
    real Shift 2.0
    choice Units: 1
       button Hertz
       button semitones
       button octaves
       button Mels
       button ERBs
endform
original = selected ("PitchTier")
tmin = Get starting time
tmax = Get finishing time
n = Get number of points
Create PitchTier... shifted tmin tmax
for i to n
    select 'original'
    time = Get time from index... i
    f0 = Get value at index... i
    select PitchTier shifted
    if units$ = "Hertz"
       Add point... time f0 + shift
    elsif units$ = "semitones"
       Add point... time semitonesToHertz (hertzToSemitones (f0) + shift)
    elsif units$ = "octaves"
       Add point... time semitonesToHertz (hertzToSemitones (f0) + 12 * shift)
    elsif units$ = "Mels"
       Add point... time melToHertz (hertzToMel (f0) + shift)
    elsif units$ = "ERBs"
       Add point... time erbToHertz (hertzToErb (f0) + shift)
    endif
endfor

--

Paul Boersma
Institute of Phonetic Sciences, University of Amsterdam
Herengracht 338, 1016CG Amsterdam, The Netherlands
http://www.fon.hum.uva.nl/paul/

#65 From: Michael T Hammond <hammond@...>
Date: Thu Feb 8, 2001 4:47 pm
Subject: 8-bit *.au
hammond@...
Send Email Send Email
 
hello

does anybody know how to save a .au file as 8-bit, rather than 16-bit from
praat?

mike hammond

#66 From: "Jeff Haynes" <jeff@...>
Date: Fri Feb 9, 2001 1:57 am
Subject: covariance confusion...
jeff@...
Send Email Send Email
 
Hi, I'm just getting into Praat and I'm looking to do some PCA and NN stuff.
Unfortunately, I'm having trouble getting started off.  If you want to
produce a TableOfReals, where does the original multivariate data come from?
I have a bunch of sound files - do I have to generate that data myself or
can Praat do it?  For example, how was the Pols data (50 males) table
created?  Thanks in advance to anyone who can help me find my way.

- Jeff Haynes
- USC Signal and Image Processing Institute

#67 From: "Jeff Haynes" <jeff@...>
Date: Fri Feb 9, 2001 2:05 am
Subject: Ok...I think I see but
jeff@...
Send Email Send Email
 
As usual, I wrote too soon.  I see how the Pols data was created.
However, I am now confused as to how this occurs with multiple data
sources.  I guess I am hazy on what I am looking at.  Sorry for the
premptive post!


--- In praat-users@y..., "Jeff Haynes" <jeff@d...> wrote:
> Hi, I'm just getting into Praat and I'm looking to do some PCA and
NN stuff.
> Unfortunately, I'm having trouble getting started off.  If you want to
> produce a TableOfReals, where does the original multivariate data
come from?
> I have a bunch of sound files - do I have to generate that data
myself or
> can Praat do it?  For example, how was the Pols data (50 males) table
> created?  Thanks in advance to anyone who can help me find my way.
>
> - Jeff Haynes
> - USC Signal and Image Processing Institute

#68 From: gelida@...
Date: Fri Feb 9, 2001 2:46 pm
Subject: reading VocalTract parameters
gelida@...
Send Email Send Email
 
Hi guys!
I'm new to the list and to Praat. Very excited with the musical
applications of such wonderful tool.
By now I'd like to be able to generate picewise cylindrical bore
structures corresponding to given vocal tract configurations, to use
them with Csound. Is that possible to do with Praat? how? I should
need only the number, length and radius of each section.

Thanks in advance,
Josep M

#69 From: gandour@...
Date: Fri Feb 9, 2001 7:26 pm
Subject: Changing time duration without changing the pitch of a sound
gandour@...
Send Email Send Email
 
First, thank you for very helpful replies to earlier query.

I wish to stretch or compress the time duration of a sound without altering
the pitch contour to meet specific time lengths. Does anybody have any
sample scripts to illustrate how to do this?

Thanks very much.

#70 From: Paul Boersma <paul.boersma@...>
Date: Fri Feb 9, 2001 10:21 pm
Subject: Re: Changing time duration without changing the pitch of a sound
paul.boersma@...
Send Email Send Email
 
>I wish to stretch or compress the time duration of a sound without altering
>the pitch contour to meet specific time lengths. Does anybody have any
>sample scripts to illustrate how to do this?

how about by hand in the Analysis editor, see the "Manipulation of duration"
tutorial.

But if you want to change the duration by a constant factor, you can also
just use "Lengthen (PSOLA)...", which is in the Enhance submenu
when you select a sound (this command can also *shorten* the sound).
--

Paul Boersma
Institute of Phonetic Sciences, University of Amsterdam
Herengracht 338, 1016CG Amsterdam, The Netherlands
http://www.fon.hum.uva.nl/paul/

#71 From: "CROSET PIERRE JEAN" <musimat@...>
Date: Sat Feb 10, 2001 5:33 pm
Subject: Re: pierre jean croset
musimat@...
Send Email Send Email
 
may you cancel my on "praat user".at this moment I do not need and I do not
need to receive E mail from you.
later may be.
thank you
mathieu pierre jean----------
> De : Paul Boersma <paul.boersma@...>
> A : praat-users@...
> Objet : Re: [praat-users] Changing time duration without changing the
pitch of a sound
> Date : vendredi 9 février 2001 23:21
>

#72 From: Gareth Walker <gw115@...>
Date: Wed Feb 14, 2001 10:28 am
Subject: F1 F2 script
gw115@...
Send Email Send Email
 
Hi all

I am trying to put together a script that will draw F1 against F2.
Following some help from Paul Boersma on a related script, scripts from
other people, and trial and error, I have come up with the following...


form Enter character
         word Symbol *
endform

To Formant (burg)... 0.01 5 5500 0.025 50
Formula (frequencies)... self * -1
Down to FormantTier
f1 = Get value at time... 1 0.05
f2 = Get value at time... 2 0.05
f21 = f2 - f1

select Formant untitled
Remove
select FormantTier untitled
Remove

Axes... -2500 -500 -1000 -0
Draw inner box
for i from 1 to 5
    f21 = i * 500
    One mark bottom... -f21 no yes yes 'f21'
endfor
for i from 0 to 5
    f1 = i * 200
    One mark left... -f1 no yes yes 'f1'
endfor
Text left... yes %F_1 (Hz)
Text bottom... yes %F_2 \-- %F_1 (Hz)

On the positive side, it seems to correctly pull out the f1 and f2
values, and subtracts the one from the other, and it draws the axes
correctly.  The problems which I would really like help with are
1. how do I get the readouts for a single point (say, at the cursor?)
rather than having to specify a time
2. the values don't plot on the graph that gets drawn!  I guess I am
missing something important to take the values generated in the first
part of the script and actually plot them, but I don't know what!

All comments/suggestions greatly appreciated,

Gareth Walker

#73 From: Gareth Walker <gw115@...>
Date: Wed Feb 14, 2001 10:33 am
Subject: Re: F1 F2 script
gw115@...
Send Email Send Email
 
in my haste to type the mail, I didn't make it clear that I want to plot
f1 against f2 *minus* f1.

Apologies for cluttering your inboxes!

Gareth

Gareth Walker wrote:
>
> Hi all
>
> I am trying to put together a script that will draw F1 against F2.
> Following some help from Paul Boersma on a related script, scripts from
> other people, and trial and error, I have come up with the following...
>
> form Enter character
>         word Symbol *
> endform
>
> To Formant (burg)... 0.01 5 5500 0.025 50
> Formula (frequencies)... self * -1
> Down to FormantTier
> f1 = Get value at time... 1 0.05
> f2 = Get value at time... 2 0.05
> f21 = f2 - f1
>
> select Formant untitled
> Remove
> select FormantTier untitled
> Remove
>
> Axes... -2500 -500 -1000 -0
> Draw inner box
> for i from 1 to 5
>    f21 = i * 500
>    One mark bottom... -f21 no yes yes 'f21'
> endfor
> for i from 0 to 5
>    f1 = i * 200
>    One mark left... -f1 no yes yes 'f1'
> endfor
> Text left... yes %F_1 (Hz)
> Text bottom... yes %F_2 \-- %F_1 (Hz)
>
> On the positive side, it seems to correctly pull out the f1 and f2
> values, and subtracts the one from the other, and it draws the axes
> correctly.  The problems which I would really like help with are
> 1. how do I get the readouts for a single point (say, at the cursor?)
> rather than having to specify a time
> 2. the values don't plot on the graph that gets drawn!  I guess I am
> missing something important to take the values generated in the first
> part of the script and actually plot them, but I don't know what!
>
> All comments/suggestions greatly appreciated,
>
> Gareth Walker
>
> To Post a message, send it to:   praat-users@eGroups.com
> To Unsubscribe, send a blank message to: praat-users-unsubscribe@eGroups.com
> To consult archives :            http://egroups.com/list/praat-users/

#74 From: Paul Boersma <paul.boersma@...>
Date: Wed Feb 14, 2001 12:55 pm
Subject: Re: F1 F2 script
paul.boersma@...
Send Email Send Email
 
>On the positive side, it seems to correctly pull out the f1 and f2
>values, and subtracts the one from the other, and it draws the axes
>correctly.  The problems which I would really like help with are

>1. how do I get the readouts for a single point (say, at the cursor?)
>rather than having to specify a time

The editors have query buttons like "Get cursor", which gets you the time
of the cursor. So your script could start in the editor (start with
"New script" in the editor window), and the first lines would be

time = Get cursor
Move B to... time-0.05
Move E to... time+0.05
Extract selection
endeditor
    Rename... dummy
    To Formant... etc

>2. the values don't plot on the graph that gets drawn!  I guess I am
>missing something important to take the values generated in the first
>part of the script and actually plot them, but I don't know what!

your script does not contain any command that tells Praat to draw
your 'symbol' to the picture. For that, do something like

Text... -f21 Centre -f1 Half 'symbol$'

--

Paul Boersma
Institute of Phonetic Sciences, University of Amsterdam
Herengracht 338, 1016CG Amsterdam, The Netherlands
http://www.fon.hum.uva.nl/paul/

#75 From: cjd@...
Date: Wed Feb 14, 2001 2:45 pm
Subject: Re: F1 F2 script
cjd@...
Send Email Send Email
 
--- In praat-users@y..., Gareth Walker <gw115@y...> wrote:
> in my haste to type the mail, I didn't make it clear that I want to
plot
> f1 against f2 *minus* f1.


A simple way to do the F2-F1 against F1 is:

To Formant (burg)... 0.01 5 5500 0.025 50
Down to FormantTier
Down to TableOfReal... yes no
Formula... if col = 1 then self[row,3] - self [row,2] else self fi
Set column label (label)... Time F2-F1
Draw scatter plot... 2 1 0 0 0 0 0 0 no yes


Chris Darwin

#76 From: Gareth Walker <gw115@...>
Date: Mon Feb 19, 2001 4:23 pm
Subject: Re: Re: F1 F2 script
gw115@...
Send Email Send Email
 
Thanks for all the advice/help.

Currently, this is the best I can come up with, though I have not tested
it extensively. Any further advice/improvements gratefully received.

Gareth

~~~~~~~~~~~~~~~~~~~~~~~~

#This script
#   takes a window seconds around the cursor in a sound editor window
#   does a formant analysis
#   prints F1, F2, F3 and F2-F1 to a window
#   makes these values negative
#   plots the values on a reversed axes chart
#   removes the formant file and reselects the original sound
#To do: currently, each time you run this script a formant analysis is
made of the whole file, which can take some time.
#There are two ways round this: make an extraction of a smaller section
of the file first, and run the script on that,
#or add some lines to the script that will extract a selection for you
and then run the formant analysis on that.

getnameofselected name Sound

time = Get cursor
Move B to... time-0.02
Move E to... time+0.02
endeditor

#IMPORTANT: see manual for how to specify this for individual speakers.
To Formant (burg)... 0.01 5 5000 0.025 50
#comment out clearinfo and each printline to avoid displaying the
figures in a window
clearinfo
f1 = Get value at time... 1 time Hertz Linear
    printline 'f1' Hertz (F1)
f2 = Get value at time... 2 time Hertz Linear
    printline 'f2' Hertz (F2)
f3 = Get value at time... 3 time Hertz Linear
    printline 'f3' Hertz (F3)
f21 = f2 - f1
    printline 'f21' Hertz (F2-F1)

Formula (frequencies)... self * -1
f1neg = Get value at time... 1 time Hertz Linear
#   printline 'f1neg'
f2neg = Get value at time... 2 time Hertz Linear
#   printline 'f2neg'
f21neg = f2neg - f1neg
#   printline 'f21neg'
form Enter character
    word Symbol *
endform
Axes... -2500 -0 -1400 -0
Draw inner box
for i from 0 to 5
    f21lab = i * 500
    One mark top... -f21lab no yes yes 'f21lab'
endfor
    for i from 0 to 7
    f1lab = i * 200
    One mark right... -f1lab no yes yes 'f1lab'
endfor
Text right... yes %F_1 (Hz)
Text top... yes %F_2 \-- %F_1 (Hz)
Text... f21neg Centre f1neg Half 'symbol$'

select Formant 'name'
Remove
select Sound 'name'

cjd@... wrote:
>
> --- In praat-users@y..., Gareth Walker <gw115@y...> wrote:
> > in my haste to type the mail, I didn't make it clear that I want to
> plot
> > f1 against f2 *minus* f1.
>
> A simple way to do the F2-F1 against F1 is:
>
> To Formant (burg)... 0.01 5 5500 0.025 50
> Down to FormantTier
> Down to TableOfReal... yes no
> Formula... if col = 1 then self[row,3] - self [row,2] else self fi
> Set column label (label)... Time F2-F1
> Draw scatter plot... 2 1 0 0 0 0 0 0 no yes
>
> Chris Darwin
>
> To Post a message, send it to:   praat-users@eGroups.com
> To Unsubscribe, send a blank message to: praat-users-unsubscribe@eGroups.com
> To consult archives :            http://egroups.com/list/praat-users/

#77 From: Neil Coffey <Neil.Coffey@...>
Date: Thu Feb 22, 2001 2:21 pm
Subject: Scripting: some queries and suggestions
Neil.Coffey@...
Send Email Send Email
 
Dear Praat users,

I'd be interested to hear other users' feedback on the following
limitations I've come across in the process of putting together
scripts. In particular, whether (a) these are genuine restrictions
with current versions of Praat, rather than just oversights
on my part. And (b) whether others agree that they would be
good additions/improvements, and whether the authors of the
program might be gently persuaded to add these features ;-) ?

(1) Attempting to embed a comment in a form seems to produce
     an error.

(2) Forms appear to be the first thing to be executed regardless
     of where they are placed in the script; additionally/
     perhaps for the same reason, it is apparently not possible
     for the default value of a form element to be a variable
     or expression. In other words, you can't do something
     like:

       defaultTierNumber = (...work out tier number somehow...)
       form
         natural Tier_number 'defaultTierNumber'
         [...]
       endform

     Am I correct in noticing this restriction, and would it
     ultimately be possible to remove it?

(3) Am I correct that there seems to be no real contingency for
     forms which are heigher than the screen height (e.g. vertical
     scroll bars / split into two columns).

(4) There appears to be no switch construct (at least none seems
     to be mentioned in the help). This would be
     useful given the capability to have radio buttons in forms.
     For example, if one could do:

       switch Printing_option
         case 1
           [...]
         case 2
           [...]
         case 3
           [...]
         default
           echo Undefined printing option
       endswitch

(5) Variables cannot start with capital letters. This is a shame given
     that it's now common practice in programming for names of constants
     or global variables to be all capitals. The reason for this
     restriction is presumably that it differentiates menu options
     and form variables from ordinary variables. However, can anyone
     see a potential problem with allowing variable names to begin
     with an underscore character? For example, if one could do:

       _FONTSIZE     = 14

(6) As far as I can see there's no capacity for local variables
     in procedures, or for procedures to return values other than
     via a global variable. Is this correct?

(7) Every conditional construct has to have a matching 'end' statement
     on a separate line. This means, for example, that one can't do:

       if (debug) printline We are about to calculate F1

     but must instead do:

       if (debug)
         printline We are about to calculate F1
       endif

     Is there any way at all to have one-line conditionals, and
     if not, how would people generally feel about the possibility of
     extending the syntax to allow this? (The same thing could be
     extended to while constructs as well, though with one command
     per line this would be less useful.)

(8) There appear to be no unary equivalents of standard mathematical
     operators. In other words one can't do:

       pageNo++
       frequency *= 2

     but must instead do:

      pageNo += 1
      frequency = frequency * 2

     How would people feel about the former syntax?

I'd be interested to hear others' opinions on these matters -- I enjoy
using Praat, but feel that with a few improvements the scripting facility
could be that bit more powerful.

FWIW, I'm using build 3.9.x under Linux.

With thanks to the authors for a great program. All best wishes,

Neil

#78 From: Paul Boersma <paul.boersma@...>
Date: Thu Feb 22, 2001 7:54 pm
Subject: Re: Scripting: some queries and suggestions
paul.boersma@...
Send Email Send Email
 
>(1) Attempting to embed a comment in a form seems to produce
>    an error.

Apart from the "comment" statement, which shows a visible comment
in the form, things starting with # seem to be out, yes.
Should be changed.

>(2) Forms appear to be the first thing to be executed regardless
>    of where they are placed in the script;

forms ask for the "arguments" to a script, and allow the script to run
in batch and to be called by other scripts. The latter two requirements
are not compatible with the use of forms as interruptions of the script.

>(3) Am I correct that there seems to be no real contingency for
>    forms which are heigher than the screen height (e.g. vertical
>    scroll bars / split into two columns).

right. We should make the "list" option available, in case there are more
than 10 choices or so.

>(4) There appears to be no switch construct (at least none seems
>    to be mentioned in the help). This would be
>    useful given the capability to have radio buttons in forms.

Look for "choice" and button in section 6.1 of the scripting tutorial.
There are also examples on that page.

>(5) can anyone
>    see a potential problem with allowing variable names to begin
>    with an underscore character?

Why not. Good idea.

>(6) As far as I can see there's no capacity for local variables
>    in procedures, or for procedures to return values other than
>    via a global variable. Is this correct?

all variables are global, but you can return values to named variables.

procedure add x1 x2 result$
    let 'result$' = x1 + x2
endproc
call add 3 5 sum
echo 'sum'

In the current implementation, this requires the "let" statement,
which I should not like. We will have to reverse the order of variable
expansion and menu-command recognition.

>(7) Is there any way at all to have one-line conditionals

only in the sense of:

    clipped = if x > 100 then 100 else x fi
    fileName$ = if region$ = "Scotland" then "scot.wav" else
       ... if region$ = "England" then "engl.wav" else "amer.wav" fi fi

The problem with your proposal is that the interpreter could not
tell where commands stop and the script language takes over again, e.g.:

    if top then Text top... yes blibla else Text bottom... yes blabli endif

unless we introduce more special symbols and escapes into the scripting
language. Well, perhaps we could do only an if-then thing, without the
else-endif.

>(8) There appear to be no unary equivalents of standard mathematical
>    operators. In other words one can't do:
>
>      pageNo++
>      frequency *= 2

except that inc and dec seem to work, yes. These are useful extensions.

--

Paul Boersma
Institute of Phonetic Sciences, University of Amsterdam
Herengracht 338, 1016CG Amsterdam, The Netherlands
http://www.fon.hum.uva.nl/paul/

#79 From: firegold@...
Date: Fri Feb 23, 2001 8:06 am
Subject: Fast Fourier Transform-based Spectrum (slice)
firegold@...
Send Email Send Email
 
I'm a student in a Phonetics class, and we have to analyze some
sounds and compare the LPC Spectrum with the FFT Spectrum (as part of
the lab, that is).  Is there an easy way to do this in Praat?  The
LPC part is easy enough, but I don't see any way to get a Fourier
Spectrum (slice).  I may be missing something simple, but I am
relatively new to this program, as well as to Phonetics.

Anyway, I would greatly appreciate any help you can offer (especially
if you can do it between now and Saturday).

#80 From: Paul Boersma <paul.boersma@...>
Date: Fri Feb 23, 2001 11:52 am
Subject: Re: Fast Fourier Transform-based Spectrum (slice)
paul.boersma@...
Send Email Send Email
 
> but I don't see any way to get a Fourier Spectrum (slice).

Select a Sound and choose "To Spectrum".

#81 From: "Volker Dellwo" <dellwo@...>
Date: Fri Feb 23, 2001 1:24 pm
Subject: Praat under Windows ME
dellwo@...
Send Email Send Email
 
Dear Praat users,

I'm trying to run Praat on a new PC under Windows ME. There is one bug
occurring of which I don't know whether it is a problem related to Windows
ME - but I doubt it can be a hardwareproblem:

When recording a new sound with the SoundRecorder and clicking on the 'Stop'
button after let's say two seconds, the blue squares in the bar stop
appearing but nevertheless the recording goes on and there is always a file
with the duration of 45.something seconds created which contains the
recorded signal and an empty waveform after the stop button has been
pressed.

I've reinstalled the software various times but it always does the same
(also reinstalled the operating system).

Has anybody had this problem before???
Can anybody help???

Best wishes,
Volker Dellwo

#82 From: firegold@...
Date: Fri Feb 23, 2001 7:47 pm
Subject: Re: Fast Fourier Transform-based Spectrum (slice)
firegold@...
Send Email Send Email
 
--- In praat-users@y..., Paul Boersma <paul.boersma@h...> wrote:
> > but I don't see any way to get a Fourier Spectrum (slice).
>
> Select a Sound and choose "To Spectrum".

Forgive me for being dense, but doesn't that give you the spectrum of
the entire sound, not just a slice?  What I was meaning was I was
wondering if there were a way to compare the Spectrum (slice) of an
LPC with the Spectrum *(slice)* of just the FFT.

Why I want to do this is on the lab for my class, one of the
questions is "is there a difference between the LPC spectrum and the
Fourier spectrum?"  The program most of the class will be using can
generate a spectrum slice of both spectrums and display them
simultaneously, so you can notice that F1 in the FFT Spectrum is 561,
and F1 in the LPC is 570.  Or something like that.

I don't necessarily need to draw anything, just compare the numbers,
at the same point of time in the sound.

Anyway, thank you for your reply and help, and I hope you can help me
further with this.

#83 From: mietta.lennes@...
Date: Sat Feb 24, 2001 11:40 am
Subject: Re: Fast Fourier Transform-based Spectrum (slice)
mietta.lennes@...
Send Email Send Email
 
Hello!

--- In praat-users@y..., firegold@e... wrote:
> --- In praat-users@y..., Paul Boersma <paul.boersma@h...> wrote:
> > > but I don't see any way to get a Fourier Spectrum (slice).
> >
> > Select a Sound and choose "To Spectrum".
>
> Forgive me for being dense, but doesn't that give you the spectrum
of
> the entire sound, not just a slice?

Maybe you would like to extract a shorter segment that you want to
analyse from your original Sound? (Do this in the Sound editor.)

I have noticed that many people have the same problem (including me:
some students asked me about this and it took me quite a while to
figure out an answer!). They are used to other speech analysis
programs where a spectrum "slice" is a separate option. Would it be
possible to build an "ordinary" FFT spectrum analysis tool inside a
sound editor window? You could first place the cursor in the sound
waveform for a "slice" or select a longer stretch of sound for
a "long-time" spectrum, then choose the spectrum option from the
menu, then you would be prompted for, e.g., the analysis window shape
and size (to get wide-band and narrow-band spectrums) and maybe a
name for the spectrum, and the program would automatically select and
extract the correct portion of sound and create an FFT spectrum of
it...?

Mietta

#84 From: Paul Boersma <paul.boersma@...>
Date: Sat Feb 24, 2001 2:24 pm
Subject: Re: Fast Fourier Transform-based Spectrum (slice)
paul.boersma@...
Send Email Send Email
 
"firegold" wrote:

> What I was meaning was I was
> wondering if there were a way to compare the Spectrum (slice) of an
> LPC with the Spectrum *(slice)* of just the FFT.

yes. If you select an LPC object, you see the command "To Spectrum (slice)...".
Entirely analogously: if you select a Spectrogram object, you see
the command "To Spectrum (slice)..." as well...!

Mietta Lennes wrote:

> Would it be
> possible to build an "ordinary" FFT spectrum analysis tool inside a
> sound editor window? You could first place the cursor in the sound
> waveform for a "slice" or select a longer stretch of sound for
> a "long-time" spectrum, then choose the spectrum option from the
> menu, then you would be prompted for, e.g., the analysis window shape
> and size (to get wide-band and narrow-band spectrums) and maybe a
> name for the spectrum, and the program would automatically select and
> extract the correct portion of sound and create an FFT spectrum of
> it...?

These are two different things.

First the "long-time" spectrum. This does not need a separate window size
specification, since the window size is given by the length of the selection.
You create a spectrum from this by choosing "Extract windowed selection"
from the File menu in the Sound editor window, then doing "To Spectrum".

The real "slice" will be defined by the cursor position instead,
and requires a separate specification of a window size. It would be nice to have
this spectral slice in the sound editor window itself, and this rates rather
high on the Praat wish list (somewhere behind the pitch contour in the
Sound, LongSound, and TextGrid editors).
--

Paul Boersma
Institute of Phonetic Sciences, University of Amsterdam
Herengracht 338, 1016CG Amsterdam, The Netherlands
http://www.fon.hum.uva.nl/paul/

#85 From: "Richard Todd (Forensic Audio Unit)" <r.todd@...>
Date: Mon Feb 26, 2001 1:31 pm
Subject: plotting regression lines for partor whole of utterance
r.todd@...
Send Email Send Email
 
Hi

I'd like to know whether anyone has a way to do the above.

I'm inerested in measuring intensity and pitch of several utterances and
would like to take readings of n frames; n may be either the entire
utterance (file) duration or a shorter selection within it.

Am I left with no choice but to write the readings to file and process the
figures with another tool or is there a(nother) way to do the plotting with
praat only?

Any ideas or sample scripts would be appreciated.

Richard.

#86 From: "Gabriel J.L. Beckers" <beckers@...>
Date: Mon Feb 26, 2001 2:09 pm
Subject: resynthesizing pure-tone sounds
beckers@...
Send Email Send Email
 
Hello,
Does anybody know if it is possible to resynthesize pure-tone sounds (using
pitch and intensity information) in Praat?

I would like to reconstruct `clean' dove coo sounds from rather `noisy'
field recordings (noise also in the frequency band of interest). The dove
coos I have are pure-tone sounds, i.e. they only have a first harmonic. I
tried the using the PSOLA procedure, but since it is based on speech
production and uses pulses I get a lot of higher harmonics. Some doves
modulate their fundamental for more than one octave, so filtering these
higher harmonics out is not completely possible.

I realize the program is called Praat and not Coo, but so far I have used
it with great satisfaction and pleasure for bird sound analyses. It would
be great if I could use it for synthesis of `whistle'-sounds, which are
rather common in bird vocalizations.

All help is appreciated! Thanks,
Gabriel
--
Gabriel J.L. Beckers

Section Behavioural Biology
Institute of Evolutionary and Ecological Sciences
Leiden University

P.O.Box 9516
2300 RA Leiden
The Netherlands

http://wwwbio.leidenuniv.nl/~eew/G6/s5.html
Tel.: +31-71-5275015  |  Fax.: +31-71-5274900

#87 From: firegold@...
Date: Tue Feb 27, 2001 9:18 pm
Subject: FFT-LPC comparison again
firegold@...
Send Email Send Email
 
First of all, thank you for your help previously.  I hadn't even
noticed that you could do a spectrum slice from a spectrogram.

Now, since I have 30 sounds I need to analyze this way, I was trying
to write a little script that would automate it for me.  I came up
with something that I thought would work, but I can't figure out how
to get a cursor input in there.  I don't want to set a predetermined
cursor, as not all the sounds are the same length, etc.

Can someone take a look at what I've got and tell where I'm going
wrong?  And, if I have any other errors in this, let me know about
them too, please.

Thanks again.

name$ = selected$ ("Sound")
Edit
pause Select time index
curs = Get cursor
To Spectrogram... 0.005 10000 0.002 20 Gaussian
View
To Spectrum (slice)... curs
Rename... FFT_name$
select name$
To LPC (burg)... 16 0.025 0.005 50
select LPC name$
To Spectrum (slice)... curs 20 0 50
Rename... Linear_name$
select Spectrum FFT_name$
To Formant... 5
select Spectrum Linear_name$
To Formant... 5

Messages 58 - 87 of 6385   Oldest  |  < Older  |  Newer >  |  Newest
Add to My Yahoo!      XML What's This?
Messages 58 - 87 of 6385   Oldest  |  < Older  |  Newer >  |  Newest
Advanced
Add to My Yahoo!      XML What's This?

Copyright © 2010 Yahoo! UK. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help