clc;
clear;
close all;
warning off;
addpath(genpath(pwd));
input_audio = 'sample.wav';
[y,Fs] = audioread(input_audio);
y = y * 2.^15; % original values into integer
n_samples = length(y);
frame_length = Fs/40; % Assuming Fs is integer.
% Frame length of 400 ms (for Fs = 16 kHz)
trailing_samples = mod(n_samples, frame_length);
frames = reshape( y(1:end-trailing_samples), frame_length, []);
n_frames = length(frames(1,:));
% -------------------------Zero-Crossing Rate-----------------------------
[ zcr ] = ZCR( y, frames, n_frames, Fs );
% -----------------------Hamming Windowing--------------------------------
h = hamming(frame_length);
h = repmat(h,1,n_frames);
w = frames.*h;
w_reshaped = reshape(w, 1, frame_length*n_frames);
% signal
figure;
subplot(2,1,1); plot(y); ylabel('Amplitude'); title('Audio input');
subplot(2,1,2); plot(w_reshaped, '.-');
xlabel('time'); ylabel('Amplitude'); title('Windowed signal');
energy = sum(w.^2);
figure;
subplot(2,1,1); plot(y); ylabel('Amplitude'); title('Audio input');
subplot(2,1,2); plot(energy, '.-');
xlabel('time'); ylabel('Energy (J)'); title('Signal energy');
基于ZCR过零检测法的语音信号端点检测matlab仿真+仿真录像
版权申诉
5星 · 超过95%的资源 95 浏览量
2022-11-04
23:53:04
上传
评论 2
收藏 1.78MB RAR 举报
fpga和matlab
- 粉丝: 16w+
- 资源: 2558
最新资源
- 前端-html+css+js实现爱心特效
- c40539bc-071a-486c-9d52-9d0c18d62dac 4.html
- 基于物理的非视域成像(NLOS)算法,利用了nerf+python源码+文档说明
- yuluer知更鸟.7z(1).001
- 基于Qt实现医院信息管理系统c++源码+文档说明+数据库(期末大作业)
- 基于python实现的医院信息管理系统完整源码+sql数据库+详细注释(高分课程设计)
- 基于python的眼底图像视杯视盘分割项目源码+文档说明+截图演示+详细注释(高分课程设计)
- ImageBasedModellingEdu-贰壹贰叁零
- DFFmeasurement-数据预处理
- ImageBasedModellingEdu-回文素数c语言
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈