function  [paras, K1, K2, rv, sv, N, M, FULLT, FULLX] = cor_info(fname)
% COR_INFO information of cortical file .cor
%	cor_info(fname);
%	[paras, K1, K2, rv, sv, N, M, FULLT, FULLX] = cor_info(fname)
%	fname	: cortical file .cor.
%	
%	COR_INFO displays the information (header) of a cortical
%	file generated by AUD2COR.
%	See also: AUD2COR

% Auther: Powen Ru (powen@isr.umd.edu), NSL, UMD
% v1.00: 01-Jun-97
% v1.01: 19-Aug-97, included FULL (non-truncated)
% v1.02: 29-Sep-97, changed CAUSAL temporal filters

% read info 
fcor    = fopen(fname);
[paras, K1, K2, rv, sv, N, M, FULLT, FULLX] = corheadr(fcor);
L_head = ftell(fcor);
fseek(fcor, 0, 1);
L_file = ftell(fcor);
L_data = L_file - L_head;
fclose(fcor);

if nargout == 0,

%%%%%%%% display begin %%%%%%%%

% information to generate auditory spectrogram
if     paras(3) ==  0, str = 'hard limiter';
elseif paras(3) == -1, str = 'half-wave rectifier';
elseif paras(3) == -2, str = 'linear, no operation';
else,		       str = 'soft sigmoid function';
end;
disp(['FRAME / TC     : ', num2str(paras(1)) ' / ' num2str(paras(2)) ' ms']);
disp(['NONLINEAR FAC. : ', num2str(paras(3)) ' (' str ')']);
disp(['OCTAVE SHIFT   : ', num2str(paras(4)) ' octave']);

% file sizer
disp(['ACTUAL DIMENS. : ', num2str(N(1)) '-by-' num2str(M(1))]);
M(2) = M(1) + 2 * floor(M(1)/2*FULLX);
N(2) = N(1) + 2 * floor(N(1)/2*FULLT);
disp(['PANEL DIMENS.  : ', num2str(N(2)) '-by-' num2str(M(2))]);
	
[h_size, d_size] = corcplxr;
if L_data == (N(2)*M(2)*d_size*2+h_size)*K1*K2*2,
        str = 'COMPLETE';
else,
        str = 'BROKEN !';
end;
disp(['FILE SIZE      : ' num2str(round(L_file/1e4)/100) ' MB (' str ')']);

% rate vector
disp(['# OF RATE CH.  : ', num2str(K1)]);
str = []; rv = round(rv * 100)/100;
for rdx = 1:K1, str = [str ', ' num2str(rv(rdx))]; end; 
str(1:2) = '  '; disp(str);

% scale vector
disp(['# OF SCALE CH. : ', num2str(K2)]);
str = []; sv = round(sv * 100)/100;
for sdx = 1:K2, str = [str ', ' num2str(sv(sdx))]; end;
str(1:2) = '  '; disp(str);

%%%%%%%% display end %%%%%%%%

end;
