# Designing an FIR filter in Matlab with differing number of precursor taps and postcursor taps

I'm trying to fit an FIR filter to the measured frequency response (magnitude and phase) of a device. The frequency response is essentially a low-pass filter. I'd like to vary the number of taps to see how many are necessary to appropriately match the response, but also give differing number of precursor and postcursor taps in the design.

I've investigated Matlab's fdesign.arbmag and fdesign.arbmagnphase functions, but these seem to only give designs with the same number of pre- and post-cursor taps.

Here's some sample code with simplified frequency (F) and amplitude (A) values for reference.

F = 0:0.1:1;
A = [1 0.85 0.9 0.7 0.5 0.3 0.35 0.1 0.2 0.1 0];
filterOrder = 7;

d = fdesign.arbmag('N,F,A',filterOrder,F,A);
Hd = design(d);
fvtool(Hd)
tapWeights = [Hd.numerator];
disp(tapWeights)


The above code runs happily, and produces a low-pass filter that matches the frequency response reasonably well, with tap weights as follows:

[0.0030  0.0361  0.2161  0.4500  0.2161  0.0361  0.0030].


However, the central tap (the cursor, 0.45) is surrounded by three precursor and three postcursor taps. Is there a way to design, say, with one precursor and six postcursors.

Take as an example the design of an FIR low pass filter with $$21$$ taps. The figure below shows $$3$$ designs. The difference is the desired phase response. The top figure shows the impulse response (filter taps) for a linear desired phase response, the middle one for a non-linear phase response with a lower pass band delay than the linear phase response, and the bottom figure shows the impulse response of the corresponding minimum phase filter. The location of the peak is entirely determined by the specified phase response.