About how to extract a speech signal's envelope
6 views (last 30 days)
Show older comments
Hello,
I had a question about extract a speech signal's envelope.
y=wavread('test.wav');
x=hilbert(y);
x1=abs(x);
x2=sqrt(x.*conj(x));
x1 and x2 are two different way that I had found on Google. Looks very similar but not equal (isequal(x1,x2)=0)
I don't know which one was right. and I had try some code about envelope detector on MATLAB file center, but the result seems not correct...
Thanks
0 Comments
Accepted Answer
Wayne King
on 18 Feb 2013
Edited: Wayne King
on 18 Feb 2013
Using the Hilbert transform is a better way to proceed than your
x2 = sqrt(x.*conj(x));
The above just gives the magnitude squared of each of the waveform values and that is not the envelope. At least probably not in the sense you mean envelope. To illustrate how the Hilbert transform does indeed extract the envelope, I'll give you a simple example with an AM-modulated wave.
Fs = 1000;
t = 0:0.001:1-0.001;
% 250-Hz sine wave modulated at 10 Hz
x = [1+cos(2*pi*10*t)].*cos(2*pi*250*t);
y = hilbert(x);
plot(t,x,'k'); hold on;
plot(t,abs(y),'b','linewidth',2);
plot(t,-abs(y),'b','linewidth',2);
If you know zoom in on parts of the waveform, you'll clearly see how the modulus of the analytic signal yields the envelope. Specifically, you see that the envelope oscillates at 10 Hz.
set(gca,'xlim',[0.05 0.35]);
set(gca,'ylim',[-2 2])
More Answers (1)
Wayne King
on 18 Feb 2013
Yes, basically, although, I'm not sure why you set the amplitude equal to 0.5
For example:
load mtlb;
analmtlb = hilbert(mtlb);
t = 0:1/Fs:length(mtlb)*(1/Fs)-1/Fs;
x = cos(2*pi*500*t);
y = abs(analmtlb).*x';
soundsc(y,Fs)
2 Comments
Wayne King
on 18 Feb 2013
yes, in my example, analmtlb was the analytic signal, so the absolute value is the envelope.
See Also
Categories
Find more on Signal Processing Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!