feature_calc_script.m 664 B

12345678910111213141516171819202122
  1. % feature_calc_script
  2. tmp=dir;
  3. nfiles=length(tmp);
  4. names=cell(nfiles,1); for j=1:nfiles, names(j)=cellstr(tmp(j).name); end;
  5. wavnames=regexp(names,'.*wav$','match');
  6. ind=~cellfun('isempty',wavnames);
  7. wavnames=wavnames(ind);
  8. segnames=regexp(names,'.*wav.seg.txt$','match');
  9. ind=~cellfun('isempty',segnames);
  10. segnames=segnames(ind);
  11. nwaves=length(wavnames);
  12. movingwin=[0.01 0.005];
  13. params.tapers=[2 3]; params.pad=1; params.Fs=44100; params.fpass=[5000 20000];
  14. for i=1:nwaves,
  15. data=wavread(wavnames{i}{1});
  16. [Feat S t f]= acoustic_features_MB(data,movingwin,params);
  17. sname=[wavnames{i}{1} '.sp'];
  18. save(char(sname),'S','t','f','Feat','-mat');
  19. end