使用小波变换的自动语音识别项目编码所需的帮助 [英] help needed for coding for project AUTOMATIC SPEECH RECOGNITION USING WAVELET TRANSFORM

查看:64
本文介绍了使用小波变换的自动语音识别项目编码所需的帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<br />
<pre lang="cs">%This program records the voice<br />
function [norm_voice,h] = Voice_Rec(sample_freq)<br />
option = ''n'';<br />
option_rec = ''n'';<br />
record_len = 1;         %Record time length in seconds<br />
sample_freq = 8192;    %Sampling frequency in Hertz<br />
sample_time = sample_freq * record_len;<br />
<br />
''Get ready to record your voice''<br />
name = input(''Enter the file name you want to save the file with: '',''s'');<br />
file_name = sprintf(''%s.wav'',name);<br />
option_rec = input(''Press y to record: '',''s'');<br />
if option_rec==''y''<br />
    while option==''n'',<br />
        input(''Press enter when ready to record--> '');<br />
        record = wavrecord(sample_time, sample_freq);       %Records the input through the sound card to the variable with specified sampling frequency<br />
        input(''Press enter to listen the recorded voice--> '');<br />
        sound(record, sample_freq);<br />
        option = input(''Press y to save or n to record again: '',''s'');<br />
    end<br />
    wavwrite(record, sample_freq, file_name);  %Save the recorded data to a file with the specified file name in .wav format<br />
end<br />
[voice_read,Fs,NBITS]=wavread(file_name);<br />
norm_voice = normalize(voice_read);<br />
norm_voice = downsmpl(norm_voice, sample_freq);<br />
le=320;<br />
%s = leleccum(1:3920);<br />
[c,l] = wavedec(le,3,''db4'');<br />
[ca4, cd4]=dwt(norm_voice,''db4'');<br />
[cd1,cd2,cd3] = detcoef(c,l,[1 2 3]);<br />
%subplot(1,1,1); plot(ca4);title (''Approx.coef.for db4'');<br />
%subplot(112); plot(cd4); title(''Detail coef. for db4'');<br />
subplot(1,1,1); plot(cd3); title(''Detail coef. for db4'');<br />
%subplot(114); plot(ca3);title (''Approx.coef.for db4'');<br />
subplot(1,1,1); plot(cd2); title(''Detail coef. for db4'');<br />
%subplot(116); plot(ca2); title (''Approx.coef.for db4'');<br />
subplot(1,1,1); plot(cd1); title(''Detail coef. for db4'');<br />
%subplot(118); plot(ca1);title (''Approx.coef.for db4'');<br />
plot(norm_voice);<br />
<br />
function vec = normalize(vec)<br />
<br />
temp_vec = vec-mean(vec);<br />
sum_temp_vec = sum(temp_vec.*temp_vec);<br />
sqrt_temp_vec = sqrt(sum_temp_vec);<br />
vec = (1/sqrt_temp_vec)*temp_vec;<br />
<br />
function sampled = downsmpl(voice, freq)<br />
<br />
x=freq;<br />
y = freq/2;<br />
z=1;<br />
a=1;<br />
sampled=0;<br />
while z<freq,<br />
    sampled(a) = sqrt(abs(voice(z)*voice(z+1)));<br />
    a=a+1;<br />
    z = z+2;<br />
end<br />
sampled = sampled'';</pre><br />



PLZ如果有人知道逻辑和代码,可以帮助我,我将非常感谢...它的当务之急..

使用此代码后,我们必须应用DAUBECHIES小波转换



PLZ IF ANY ONE KNOWS THE LOGIC AND THE CODE AND CAN HELP ME I WOULD BE REALLY THANKFUL...ITS REALLY URGENT..

AFTER THIS CODE WE HAVE TO APPLY DAUBECHIES WAVELET TRANSFORM

推荐答案

您甚至没有考虑过使用google吗?

[
Did you even once consider using google?

Over 53,000 results for "DAUBECHIES WAVELET TRANSFORM matlab"[^]


这篇关于使用小波变换的自动语音识别项目编码所需的帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆