About how to extract a speech signal's envelope
조회 수: 4 (최근 30일)
이전 댓글 표시
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
채택된 답변
Wayne King
2013년 2월 18일
편집: Wayne King
2013년 2월 18일
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])
추가 답변 (1개)
Wayne King
2013년 2월 18일
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
Wayne King
2013년 2월 18일
yes, in my example, analmtlb was the analytic signal, so the absolute value is the envelope.
참고 항목
카테고리
Help Center 및 File Exchange에서 Signal Processing Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!