otospe.m

来自「A MATLAB tool for analysis of Transient 」· M 代码 · 共 31 行

M
31
字号
function [Sr, Sn, Ss, f] = otospe(r, s, fs)

%	[Sr, Sn, Ss, f] = otospe(r, s, fs)
%
%	otospe	calculates the spectra of cochlear responses Sr, averaging
%		noise Sn and stimulus Ss.
%
%   in:	r	cochlear responses [r1 r2]
%	s	stimulus
%	fs	sampling frequency (defult 25000)
%
%  out:	Sr	response spectrum
%	Sn	noise spectrum
%	Ss	stimulus spectrum
%	f	corresponding frequency range
%
% note:	otospe tries to emulate the ILO-program!

% (c) Heimo Ihalainen, Esa Ojala, Harri Nystedt 23.8.1990

if nargin<3; fs = 25000; end

[Rs1,f] = frz(r(:,1)); Rs2 = frz(r(:,2)); S = frz(s,1,257); f = f*fs;

Sr = 2*real(Rs1.*conj(Rs2))/(20e-6*512)^2;
%Sr = 2*abs((Rs1+Rs2)/2/20e-6/512).^2;

Sn = 2*abs((Rs1-Rs2)/sqrt(2)/20e-6/512).^2;

Ss = 2*abs(S/20e-6/512).^2;

⌨️ 快捷键说明

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