#!/usr/bin/perl

# ------------------------------------------------------------------- FILES ---
$input_file = "/snd/Public_Sounds/jimiPopDN.aiff";
$input_chan = 0;                 # numbered from 1; 0: use all input chans
$begintime = 3.6;
$endtime = 4.55;                 # 0: end of file

# NOTE: pv analysis file, not a sound file!
$output_file = "/snd/myuserid/jimiPopDN.anal";

# ---------------------------------------------------------------- ANALYSIS ---
$FFT_length = 1024;
$frames_per_second = 200;

# ----------------------------------------------------------------- DISPLAY ---
$print_average_spectrum = 1;     # 0: no, 1: yes
$print_stats = 0;


#==============================================================================
# COMMAND LINE SETUP -- OFFICE USE ONLY

# Build argument string from vars defined above.
$pvflags = 
" -N$FFT_length" .
" -M0" .
" -w2" .
" -D$frames_per_second" .
" -b$begintime" .
" -e$endtime" .
" -C$input_chan" .
" -p$print_stats" .
" -P$print_average_spectrum";

# Build command line.
$cmd = "pvanalysis $pvflags $input_file $output_file";

# Print command line for reference.
print $cmd, "\n\n";

# Execute command.
`$cmd`;

