ldsp.m

来自「这是一个用于语音信号处理的工具箱」· M 代码 · 共 44 行

M
44
字号
% Function : load the target speech file.


cwd=pwd;
p2=cd;
[in_file pathname]=uigetfile([ p2 '\spedata\*.dat'],'Load input file');

if in_file~=0

  clear speech;

  eval(['load ' pathname in_file]);
  eval(['cd ' cwd]);

  in_file=in_file(1:length(in_file)-4);
  %???? Conflit with win95
  %in_file=lower(in_file);
  
  eval( ['speech=' in_file ';']);

  eval(['clear ' in_file]);

  set(a_pb_sp,'String',['load speech file:  ' in_file])
  set(ana_file_edit,'String',[in_file '.mat']);
  clear cwd speech1;

  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  % normalize the speech signal %
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  speech=speech(:).';
 
  % Set the maximum magnitude as 10000 ==> a simple way of normalization.
  speech=10000/max(abs(speech))*speech; 

  % open window & plot data
  set(s_win_f,'Visible','on');
  figure(s_win_f)
  plot(speech,'color',LINE_COLOR);
  title(['speech signal :' in_file]);
else

  disp('Error loading speech file!! please check it again!');
end

⌨️ 快捷键说明

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