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

📄 m2_d1_di.m

📁 这是一个用于语音信号处理的工具箱
💻 M
字号:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%	m2_d1_display.m
%
%	jmw
%	7/25/94
%
%	Controls display window 
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

figure(m2_d1_h);
set(m2_d1_h,'Visible', 'on','resize', 'on');
clf;


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% find boundaries in Original Segment data

if (seg_cnt > 1)
   num_bnd = seg_cnt -1;
   seg_bnd = zeros(1,num_bnd);
   for i=1:num_bnd,
      seg_bnd(i) = seg_frame(i+1,1);
   end;
end;

disp_bnd = zeros(1,m);
for i=1:m,
   x=find(i==seg_bnd);
   nohit = isempty(x);
   if (~nohit)
      disp_bnd(i) = 2;
   end;
end;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% find boundaries in New Segment data

[tm,tn]=size(tmp_cofa);

if (tmp_seg_cnt > 1)
   tmp_num_bnd = tmp_seg_cnt -1;
   tmp_seg_bnd = zeros(1,tmp_num_bnd);
   for i=1:tmp_num_bnd,
      tmp_seg_bnd(i) = tmp_seg_frame(i+1,1);
   end;
end;

tmp_disp_bnd = zeros(1,tm);
for i=1:tm,
   x=find(i==tmp_seg_bnd);
   nohit = isempty(x);
   if (~nohit)
      tmp_disp_bnd(i) = 2;
   end;
end;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
for j=1:3,
   s=sprintf('subplot(31%1.0d)',j);
   eval(s);
   if (j==1)
      d1_code = d1a_code;
   elseif (j==2)
      d1_code = d1b_code;
   elseif (j==3)
		d1_code = d1c_code;
   end;

   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   
   if (d1_code == 1)
      plot(signal,'Color',LINE_COLOR);
      ax= axis;
      ax(2) = 1000 * ceil( (length(signal)) / 1000);
      axis(ax);
      hh = gca;
      set(hh,'XColor',TEXT_COLOR,'YColor',TEXT_COLOR);
      grid on;
      %xlabel('sample number');
      %ylabel('signal amplitude');
      s=sprintf('Original %s', name);
      title(s,'Color',TEXT_COLOR);
      % new stuff for inverse printing
   elseif (d1_code == 2)
      plot(tmp_signal,'Color',LINE_COLOR);
      ax= axis;
      ax(2) = 1000 * ceil( (length(tmp_signal)) / 1000);
      axis(ax);
      hh = gca;
      set(hh,'XColor',TEXT_COLOR,'YColor',TEXT_COLOR);
      grid on;
      %xlabel('sample number');
      %ylabel('signal amplitude');
      s=sprintf('Modified %s', name);
      title(s,'Color',TEXT_COLOR);
   elseif (d1_code == 3)
      stair_jw(range(:,1),disp_bnd,LINE_COLOR);
      axis([ax(1) ax(2) -5 8]);
      hh = gca;
      set(hh,'XColor',TEXT_COLOR,'YColor',TEXT_COLOR);
      grid off;
      title('Original Segment Type and Duration','Color',TEXT_COLOR);
      for i=1:seg_cnt,
         % add seg length label (text)
         dur = seg_range(i,2)-seg_range(i,1)+1;
         s=sprintf('%d', dur);
         if ( rem(i,3)==1)
            ht = 6.0;
         elseif ( rem(i,3)==2)
            ht = 4.5;
         else
            ht = 3.0;
         end;
         text(seg_range(i,1)+dur/2-150,ht,s,...
            'color',TEXT_COLOR);
         % add seg type label  for 1ST CHOICE (text)
         ht = -1;
         if (strcmp(choice_1(i,:),'   silent'))
            text(seg_range(i,1)+dur/2, ht , 'si',...
               'color',TEXT_COLOR);
         elseif (strcmp(choice_1(i,:),'    nasal'))
            text(seg_range(i,1)+dur/2, ht , 'N',...
               'color',TEXT_COLOR);
         elseif (strcmp(choice_1(i,:),'    vowel'))
            text(seg_range(i,1)+dur/2, ht , 'V',...
               'color',TEXT_COLOR);
         elseif (strcmp(choice_1(i,:),' unv stop'))
            text(seg_range(i,1)+dur/2-100, ht , 'US',...
               'color',TEXT_COLOR);
         elseif (strcmp(choice_1(i,:),' unv fric'))
            text(seg_range(i,1)+dur/2-100, ht , 'UF',...
               'color',TEXT_COLOR);
         elseif (strcmp(choice_1(i,:),' voicfric'))
            text(seg_range(i,1)+dur/2-100, ht , 'VF',...
               'color',TEXT_COLOR);
         elseif (strcmp(choice_1(i,:),' voicebar'))
            text(seg_range(i,1)+dur/2-100, ht , 'VB',...
               'color',TEXT_COLOR);
         elseif (strcmp(choice_1(i,:),'semivowel'))
            text(seg_range(i,1)+dur/2-100, ht , 'SV',...
               'color',TEXT_COLOR);
         end;
      end;
   elseif (d1_code == 4)
      stair_jw(tmp_range(:,1),tmp_disp_bnd,LINE_COLOR);
      axis([ax(1) ax(2) -5 8]);
      hh = gca;
      set(hh,'XColor',TEXT_COLOR,'YColor',TEXT_COLOR);
      grid off;
      title('Modified Segment Type and Duration','Color',TEXT_COLOR);
      for i=1:tmp_seg_cnt,
         % add seg length label (text)
         dur = tmp_seg_range(i,2)-tmp_seg_range(i,1)+1;
         s=sprintf('%d', dur);
         if ( rem(i,3)==1)
            ht = 6.0;
         elseif ( rem(i,3)==2)
            ht = 4.5;
         else
            ht = 3.0;
         end;
         text(tmp_seg_range(i,1)+dur/2-150,ht,s,'color',TEXT_COLOR);
         % add seg type label  for 1ST CHOICE (text)
         ht = -1;
         if (strcmp(tmp_choice_1(i,:),'   silent'))
            text(tmp_seg_range(i,1)+dur/2, ht , 'si',...
               'color',TEXT_COLOR);
         elseif (strcmp(tmp_choice_1(i,:),'    nasal'))
            text(tmp_seg_range(i,1)+dur/2, ht , 'N',...
               'color',TEXT_COLOR);
         elseif (strcmp(tmp_choice_1(i,:),'    vowel'))
            text(tmp_seg_range(i,1)+dur/2, ht , 'V',...
               'color',TEXT_COLOR);
         elseif (strcmp(tmp_choice_1(i,:),' unv stop'))
            text(tmp_seg_range(i,1)+dur/2-100, ht , 'US',...
               'color',TEXT_COLOR);
         elseif (strcmp(tmp_choice_1(i,:),' unv fric'))
            text(tmp_seg_range(i,1)+dur/2-100, ht , 'UF',...
               'color',TEXT_COLOR);
         elseif (strcmp(tmp_choice_1(i,:),' voicfric'))
            text(tmp_seg_range(i,1)+dur/2-100, ht , 'VF',...
               'color',TEXT_COLOR);
         elseif (strcmp(tmp_choice_1(i,:),' voicebar'))
            text(tmp_seg_range(i,1)+dur/2-100, ht , 'VB',...
               'color',TEXT_COLOR);
         elseif (strcmp(tmp_choice_1(i,:),'semivowel'))
            text(tmp_seg_range(i,1)+dur/2-100, ht , 'SV',...
               'color',TEXT_COLOR);
         end;
         
      end;
   elseif ( d1_code == 5)
      stair_jw(range(:,1),disp_bnd,LINE_COLOR);
      axis([ax(1) ax(2) -1 7]);
      hh = gca;
      set(hh,'XColor',TEXT_COLOR,'YColor',TEXT_COLOR);
      grid off;
      title('Original Segment Boundaries','Color',TEXT_COLOR);
      for i=1:num_bnd,
         s=sprintf('%d', range(seg_bnd(i),1));
         if ( rem(i,3)==1)
            ht = 6.0;
         elseif ( rem(i,3)==2)
            ht = 4.5;
         else
            ht = 3.0;
         end;
         text(range(seg_bnd(i),1)-180,ht,s,'Color',TEXT_COLOR);
      end;
   elseif ( d1_code == 6)
      stair_jw(tmp_range(:,1),tmp_disp_bnd,LINE_COLOR);
      axis([ax(1) ax(2) -1 7]);
      hh = gca;
      set(hh,'XColor',TEXT_COLOR,'YColor',TEXT_COLOR);
      grid off;
      title('Modified Segment Boundaries','Color',TEXT_COLOR);
      for i=1:tmp_num_bnd,
         s=sprintf('%d', tmp_range(tmp_seg_bnd(i),1));
         if ( rem(i,3)==1)
            ht = 6.0;
         elseif ( rem(i,3)==2)
            ht = 4.5;
         else
            ht = 3.0;
         end;
         text(tmp_range(tmp_seg_bnd(i),1)-180,ht,s,'Color',TEXT_COLOR);
      end;
   end;
   
   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   
   subplot(311)
   axis(ax);
   
   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   
end;	% end for j=1:3

⌨️ 快捷键说明

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