positive zero crossing of a speech signal

7 Ansichten (letzte 30 Tage)
reto panda
reto panda am 4 Aug. 2020
Beantwortet: Star Strider am 4 Aug. 2020
hello. I want to find locations of positive zero crossing of a speech signal . for example how in this picture how can I locate the places that signal is zero and before that was negative?

Antworten (1)

Star Strider
Star Strider am 4 Aug. 2020
Try this:
t = linspace(0, 1, 150); % Create Data
s = sin(2*pi*t*5); % Create Data
zci = @(y) find(diff(sign(y))); % Find Approximate Zero Crossing Indices
szx = zci(s); % Approximate Zero Crossing Indices
for k = 1:numel(szx)
idx = szx(k) + [0 1];
tzx(k) = interp1(s(idx), t(idx),0); % Interpolate To More Precise Zero-Crossings
dsdt(k) = diff(s(idx))./diff(t(idx)); % Derivative
end
figure
plot(t, s)
hold on
pzx = tzx(dsdt>0); % Derivative Greater Than 0
plot(pzx, zeros(size(pzx)),'^r')
hold off
grid
legend('Signal', 'Positive Zero Crossings')
Use your own time vector for ‘t’ and signal vector for ‘s’.
.

Community Treasure Hunt

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

Start Hunting!

Translated by