当前位置:网站首页>[short-time amplitude spectrum] matlab simulation of short-time amplitude spectrum estimation in speech enhancement
[short-time amplitude spectrum] matlab simulation of short-time amplitude spectrum estimation in speech enhancement
2022-04-21 18:36:00 【fpga&matlab】
1. Software version
matlab2021a
2. Theoretical knowledge of this algorithm
The most common technique for dealing with broadband noise is spectral subtraction , That is, the noise spectrum estimation is subtracted from the noisy speech estimation , And get the spectrum of pure speech . Because the human ear is insensitive to the phase of speech spectral components , Therefore, this method is mainly aimed at short-time amplitude spectrum . The speech is assumed to be a stationary signal , Noise and speech are additive signals and are not related to each other . At this time, the noisy speech signal can be expressed as
.
![]()
![]()



3. Part of the core code
function enhancedsignal=wiener(noisyspeech,samplefrequency)
x=noisyspeech;
fs=samplefrequency;
nx=length(x);
enhanced_x=zeros(1,nx);
% Framing and windowing
FrameLen=fix(0.025*fs); % take 25 Milliseconds is a frame
overlap=FrameLen/2;
inc=FrameLen-overlap; % Frame shift
x_frame=enframe(x,FrameLen,inc); % Framing
nf=size(x_frame,1); % frames
win=hamming(FrameLen)';
x_window=[];
for k=1:nf
x_row=x_frame(k,:).*win; % Add windows
x_window=[x_window;x_row];
end
% For noisy speech DFT
y=fft(x_window');
ymag = abs(y);
yphase = angle(y);
NNoise=23; % Take the noise section ( The initial segment of speech ) frames
MN=mean(ymag(:,1:NNoise)')';
PN=mean(ymag(:,1:NNoise)'.^2)'; % Mean value of initial noise power spectrum
NoiseCounter=0;% Length of continuous noise section
SmoothFactor=9;% Noise smoothing factor
Alpha=0.95; % Speech smoothing factor
SNRPre=ones(size(MN));
% Wiener filtering
for k=1:nf
if k<=NNoise
SpeechFlag=0;
NoiseCounter=NNoise;
else
NoiseMargin=3;
HangOver=8;
SpectralDist= 20*(log10(ymag(:,k))-log10(MN));
SpectralDist(find(SpectralDist<0))=0;
Dist=mean(SpectralDist);
if (Dist < NoiseMargin)
NoiseFlag=1;
NoiseCounter=NoiseCounter+1;
else
NoiseFlag=0;
NoiseCounter=0;
end
if (NoiseCounter > HangOver)
SpeechFlag=0;
else
SpeechFlag=1;
end
end
if SpeechFlag==0
MN=(SmoothFactor*MN+ymag(:,k))/(SmoothFactor+1); % Update the noise mean
PN=(SmoothFactor*PN+(ymag(:,k).^2))/(1+SmoothFactor); % Update noise power
end
%------ wave filtering
SNRNew=(ymag(:,k).^2)./PN-1;
SNRPost=Alpha*SNRPre+(1-Alpha).*max(SNRNew,0);
Gain=SNRPost./(SNRPost+1);
smag=Gain.*ymag(:,k);
SNRPre=smag.^2./PN;
spectrum= smag.*exp(j*yphase(:,k));
enhanced_x((inc*(k-1)+1):(inc*(k-1)+FrameLen))=enhanced_x((inc*(k-1)+1):(inc*(k-1)+FrameLen))+real(ifft(spectrum,FrameLen))';
end
enhancedsignal=enhanced_x;
4. Simulation conclusion

5. reference
[1] Yi Kechu . Voice signal processing [M]. Beijing : National Defense Industry Press , 2000.
[2] LiZhao, KOBAYASHI, NIIMI Y Tone. Recongnition of Chinese continuous speech using continuous HMMs[J]. Journal of the Acoustical Society of Japan, 53(12), 933-940, 1997.
A03-03
6. How to obtain the complete source code
The way 1: Wechat or QQ Contact bloggers
The way 2: subscribe
, Get the tutorial case code and any of this blog for free 2 Complete source code
版权声明
本文为[fpga&matlab]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204211834243626.html
边栏推荐
- String (a special data type)
- 干货| app自动化测试之Andriod微信小程序的自动化测试
- Target penetration exercise 73-dc5
- Advanced formula 47 of C language: recursive function analysis
- OBS接入网络摄像机
- 接口管理工具YApi怎么用?颜值高、易管理、超好用
- 数字艺术的文艺复兴,数字藏品的探索和崛起
- Question 3 on the third day of May 3, 2021
- Question 1 on the first day of May 1, 2021
- 华为、TCL、大疆
猜你喜欢

Pictures and texts teach you how to generate code with one click in idea to improve development efficiency!

并发工具之Semaphore与Exchanger

Target penetration exercise 77-dc9

Find the card with equal difference (20 points) C language

如何查看redis源码中的 zskiplist 结构

The products that were once bought are coming again. It must be right to buy them steadily
Building local canal middleware for data migration -- Inspiration from cache breakdown
![[daiy4] jz76 delete duplicate nodes in the linked list (recursion)](/img/d7/c8e5b575ea93ba170c994e70b4e1cb.png)
[daiy4] jz76 delete duplicate nodes in the linked list (recursion)

终于搞定微信扫码登录了,真香。。

使用chrome的replay功能快速地发表一遍blog
随机推荐
2021-5-3 第三天第三题
Win10 uwp inkcanvas control data binding
Tooltip 组件:根据内容是否溢出判断是否显示 Tooltip
Which immortal wrote 421 pages of advanced notes on MySQL, covering all MySQL technologies! It's so sweet
How to test Android WebView for automated testing of dry goods app
Question 1 on the first day of May 1, 2021
|NO.Z.00063|——————————|BigDataEnd|
Advanced mathematical formulas (Part 5)
C language operator summary
Observe cloud landing in Alibaba cloud computing nest and build a new ISV ecosystem
generic paradigm
Don't look for it. This is the clearest article on microservices so far! No one
Appium principle and jsonwp protocol analysis of automatic testing of dry goods app
一个简单易用的文件上传方案
Target penetration exercise 78 Thoth Tech
如何查看redis源码中的 zskiplist 结构
随笔小杂记(六)——tqdm进度条显示出现多余行
OBS接入网络摄像机
Redis三种特殊数据类型——Geospatial地理空间
Les produits qui ont été achetés sont de retour.