Contenu principal

firlp2lp

Transform FIR Type I lowpass to FIR Type 1 lowpass with inverse bandwidth

Description

g = firlp2lp(b) transforms the Type I lowpass FIR filter b with zero-phase response Hr(w) to a Type I lowpass FIR filter g with zero-phase response [1 - Hr(π-w)].

When b is a narrowband filter, g will be a wideband filter and vice versa. The passband and stopband ripples of g will be equal to the stopband and passband ripples of b, respectively.

example

tfiltObj = firlp2lp(pfiltObj) specifies the input lowpass FIR filter as a dsp.FIRFilter object. The function returns the target lowpass FIR filter with an inverted bandwidth as a dsp.FIRFilter object. (since R2026a)

example

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 5]);

zerophase(b)

Figure contains an axes object. The axes object with title Zero-Phase Response, xlabel Normalized Frequency ( times pi rad/sample), ylabel Amplitude contains an object of type line.

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

h = firlp2lp(b);

hold on
zerophase(h)

Figure contains an axes object. The axes object with title Zero-Phase Response, xlabel Normalized Frequency ( times pi rad/sample), ylabel Amplitude contains 2 objects of type line.

Convert the previous filter back to a narrowband lowpass filter. Add to the plot the zero-phase response of the new filter.

g = firlp2lp(h);

[gr,w] = zerophase(g);
plot(w/pi,gr,'--')
hold off

Figure contains an axes object. The axes object with title Zero-Phase Response, xlabel Normalized Frequency ( times pi rad/sample), ylabel Amplitude contains 3 objects of type line.

Since R2026a

Design and implement a lowpass FIR filter object using the designLowpassFIR function. Set the cutoff frequency to 0.7π rad/sample and the function designs a wideband lowpass FIR filter. Set the SystemObject argument to true to generate a dsp.FIRFilter object.

lpfirFilt = designLowpassFIR(FilterOrder=30,CutoffFrequency=0.7,Window="hann",...
        Datatype="single",SystemObject=true)
lpfirFilt = 
  dsp.FIRFilter with properties:

            Structure: 'Direct form'
      NumeratorSource: 'Property'
            Numerator: [0 -1.4602e-04 -3.2707e-04 0.0024 -0.0039 6.8217e-18 0.0099 -0.0169 0.0078 0.0204 -0.0477 0.0390 0.0297 -0.1448 0.2547 0.7000 0.2547 -0.1448 0.0297 0.0390 -0.0477 0.0204 0.0078 -0.0169 0.0099 6.8217e-18 -0.0039 … ] (1×31 single)
    InitialConditions: 0

  Show all properties

Transform this filter to a narrowband lowpass FIR filter using the firlp2lp function.

tfirFilt = firlp2lp(lpfirFilt)
tfirFilt = 
  dsp.FIRFilter with properties:

            Structure: 'Direct form'
      NumeratorSource: 'Property'
            Numerator: [0 1.4602e-04 -3.2707e-04 -0.0024 -0.0039 -6.8217e-18 0.0099 0.0169 0.0078 -0.0204 -0.0477 -0.0390 0.0297 0.1448 0.2547 0.3000 0.2547 0.1448 0.0297 -0.0390 -0.0477 -0.0204 0.0078 0.0169 0.0099 -6.8217e-18 -0.0039 … ] (1×30 single)
    InitialConditions: 0

  Show all properties

Visualize the magnitude response of the prototype filter and the transformed filter using the filter analyzer.

filterAnalyzer(lpfirFilt,tfirFilt,FilterNames=["WidebandLowpassFIR","NarrowbandLowpassFIR"])

Input Arguments

collapse all

Type 1 lowpass FIR filter coefficients with zero-phase response Hr(w), specified as a row vector.

Data Types: single | double

Since R2026a

Lowpass FIR filter object, specified as a dsp.FIRFilter object.

Output Arguments

collapse all

Transformed Type 1 lowpass FIR filter coefficients with zero-phase response 1-Hr(pi-w), specified as a row vector.

Data Types: single | double

Since R2026a

Transformed lowpass FIR filter object with an inverted bandwidth, returned as a dsp.FIRFilter object.

References

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

Version History

Introduced in R2011a

expand all