Main Content

このページの内容は最新ではありません。最新版の英語を参照するには、ここをクリックします。

rceps

実数ケプストラムと最小位相復元

説明

[y,ym] = rceps(x) では、入力シーケンスの実数ケプストラム y と最小位相再構成されたバージョン ym の両方が返されます。

すべて折りたたむ

音声の録音には壁面からの反射によるエコーが含まれることがあります。実数ケプストラムを使用してこれをフィルター処理します。

この録音では、話者は MATLAB® という言葉を話しています。データとサンプル レート Fs=7418Hz を読み込みます。

load mtlb

% To hear, type soundsc(mtlb,Fs)

Δ サンプル遅延させ、既知の係数 α: y(n)=x(n)+αx(n-Δ) により減衰させた信号のコピーを録音に追加して、エコーをモデル化します。タイム ラグを 0.23 秒に、減衰係数を 0.5 に指定します。

timelag = 0.23;
delta = round(Fs*timelag);
alpha = 0.5;

orig = [mtlb;zeros(delta,1)];
echo = [zeros(delta,1);mtlb]*alpha;

mtEcho = orig + echo;

元の信号、エコー、結果の信号をプロットします。

t = (0:length(mtEcho)-1)/Fs;

% To hear, type soundsc(mtEcho,Fs)

subplot(2,1,1)
plot(t,[orig echo])
legend("Original","Echo")

subplot(2,1,2)
plot(t,mtEcho)
legend("Total")
xlabel("Time (s)")

Figure contains 2 axes objects. Axes object 1 contains 2 objects of type line. These objects represent Original, Echo. Axes object 2 with xlabel Time (s) contains an object of type line. This object represents Total.

信号の実数ケプストラムを計算します。ケプストラムをプロットして、その最大値に注釈を付けます。ケプストラムはエコーが到着し始めた時点で鋭いピークになります。

c = rceps(mtEcho);

[px,locs] = findpeaks(c,Threshold=0.2,MinPeakDistance=0.2);

clf
plot(t,c,t(locs),px,"o")
xlabel("Time (s)")

Figure contains an axes object. The axes object with xlabel Time (s) contains 2 objects of type line. One or more of the lines displays its values using only markers

出力 ww(n)+αw(n-Δ)=y(n) に従う IIR システムを通して信号をフィルター処理することにより、エコーをキャンセルします。フィルター処理した信号をプロットして、元の信号と比較します。

dl = locs(2)-1;

mtNew = filter(1,[1 zeros(1,dl-1) alpha],mtEcho);

% To hear, type soundsc(mtNew,Fs)

subplot(2,1,1)
plot(t,orig)
legend("Original")

subplot(2,1,2)
plot(t,mtNew)
legend("Filtered")
xlabel("Time (s)")

Figure contains 2 axes objects. Axes object 1 contains an object of type line. This object represents Original. Axes object 2 with xlabel Time (s) contains an object of type line. This object represents Filtered.

入力引数

すべて折りたたむ

入力信号。実数ベクトルで指定します。

出力引数

すべて折りたたむ

実数ケプストラム。ベクトルとして返されます。

最小位相実数ケプストラム。ベクトルとして返されます。

アルゴリズム

"実数ケプストラム" は、シーケンスのフーリエ変換の振幅の自然対数を逆フーリエ変換したものです。

メモ

rceps は、実データに対してのみ使用できます。

rceps は、参考文献[2]のアルゴリズム 7.2 を実装したもので、以下となります。

y = real(ifft(log(abs(fft(x)))));

ケプストラム領域で適切なウィンドウ処理を適用すると、復元された最小位相信号が作成されます。

w = [1;2*ones(n/2-1,1);ones(1-rem(n,2),1);zeros(n/2-1,1)];
ym = real(ifft(exp(fft(w.*y))));

参照

[1] Oppenheim, Alan V., and Ronald W. Schafer. Digital Signal Processing, Englewood Cliffs, NJ, Prentice-Hall, 1975.

[2] Programs for Digital Signal Processing, IEEE Press, New York, 1979.

拡張機能

C/C++ コード生成
MATLAB® Coder™ を使用して C および C++ コードを生成します。

バージョン履歴

R2006a より前に導入

参考

| | | |