Voiced and Unvoiced Frames

Anyone can help me to make the code from this picture? Thank you

5 件のコメント

Mathieu NOE
Mathieu NOE 2021 年 3 月 10 日
hello
maybe this can be a starting point... just remembered I had this code around (zero crossing rate)
%% Read the input signal
[y, fs] = audioread('test_voice.wav');
N = length(y);
t = (0:N-1)/fs;
framelen = 128;
numframes = floor(N/framelen);
overlap = 0;
zcr = [];
for k = 1:numframes
frame = y((k-1)*framelen+1 : framelen*k) ;
arry = sign(frame(2:framelen)) - sign(frame(1:framelen-1));
zcr_frame = sum(abs(arry));
zcr = [zcr; zcr_frame] ;
end
% normalisation
zcr = zcr./max(zcr);
y = y./max(abs(y));
figure (1);
% t_zcr = (0:framelen:N-framelen)/fs ; % time stamp positionned at beginning of frame
t_zcr = (framelen/2:framelen:N-framelen/2)/fs ; % time stamp positionned at center of frame
plot(t,y,'b',t_zcr,zcr -1.5,'r');grid on;
xlabel('time(secs)'); ylabel('linear output')
Winda Mariana
Winda Mariana 2021 年 3 月 11 日
Thank you so much
can you help me from the hamming window, please?
Mathieu NOE
Mathieu NOE 2021 年 3 月 11 日
hello
sure ; this is the new code with hamming window applied on each frame (the window length must be equal to the frame length)
clear all; clc; close all;
%% Read the input signal
[y, fs] = audioread('test_voice.wav');
N = length(y);
t = (0:N-1)/fs;
framelen = 128;
window = hamming(framelen); % hamming windowing
numframes = floor(N/framelen);
overlap = 0;
zcr = [];
for k = 1:numframes
frame = y((k-1)*framelen+1 : framelen*k) ;
frame = frame.*window; % hamming windowing
arry = sign(frame(2:framelen)) - sign(frame(1:framelen-1));
zcr_frame = sum(abs(arry));
zcr = [zcr; zcr_frame] ;
end
% normalisation
zcr = zcr./max(zcr);
y = y./max(abs(y));
figure (1);
% t_zcr = (0:framelen:N-framelen)/fs ; % time stamp positionned at beginning of frame
t_zcr = (framelen/2:framelen:N-framelen/2)/fs ; % time stamp positionned at center of frame
plot(t,y,'b',t_zcr,zcr -1.5,'r');grid on;
xlabel('time(secs)'); ylabel('linear output')
Winda Mariana
Winda Mariana 2021 年 3 月 11 日
編集済み: Winda Mariana 2021 年 3 月 11 日
Thankyou so much
Can you help me to make for this code? I'm really need it for my final project🙏
Yashender Sharma
Yashender Sharma 2021 年 3 月 18 日
There are a lot of similar questions, you can browse MATLAB Central(MATLAB Answers, File Exchange etc.). Here's a link to similar question I've answered recently

サインインしてコメントする。

回答 (0 件)

タグ

質問済み:

2021 年 3 月 10 日

コメント済み:

2021 年 3 月 18 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by