This code is distributed mainly to demonstrate how SNR is computed for speech (or audio) signals. The installation procedure described here is not 100% reliable, but should work across most environments with some simple changes. Let's assume we want to install the code in a directory named /u0/smith/, and you have downloaded the tar file into $HOME/snr.tar.gz. To build this code, you will need access to GNU make. On some systems, this is installed as "make". On other systems, it is installed as "gmake". "make --version" is an easy way to tell which version it is. In the instructions below, we will use the command "gmake" to emphasize the importance of using GNU's version of make. To install this code, do the following: isip22_[1]: mkdir /u0/smith/ isip22_[1]: cd /u0/smith/ isip22_[1]: mv $HOME/snr.tar.gz . isip22_[1]: gunzip snr.tar.gz isip22_[1]: tar xvf snr.tar isip22_[1]: cd snr isip22_[1]: export ISIP_SNR=`pwd` isip22_[1]: echo $ISIP_SNR isip22_[1]: export ISIP_CPLUS_COMPILER="g++" isip22_[1]: echo $ISIP_CPLUS_COMPILER isip22_[1]: cd class/signal/v1.0/ isip22_[1]: gmake install isip22_[1]: cd ../../.. isip22_[1]: cd util/snr_calculator/current/ isip22_[1]: gmake Following steps can be used to test the code. Because of different byte-orderings on different machines, we need to be careful about byte-swapping the data. If you are working on a Sparc, do the following: isip22_[1]: cd ../../test isip22_[1]: ./test_sparc.sh If you are on a x86 machine, do the following: isip22_[1]: cd ../../test isip22_[1]: ./test_x86.sh You should get the following output: File: ./710_b_8k_sparc.raw snr for channel 0: 16.034065 dB File: ./710_s_8k_sparc.raw snr for channel 0: 33.657867 dB File: ./711_g_8k_sparc.raw snr for channel 0: 7.642164 dB File: ./712_f_8k_sparc.raw snr for channel 0: 12.993533 dB (For x86 machines, "_sparc" will be replaced by "_x86".) Additional information about the utility can be found in its help message: isip22_[1]: ./snr_calculator -help name: snr_calculator synopsis: snr_calculator [options] descr: produces the overall signal to noise ratio of the speech signal example: snr_calculator -num_chans 2 -sf 8000 -sig_thresh .80 -noise_thresh 0.1 -frame_dur 10 -window_dur 20 -input input_file.raw arguments: input_file.raw: 16-bit linear input file options: -num_chans: number of channels in the audio file (default: 1) -sf: sample frequency of the data (default: 8000) -swap_bytes: flag indicating whether the byte ordering should be swapped -sig_thresh: percent of energy considered as signal+noise (default: 0.85) -noise_thresh: percent of energy considered as noise (default: 0.15) -frame_dur: frame duration to use in computing the short duration snr (default: 10 msec) -window_dur: window duration to use in computing the short duration snr (default: 20 msec) -use_hamming: flag indicating whether or not to use a hamming window -use_pre_emph: flag indicating whether or not to pre-emphasize the data -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Requests for support can be directed at help@isip.msstate.edu