2011-10-06 193 views
1

源文件名爲「ReadOutputFile.m」。這是什麼語言?

function ReadOutputFile(inputFile, outputFile) 

SPIT = 2; 
R_REGULARITY = 8; 

%read input, threshold, and level 
spitclip = wavread(inputFile); 
spitclip = spitclip*(2^15); 

fid = fopen('threshBinary.bin', 'rb', 'native'); 
thresh = fread(fid, 'int16'); 
fclose(fid); 

fid = fopen('signalLevelBinary.bin', 'rb', 'native'); 
lvl = fread(fid, 'int16'); 
fclose(fid); 


%get start and stop information from output file 
outputNumeric = csvread(outputFile); 

starts = outputNumeric(:,1); 
stops = outputNumeric(:,2); 
types = outputNumeric(:,8); 
reasons = outputNumeric(:,9); 
regularity = outputNumeric(:,7); 

indicesOfSpits = find(types==SPIT); 

numEvents = length(starts); 

eventGate = zeros(1,length(spitclip)); 
firstSpits = zeros(1,length(spitclip)); 
chainedSpits = zeros(1,length(spitclip)); 

maxVal = 800; 

%loop through events and plot spits only 
%color code by reason 
for n = 1:length(indicesOfSpits) 
    i = indicesOfSpits(n); 

    if(reasons(i) == R_REGULARITY) 
     chainedSpits(starts(i):stops(i)) = regularity(i)*800; 
    else 
     firstSpits(starts(i):stops(i)) = maxVal; 
    end 
end 

plot(spitclip); 
hold on; 
grid on; 
plot(lvl,'r'); 
plot(thresh, 'y'); 
plot(firstSpits, 'm'); 
plot(chainedSpits, 'k'); 
+0

它看起來有點像聲音解析器 –

回答

3

這看起來像Matlab(或相當於免費八度)

0

http://en.wikipedia.org/wiki/M_(programming_language)

你會疑惑,這是多麼容易找到的編程語言。 只需知道後綴。

+0

那麼,你發現了什麼?沒有用處。 –

+0

問題是「這是什麼語言?」答案是「M」。 這不是很明顯嗎? –

+0

除非它不是M.它相當清晰的Matlab或類似的東西。 –