fsHz = 1e3;
N = 5e2;
x = randn(N, 1) + 1j * randn(N, 1);
%% LP definition
Fs = 1; % Sampling Frequency
Fpass = 0.1; % Passband Frequency
Fstop = 0.15; % Stopband Frequency
Dpass = 0.057501127785; % Passband Ripple
Dstop = 0.001; % Stopband Attenuation
dens = 20; % Density Factor
[N, Fo, Ao, W] = firpmord([Fpass, Fstop]/(Fs/2), [1 0], [Dpass, Dstop]);
bLow = firpm(N, Fo, Ao, W, {dens}).';
% HP definition
Fs = 1; % Sampling Frequency
Fstop = 0.25; % Stopband Frequency
Fpass = 0.3; % Passband Frequency
Dstop = 0.001; % Stopband Attenuation
Dpass = 0.057501127785; % Passband Ripple
dens = 20; % Density Factor
[N, Fo, Ao, W] = firpmord([Fstop, Fpass]/(Fs/2), [0 1], [Dstop, Dpass]);
bHigh = firpm(N, Fo, Ao, W, {dens}).';
bLen = max(numel(bLow), numel(bHigh));
bLow = padarray(bLow, bLen - numel(bLow), 0, 'post');
bHigh = padarray(bHigh, bLen - numel(bHigh), 0, 'post');
b = bLow + bHigh;
% Filter
xFilt = filter(b, 1, x);
figure(101);
subplot(2, 1, 1);
periodogram(x, [], [], fsHz);
title('Ori');
subplot(2, 1, 2);
periodogram(xFilt, [], [], fsHz);
title('BSF');