Java中的谱减法 - 使用JMathLib

时间:2012-04-28 21:07:22

标签: java android signal-processing subtraction spectral

我是Android和DSP的新手。我正在实施光谱减法算法 感谢

我的目标是在电话呼叫流缓冲区上使用此算法

我正在尝试如何使用我正在使用的光谱减法的Matlab实现来实现此代码。

Matalb代码:

function Seg=segment(signal,W,SP,Window)

% SEGMENT chops a signal to overlapping windowed segments
% A= SEGMENT(X,W,SP,WIN) returns a matrix which its columns are segmented
% and windowed frames of the input one dimentional signal, X. W is the
% number of samples per window, default value W=256. SP is the shift
% percentage, default value SP=0.4. WIN is the window that is multiplied by
% each segment and its length should be W. the default window is hamming
% window.
% 06-Sep-04
% Esfandiar Zavarehei

if nargin<3
    SP=.4;
end
if nargin<2
    W=256;
end
if nargin<4
    Window=hamming(W);
end
Window=Window(:); %make it a column vector

L=length(signal);
SP=fix(W.*SP);
N=fix((L-W)/SP +1); %number of segments

Index=(repmat(1:W,N,1)+repmat((0:(N-1))'*SP,1,W))';
hw=repmat(Window,1,N);
Seg=signal(Index).*hw;

我的问题是我应该使用JMathLib来实现像“repmat”这样的函数,它是一个矩阵复制函数,或者我应该以另一种方式实现它。记得我在基于Android的智能手机上运行。 谢谢吉拉德

0 个答案:

没有答案