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

📄 note2mid0.html

📁 自动语音识别源码对非特定人的孤立词语音识别算法 进行研究。考虑到语音识别技术在嵌入式系统处理能力较弱、存储空间有限的问 题上进行算法的选择和优化
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"                "http://www.w3.org/TR/REC-html40/loose.dtd"><html><head>  <title>Description of note2mid0</title>  <meta name="keywords" content="note2mid0">  <meta name="description" content="note2mid: Note to mid conversion">  <meta http-equiv="Content-Type" content="text/html; charset=big5">  <meta name="generator" content="m2html &copy; 2003 Guillaume Flandin">  <meta name="robots" content="index, follow">  <link type="text/css" rel="stylesheet" href="../m2html.css"></head><body><a name="_top"></a><div><a href="../index.html">Home</a> &gt;  <a href="index.html">melodyRecognition</a> &gt; note2mid0.m</div><!--<table width="100%"><tr><td align="left"><a href="../index.html"><img alt="<" border="0" src="../left.png">&nbsp;Master index</a></td><td align="right"><a href="index.html">Index for melodyRecognition&nbsp;<img alt=">" border="0" src="../right.png"></a></td></tr></table>--><h1>note2mid0</h1><h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2><div class="box"><strong>note2mid: Note to mid conversion</strong></div><h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2><div class="box"><strong>function [mid, noteStartPos] = note2mid(midi, resampleRate, plotOpt) </strong></div><h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2><div class="fragment"><pre class="comment"> note2mid: Note to mid conversion
    Usage:
    [mid, noteStartPos] = note2mid(midi, resampleRate, plotOpt)
        midi: semitone and duration sequence, where the duration is based on 1/64 second
        resampleRate: usually 4
        mid: Pitch vector where each point represents a pitch of 1/16 second
        noteStartPos: A vector of the same size as mid, with 1 denotes the start position of a note</pre></div><!-- crossreference --><h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>This function calls:<ul style="list-style-image:url(../matlabicon.gif)"></ul>This function is called by:<ul style="list-style-image:url(../matlabicon.gif)"></ul><!-- crossreference --><h2><a name="_subfunctions"></a>SUBFUNCTIONS <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2><ul style="list-style-image:url(../matlabicon.gif)"><li><a href="#_sub1" class="code">function selfdemo</a></li></ul><h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2><div class="fragment"><pre>0001 <a name="_sub0" href="#_subfunctions" class="code">function [mid, noteStartPos] = note2mid(midi, resampleRate, plotOpt)</a>0002 <span class="comment">% note2mid: Note to mid conversion</span>0003 <span class="comment">%    Usage:</span>0004 <span class="comment">%    [mid, noteStartPos] = note2mid(midi, resampleRate, plotOpt)</span>0005 <span class="comment">%        midi: semitone and duration sequence, where the duration is based on 1/64 second</span>0006 <span class="comment">%        resampleRate: usually 4</span>0007 <span class="comment">%        mid: Pitch vector where each point represents a pitch of 1/16 second</span>0008 <span class="comment">%        noteStartPos: A vector of the same size as mid, with 1 denotes the start position of a note</span>0009 0010 <span class="comment">%    Roger Jang, 20030501</span>0011 0012 <span class="keyword">if</span> nargin==0, <a href="#_sub1" class="code" title="subfunction selfdemo">selfdemo</a>; <span class="keyword">return</span>; <span class="keyword">end</span>0013 <span class="keyword">if</span> nargin&lt;2, resampleRate=4; <span class="keyword">end</span>0014 <span class="keyword">if</span> nargin&lt;3, plotOpt=0; <span class="keyword">end</span>0015 0016 [mid, noteStartPos] = note2mid2mex(midi, resampleRate);0017 0018 <span class="keyword">if</span> plotOpt0019     subplot(2,1,1);0020     plotmidi(midi, 1/64);0021     subplot(2,1,2);0022     time=(1:length(mid))/16;0023     line(time, mid, <span class="string">'marker'</span>, <span class="string">'.'</span>, <span class="string">'linestyle'</span>, <span class="string">'none'</span>);0024     index=find(noteStartPos);0025     line(time(index), mid(index), <span class="string">'marker'</span>, <span class="string">'o'</span>, <span class="string">'color'</span>, <span class="string">'r'</span>, <span class="string">'linestyle'</span>, <span class="string">'none'</span>);0026     axis tight; box on; grid on;0027     xlabel(<span class="string">'Time (seconds)'</span>);0028     ylabel(<span class="string">'Semitones'</span>);0029     title(<span class="string">'Output of note2mid()'</span>);0030 <span class="keyword">end</span>0031 0032 <span class="comment">% ====== Self demo</span>0033 <a name="_sub1" href="#_subfunctions" class="code">function selfdemo</a>0034 smtn = [-1 -4 -4 -3 -6 -6 -8 -6 -4 -3 -1 -1 -1]+69;    <span class="comment">% Semitones for ?p?e??</span>0035 beat = [1   1  2  1  1  2  1  1  1  1  1  1  2]*0.5*64;    <span class="comment">% ?H 1/64 ???

⌨️ 快捷键说明

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