当前位置:网站首页>Matlab draws short-term average amplitude spectrum
Matlab draws short-term average amplitude spectrum
2022-07-26 22:02:00 【Hu Gang 2016】
And the last section matlab Draw a short-term energy diagram The difference is that , The last section is to find the square , Now it's the absolute value . But the figure obtained is the same as that in the previous section , Short time average amplitude spectrum comparison Short time energy spectrum The advantage of is to save computation , And there will be no calculation overflow error .
fid=fopen('zqq.txt', 'rt');
x=fscanf(fid, '%f');
fclose(fid);
% The calculated window length is 50, Frame shift =0 Speech energy at
s=fra(50, 50, x);% The frame length is 50 A digital , Move frame to 50 A digital , obtain s by 1319 That's ok ,50 Columns of the matrix . That is, every line has 50 A digital , this 50 A number is a frame
%disp(length(s2));
%disp(size(s2, 1));
%disp(size(s2, 2));
s2=abs(s);
%b=sum(a,dim); a According to matrix ;dim be equal to 1 perhaps 2,1 Indicates that each column is summed ,2 Means that each line is summed ; Indicates whether to sum every column or row ;b Represents the obtained row vector
energy=sum(s2, 2);% The matrix s2 Sum each line , energy by 1319 That's ok ,1 Column , That is, each number represents a frame of energy
%disp(size(energy, 1));
%disp(size(energy, 2));
subplot(2, 2, 1);
plot(energy);
xlabel(' frames ');
ylabel(' Short term energy E');
legend(' Window length N=50');
axis([0, 1500, 0, 10*10^5]);
% The calculated window length is 100, Frame shift =0 Speech energy at
s=fra(100, 100, x);
s2=abs(s);
energy=sum(s2, 2);
subplot(2, 2, 2);
plot(energy);
xlabel(' frames ');
ylabel(' Short term energy E');
legend(' Window length N=100');
axis([0, 750, 0, 2*10^6]);
% The calculated window length is 400, Frame shift =0 Speech energy at
s=fra(400, 400, x);
s2=abs(s);
energy=sum(s2, 2);
subplot(2, 2, 3);
plot(energy);
xlabel(' frames ');
ylabel(' Short term energy E');
legend(' Window length N=400');
axis([0, 190, 0, 7*10^6]);
% The calculated window length is 800, Frame shift =0 Speech energy at
s=fra(800, 800, x);
s2=abs(s);
energy=sum(s2, 2);
subplot(2, 2, 4);
plot(energy);
xlabel(' frames ');
ylabel(' Short term energy E');
legend(' Window length N=800');
axis([0, 95, 0, 14*10^6]);
function f=fra(len, inc, x)
%len Is the frame length ,inc Shift for the frame length by one frame
%size(X,1), Return matrix X The number of rows ;
%size(X,2), Return matrix X Columns of ;
%disp(size(x, 1));
fh=fix(((size(x, 1) - len)/inc) + 1);% Count the frames ,fh=1319
%disp(fh);
f=zeros(fh, len);%fh That's ok ,len Column 0 matrix , Here is 1319 That's ok ,50 Column 0 matrix
i=1; n=1;
while i<=fh
j=1;
% The following loop is to fill one line at a time 50 A digital , That's a frame , Fill in a line , Add the number of rows 1 Then fill in again
while j<=len
f(i, j)=x(n);
j=j+1;
n=n+1;
end
n=n-len+inc;% n-len Represents that it will be restored to the end of the previous frame ,+inc It means to move at the end of the previous frame inc length
i=i+1;
end
end

边栏推荐
- Search Yiwu shopping (PAI Li Tao) API by image
- 寻找数字零售的发展新方向,才是保证数字零售可以进入到全新发展阶段的关键
- 基于CAShapeLayer和贝塞尔曲线的圆形进度条动画
- Selenium自动化测试面试题全家桶
- Thoroughly understand the principle and implementation of service discovery
- If you do not add waitkey() function after imshow() function, it will not be displayed
- Pbootcms一级栏目下的二级三级栏目高亮
- Pytoch uses RNN model to build person name classifier
- Tester: "I have five years of testing experience" HR: "no, you just used one year of work experience for five years."
- In depth interpretation of happens before principle
猜你喜欢

In depth analysis of the source code, why is the string class immutable? (hit me before you understand)

Summer vacation daily question week 7:7.18 - 7.24

LDAP -- realize unified login management of users

7、 Wechat applet running error: error: illegal appid, invalid appid

Altium designer 22 modify the layer properties of the selected component

攻防世界----ics-07

我的sql没问题为什么还是这么慢|MySQL加锁规则

Logical vulnerability - arbitrary account registration

cmake编译obs-studio-27.2.0

FreeRTOS personal notes - Events
随机推荐
五、小程序报错:message:Error: 系统错误,错误码:80058,desc of scope.userLocation is empty
Ren Zhengfei talked about the suppression of the United States again: to live is to win, and to defeat the United States
知识库工具 | 微网站、文档中心、形象展示页拖拽即可生成(附模板,直接用)
Vi和Vim文本编辑器
Pinduoduo gets search term recommendation API
Logical vulnerability - arbitrary account registration
Happens-Before原则深入解读
方法重载与方法重写
Overview of MPLS Basics
仅需一个依赖给Swagger换上新皮肤,既简单又炫酷
仅需一个依赖给Swagger换上新皮肤,既简单又炫酷~
Shangtang technology releases sensepass pro, an all-in-one face recognition machine
京东一面:Redis 如何实现库存扣减操作?如何防止商品被超卖?
Shrimp Shope takes the commodity list API according to keywords
织梦提示DedeCMS Error:Tag disabled:php!
Flink's real-time data analysis practice in iFLYTEK AI marketing business
技术分享 | 服务端接口自动化测试, Requests 库的这些功能你了解吗?
按关键字搜索易贝商品 API
My SQL is OK. Why is it still so slow? MySQL locking rules
从手动测试,到自动化测试老司机,只用了几个月,我的薪资翻了一倍