开发者

MATLAB - Trouble of converting training data to spectrogram

开发者 https://www.devze.com 2023-04-05 18:03 出处:网络
I am a student and new to signal processing just few months ago. I picked\"A Novel Fuzzy Approach to Speech Recognition\" for my project (you can google for the downloadable version).

I am a student and new to signal processing just few months ago. I picked "A Novel Fuzzy Approach to Speech Recognition" for my project (you can google for the downloadable version).

I am a little stuck in converting the training data into a spectrogram which has been passed through a mel-filter.

I use this for my mel-filterbank, with a little modification of course.

Then I wrote this simple code to make the spectrogram of my training data:

p   =25;
fl  =0.0;
fh  =0.5;
w   ='hty';
[a,fs]=wavread('a.wav'); %you can simply record a sound and name it a.wav, other param will follows
n=length(a)+1;
fa=rfft(a);
xa=melbank_me(p,n,fs); %the mel-filterbank function
za=log(xa*abs(fa).^2);
ca=dct(za);
spectrogram(ca(:,1))

All I got is ju开发者_JAVA技巧st like this which is not like the paper say::

MATLAB - Trouble of converting training data to spectrogram

Please let me know that either my code or the spectrogram I have was right. if so, what do I have to do to make my spectrogram like the paper's? and if didn't, please tell me where's the wrong

And another question, is it ok to having the lenght of FFT that much? Because when I try to lower it, my code gives errors.


You shouldn't be doing an FFT of the entire file - that will include too much time-varing information - you should pick a window size in which the sound is relatively stationary, e.g. 10 ms @ 44.1 kHz = 441 samples, so perhaps N = 512 might be a good starting point. You can then generate your spectrogram over successive windows if needed, in order to display the time-varying frequency content.

0

精彩评论

暂无评论...
验证码 换一张
取 消