%==========================================================================
%===== By Multipling The Coefficients of The FIR Filter By (-1)^n And =====
%===== Redisplaying The Spectral Response, We Design This Way Filters =====
%===== Called 'Mirror Filters'. It Can Be Seen From The Resulting     =====
%===== Spectral Response That The Original Response Has Been          =====
%===== 'Mirrored' As A Result of Multiplying It By (-1)^n.            =====
%==========================================================================

Fs=400;
wn=[.1 .3];
n=(1:1:50);
p=(-1).^n;
[b,a]=FIR1(49,wn);
c=b.*p;
[H,w]=freqz(b,a,512);
[h,w]=freqz(c,a,512);

figure(1);
plot(w*Fs/(2*pi),abs(H),w*Fs/(2*pi),abs(h));
title('A Mirror Filter');
xlabel('Frequency (Hz)');
ylabel('Magnitude of Filter Response');
grid on