next up previous contents
Next: Signal format Up: Automatic Validation of Data Previous: File Names   Contents


$\bigcirc$ Readability, Empty Files

Are any of the found files empty (zero byte length)? Are they readable?

Add something like the following to the previous piece of code at the comment Other checks on the signal/annotation file:

...
  if ( -z $file ) then 
    echo "ERROR: file $file is empty"
  endif
  cat $file > /dev/null
  if ( $status != 0 ) then 
    echo "ERROR: file $file is not readable"
  endif
...
Instead of emptiness you may also check for a defined minimum length in signal or annotation files. For instance, if you know that each signal should be at least 1 sec long, the minimum byte length of a WAV type sound file with 16kHz sampling rate, 16 bit, mono would be: $44 + 16000 * 2 = 32044$ (headerlength is 44):
...
  set length = `cat $file | wc -c`
  if ( $length < 32044 ) then 
    echo "Warning: signal file $file is less than 1 sec long"
  endif
...


Angela Baumann 2004-06-03