维纳滤波法matlab代码,维纳滤波可直接执行matlab代码

function output=WienerScalart96(signal,fs,IS)

% output=WIENERSCALART96(signal,fs,IS)

% Wiener filter based on tracking a priori SNR usingDecision-Directed

% method, proposed by Scalart et al 96. In this method it is assumed that

% SNRpost=SNRprior +1. based on this the Wiener Filter can be adapted to a

% model like Ephraims model in which we have a gain function which is a

% function of a priori SNR and a priori SNR is being tracked using Decision

% Directed method.

% Author: Esfandiar Zavarehei

% Created: MAR-05

if (nargin<3 | isstruct(IS))

IS=.25; %Initial Silence or Noise Only part in seconds

end

W=fix(.025*fs); %Window length is 25 ms

SP=.4; %Shift percentage is 40% (10ms) %Overlap-Add method works good with this value(.4) wnd=hamming(W);

%IGNORE FROM HERE ...............................

if (nargin>=3 & isstruct(IS))%This option is for compatibility with another programme W=IS.windowsize

SP=IS.shiftsize/W;

%nfft=IS.nfft;

wnd=IS.window;

if isfield(IS,'IS')

IS=IS.IS;

else

IS=.25;

end

end

% ......................................UP TO HERE

pre_emph=0;

signal=filter([1 -pre_emph],1,signal);

NIS=fix((IS*fs-W)/(SP*W) +1);%number of initial silence segments

y=segment(signal,W,SP,wnd); % This function chops the signal into frames

Y=fft(y);

YPhase=angle(Y(1:fix(end/2)+1,:)); %Noisy Speech Phase

Y=abs(Y(1:fix(end/2)+1,:));%Specrogram

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值