added matlab
This commit is contained in:
Executable
+33
@@ -0,0 +1,33 @@
|
||||
function eval_minblep_pre()
|
||||
|
||||
f = 440;
|
||||
N = 4000;
|
||||
t = (-N/2:N/2-1)/N;
|
||||
|
||||
x = sin(t*f*pi)./sin(t*pi);% .* kaiser(N, 8)';
|
||||
x(find(isnan(x))) = f;
|
||||
%x = x / f;
|
||||
|
||||
% Real cepstrum
|
||||
x_rc = 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)]';
|
||||
y = real(ifft(exp(fft(w.*x_rc))));
|
||||
|
||||
xi = cumsum(x)/N;
|
||||
yi = cumsum(y)/N;
|
||||
|
||||
close all;
|
||||
subplot(2, 1, 1)
|
||||
plot(t, x/f, t, xi, 'r'); grid;
|
||||
|
||||
subplot(2, 1, 2)
|
||||
plot(0:N-1, y/f, 0:N-1, yi, 'r'); grid;
|
||||
|
||||
figure;
|
||||
plot(t, xi); grid;
|
||||
|
||||
figure;
|
||||
plot(t, yi); grid;
|
||||
|
||||
figure;
|
||||
plot(w); grid;
|
||||
Reference in New Issue
Block a user