|
|
@@ -51,11 +51,13 @@ function [FIR IR MPS] = sphear_design_capsule_fir_filters(F, n, SR, SHAPE)
|
|
|
%%
|
|
|
MPS(b,:) = real(ifft(mps(fft(IR(b,:)))));
|
|
|
%%
|
|
|
+ %% we need to preserve the sign, the minimum phase transformation strips it
|
|
|
+ sgn = sign(IR(b,n/2+1));
|
|
|
%% create a raised cosine window for the end of the IR
|
|
|
%% to make sure IR decays to zero (last 8 samples of a 256 sample IR)
|
|
|
end_window = tukeywin(2 * n, 0.025)(n+1:end);
|
|
|
%% truncate to original size and window end
|
|
|
- FIR(b,:) = (MPS(b,:)')(1:n) .* end_window;
|
|
|
+ FIR(b,:) = (MPS(b,:)')(1:n) .* end_window * sgn;
|
|
|
end
|
|
|
end
|
|
|
|