Voiced and Unvoiced Frames

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

5 Comments

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')
Thank you so much
can you help me from the hamming window, please?
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 on 11 Mar 2021
Edited: Winda Mariana on 11 Mar 2021
Thankyou so much
Can you help me to make for this code? I'm really need it for my final project🙏
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

Sign in to comment.

Answers (0)

Categories

Find more on Psychology in Help Center and File Exchange

Asked:

on 10 Mar 2021

Commented:

on 18 Mar 2021

Community Treasure Hunt

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

Start Hunting!