当前位置:网站首页>Matlab draw short-term energy diagram
Matlab draw short-term energy diagram
2022-07-26 22:02:00 【Hu Gang 2016】
The use of zqq.txt It's a voice file , Only 1 Column , The number is probably 60000 Multiple

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=s.^2;
%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, 2*10^10]);
% The calculated window length is 100, Frame shift =0 Speech energy at
s=fra(100, 100, x);
s2=s.^2;
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, 4*10^10]);
% The calculated window length is 400, Frame shift =0 Speech energy at
s=fra(400, 400, x);
s2=s.^2;
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, 1.5*10^11]);
% The calculated window length is 800, Frame shift =0 Speech energy at
s=fra(800, 800, x);
s2=s.^2;
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, 3*10^11]);
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

边栏推荐
- Pytorch torch. add() torch. add_ () usage
- The United States once again challenged: Forbidding contractors to purchase the equipment and technology of these five Chinese companies
- 从手动测试,到自动化测试老司机,只用了几个月,我的薪资翻了一倍
- Ansible installation and use
- 分布式 session 的4个解决方案
- A new technical director asked me to do an IP territorial function~
- Search Yiwu shopping (PAI Li Tao) API by image
- 成功上岸了自动化测试岗,最高月薪15.4K,自己真棒~
- The principle of normal equation method and its difference from gradient descent method
- Pytoch uses RNN model to build person name classifier
猜你喜欢

Oppo self-developed large-scale knowledge map and its application in digital intelligence engineering

正规方程法(Normal Equation)原理以及与梯度下降法的区别

Selenium automated test interview questions family bucket

CMake 的使用

伦敦银外汇走势理解与实操

彻底搞通服务发现的原理和实现

吃透负载均衡

matlab 激励模型 三角波频谱

FreeRTOS personal notes - Events

五、小程序报错:message:Error: 系统错误,错误码:80058,desc of scope.userLocation is empty
随机推荐
Go----Go语言中的变量使用方法
Join method in JS
逻辑漏洞----任意账号注册
matlab 激励模型 三角波频谱
VB.net Chart1的处理
月薪5万的朋友告诉我,你只是在打杂
Happens-Before原则深入解读
仅需一个依赖给Swagger换上新皮肤,既简单又炫酷
分布式 session 的4个解决方案
Thoroughly understand the principle and implementation of service discovery
MOS 管示意图
FreeRTOS personal notes - Events
Flash source code startup phase
Pytorch torch.add() torch.add_() 用法
Schematic diagram of MOS tube
Overview of MPLS Basics
Uncover the secrets of Xiaomi 100million pixel camera: 1/1.3 inch COMS sensor, resolution 12032 × nine thousand and twenty-four
Selenium自动化测试面试题全家桶
Huawei released the top ten trends in 2025: 5g, robot, AI, etc
Resume in 2022 is dead in the sea. Don't vote. Software testing positions are saturated