# firlp2hp

Transform FIR lowpass filter to Type I FIR highpass filter

## Description

example

g = firlp2hp(b) transforms the lowpass FIR filter b with zero-phase response Hr(w) into a Type I highpass FIR filter g with zero-phase response Hr(π-w). Filter b can be any FIR filter, including a nonlinear-phase filter.

The passband and stopband ripples of g will be equal to the passband and stopband ripples of b, respectively.

g = firlp2hp(b,'narrow') transforms the lowpass FIR filter b into a Type I narrowband highpass FIR filter g with zero-phase response Hr(π-w). b can be any FIR filter, including a nonlinear-phase filter.

g = firlp2hp(b,'wide') transforms the Type I lowpass FIR filter b with zero-phase response Hr(w) into a Type I wideband highpass FIR filter g with zero-phase response 1 - Hr(w).

Note

The b must be a Type I linear-phase filter.

For this case, the passband and stopband ripples of g will be equal to the stopband and passband ripples of b.

## Examples

collapse all

Create a narrowband lowpass filter to use as a prototype. Display its zero-phase response.

b = firgr(36,[0 0.2 0.25 1],[1 1 0 0],[1 3]);

zerophase(b)

Convert the prototype filter to a narrowband highpass filter. Add to the plot the zero-phase response of the new filter.

h = firlp2hp(b);

hold on
zerophase(h)

Convert the prototype filter to a wideband highpass filter. Add to the plot the zero-phase response of the new filter.

g = firlp2hp(b,'wide');

zerophase(g)
hold off

## Input Arguments

collapse all

Lowpass FIR filter coefficients, specified as a row vector.

Data Types: single | double

## Output Arguments

collapse all

Type I highpass FIR filter coefficients, returned as a row vector.

Data Types: single | double

## References

[1] Mitra, Sanjit Kumar, and James F. Kaiser, eds. Handbook for Digital Signal Processing. New York: Wiley, 1993.