⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tutorial.html

📁 用于语音识别语音增强方面的matlab工具包
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html><head>  <title>Matsig Tutorial</title>  <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">  <meta name="GENERATOR" content="Quanta Plus"></head><body><h1>Matsig Tutorial</h1><h2>Preface</h2><p>This tutorial introduces the most fundamental features of Matsig. It does nottry to be a comprehensive documentation, which, unfortunately, does not exist atthe moment. If a full understanding of the operation of the classes is required,getting acquainted with the source code is required.</p><p>This tutorial is intended to be read interactively, so that the examples are triedout along the way.</p><h2>Introduction</h2><p>Matsig is an object-oriented signal processing class library for MATLAB, intended tosimplify operations common in audio signal processing and speech processing. It is designedto be as transparent in use as reasonably possible, so that the syntax (with some notableexceptions) remains more or less identical to the regular MATLAB vector handling syntax.</p><p>While the documentation of Matsig is still spotty, to say the least, many functionsalready have inline documentation. This documentation may be invoked using the<kbd>help</kbd> command by explicitly spelling the class name:</p><pre>&gt;&gt; help signal/cat  CAT  Concatenate vectors and signal objects     Y=CAT(...) concatenates all arguments into a one signal. The     arguments may be either signal objects or regular vectors.</pre><h2>Basic operations</h2><p>Signal objects may be created using the <kbd>signal</kbd> function:</p><pre>&gt;&gt; r=rand(22050,1);&gt;&gt; s1=signal(r,22050)s1 =   signal object:      length: 22050      duration: 1.000000 s      sampling frequency: 22050 Hz      beginning time: 0.000000 s      validity: all</pre><p>Existing audio files may be opened using the <kbd>openwav</kbd> command:</p><pre>s2=openwav('kaksi.wav')s2 =   signal object:      length: 17733      duration: 0.804218 s      sampling frequency: 22050 Hz      beginning time: 0.000000 s      validity: all&gt;&gt; soundsc(s2);</pre><p>Signals may be plotted using the regular <kbd>plot</kbd> command:</p><pre>&gt;&gt; plot(s2)</pre><img src="plot1.png" alt="a sample image"/><p>Concatenation works using the <kbd>cat</kbd> command. Segments of the signal can beextracted using the <kbd>trim</kbd> command or by index subscripting:</p><pre>&gt;&gt; cat(s,s2)ans =   signal object:      length: 39783      duration: 1.804218 s      sampling frequency: 22050 Hz      beginning time: 0.000000 s      validity: all&gt;&gt; s2a=trim(s2,0.1,0.2);&gt;&gt; s2i=s2(13000:15000);&gt;&gt; plot(s2,s2a,s2i);</pre><img src="plot2.png" alt="a sample image"/><p>Basic MATLAB operations are defined for the objects:</p><pre>&gt;&gt; s1_1=2.*(s1-0.5);</pre><p>Whenever necessary, the underlying vector data can also be directly accessed:</p><pre>&gt;&gt; s1.s(1:5)ans =    0.9323    0.0767    0.6423    0.4876    0.4470&gt;&gt; s1.t(1:5)ans =   1.0e-03 *         0    0.0454    0.0907    0.1361    0.1814</pre><p>Time-based indexing may also be used, with the help of <kbd>at</kbd> function:</p><pre>&gt;&gt; s2s = s2(at(s2,0.4):at(s2,0.4)+1023);</pre><p>Several auxiliary functions have also been defined:</p><pre>&gt;&gt; len(s2a) % length, in samples&gt;&gt; maxtime(s2a) % time index of the last sample&gt;&gt; scale(s2a,-1,1) % scale the signal between the given values&gt;&gt; taper(s2a,0.01) % taper the ends of the signal using half-hanning windows&gt;&gt; win(s2s,'hamming') % window the signal using given window function</pre><h2>Filtering</h2><p>Due to the importance of filtering tasks in audio signal processing,some supporting facilities have been included in Matsig. These may be the mostimportant features of Matsig. First, non-causalfiltering has been implemented. See the difference:</p><pre>&gt;&gt; s3=signal(repmat([ones(1,40) zeros(1,40)],1,20),8000);&gt;&gt; b=fir1(200,400/(s3.fs/2));&gt;&gt; s3f=filter(b,1,s3);&gt;&gt; plot(s3,s3f);</pre><img src="plot3.png" alt="a sample image"/><pre>&gt;&gt; s3f_nc=filter(b,1,s3,'noncausal');&gt;&gt; plot(s3,s3f_nc);</pre><img src="plot4.png" alt="a sample image"/><p>The annoying non-stationary regions at the beginning of the filteredsignal can easily be trimmed out:</p><pre>&gt;&gt; s3v=valid(s3f_nc);&gt;&gt; plot(s3,s3v);</pre><img src="plot5.png" alt="a sample image"/><h2>Frequency-domain operations</h2><p>Basic frequency-domain operations have been defined, with a syntax analogous tothe time-domain operations:</p><pre>&gt;&gt; S3v=fft(s3v);&gt;&gt; plot(db(half1(S3v)));</pre><img src="plot6.png" alt="a sample image"/><h2>Miscellaneous</h2><p>In addition to the elementary operations, some more specialized functions havebeen implemented:</p><pre>&gt;&gt; find_f0(s2a) % find the fundamental frequencyans =  110.8028s2aw=win(s2a,'hanning');a_d=dap(s2aw,24); % calculate the discrete all-pole model of the signal</pre><hr /><p><small>$Id: Tutorial.html 3 2004-02-04 12:57:04Z mairas $</small></p></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -