Matlab envelope function help

13 views (last 30 days)
Leon Ellis
Leon Ellis on 5 Sep 2021
Edited: John D'Errico on 5 Sep 2021
Good day, my goal is to use the envelope() function to take sound signals and plot it's outskurts, so only it's amplitudes. Given an array of all the amplitudes of this sound signal, i was told I could use the envelope() function to create a new array plotting the outskirts of the signal making it easier to find words spoken in the sound wave. I'm unsure how to do this and am struggling to understand how the function works. If possible could I please get examples on how the function works (explain it as if I'm a dummy, cause at this point I think I am). Thanks a lot in advance!

Accepted Answer

John D'Errico
John D'Errico on 5 Sep 2021
Edited: John D'Errico on 5 Sep 2021
Seems pretty easy. Read the help, and look at the examples. Envelope is part of the signal processing toolbox.
t = linspace(0,5*pi,300);
sig = 2*sin(t) + sin(3*t) + randn(size(t))/50; % some noise for fun
[hi,lo] = envelope(sig);
plot(t,sig,'r-',t,hi,'g-',t,lo,'b-')
legend('Signal','upper','lower')
grid on
It can probably do better if I spend some time reading the help, but that is your job. I don't even have that toolbox.

More Answers (0)

Categories

Find more on Line Plots in Help Center and File Exchange

Products


Release

R2020a

Community Treasure Hunt

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

Start Hunting!