wav2ftr2.m
资源名称:speech.rar [点击查看]
上传用户:ay_070428
上传日期:2014-12-04
资源大小:11427k
文件大小:1k
源码类别:
语音合成与识别
开发平台:
Matlab
- function parameter= test1(Inwav)
- %This file for dll test.
- setparam;
- if isstr(Inwav),
- [Inwav,Fs,NBits] = wavread(Inwav);
- end
- % ====== Step 1: pre-emphasis.
- Inwav = filtermex([1, -0.95], Inwav);
- %Inwav = pre_emphasis(Inwav);
- % ====== Step 2: frame blocking.
- %Frame = enframe(Inwav, frameSize, overlap);
- Frame = buffermex(Inwav, frameSize, overlap);
- frameCount = size(Frame, 2);
- % ====== Step 3: edge detection.
- energy = sum(Frame.^2)/frameSize;
- index = find(energy < threshold);
- Frame(:, index) = [];
- energy(index) = [];
- % ====== Compute log_energy for parameter.
- normalize_coff = 10;
- log_eng = 10*log10(energy)/normalize_coff;
- % ====== Step 5: hamming window.
- Wframe = hamm_win(Frame);
- % ====== Step 6: fast fourier transform and compute its abs.
- fft_frame = dfft2abs(Wframe);
- % ====== Step 7: triangular bandpass filter.
- TBF_coef = bandfilt(fft_frame);
- % Step 8: cosine transform.
- Cepstrum = mel_cepstrum(TBF_coef);
- parameter = [Cepstrum ;log_eng];
- %parameter = ceps_logeng(Cepstrum, log_eng, frameCount);
- % ====== Step 9: delta function.
- parameter = deltafcn(parameter);