DSP

kaldi直接使用FFT频谱

2019-07-13 17:58发布

#!/bin/bash if [ -f path.sh ]; then . ./path.sh; fi . parse_options.sh || exit 1; cmd=run.pl nj=10 logdir=make_fft name=test scp=data/test/wav.scp fftdir=fft mkdir -p fft mkdir -p make_fft for n in $(seq $nj); do # the next command does nothing unless $mfccdir/storage/ exists, see # utils/create_data_link.pl for more info. utils/create_data_link.pl $fftdir/raw_fft_$name.$n.ark done split_scps="" for n in $(seq $nj); do split_scps="$split_scps $logdir/wav_${name}.$n.scp" done utils/split_scp.pl $scp $split_scps || exit 1; # add ,p to the input rspecifier so that we can just skip over # utterances that have bad wave data. compress=true $cmd JOB=1:$nj $logdir/make_fft_${name}.JOB.log compute-spectrogram-feats scp,p:$logdir/wav_${name}.JOB.scp ark:- | copy-feats --compress=$compress ark:- ark,scp:$fftdir/raw_fft_$name.JOB.ark,$fftdir/raw_fft_$name.JOB.scp || exit 1;