Main Content

Filter

Filter RF complex baseband signals in Simulink

Since R2023a

  • Idealized Baseband Filter Block

Libraries:
RF Blockset / Idealized Baseband

Description

Use the Idealized Baseband Filter block to filter RF complex baseband signals in Simulink. You can use the Butterworth, Chebyshev, or inverse Chebyshev design methods to design your filter. You can also model your filter either in the time- or frequency-domain and plot the filter characteristics.

To design an RF filter with impedance mismatches, use the Circuit Envelope Filter block.

Note

The Idealized Baseband Filter block replaces the Lowpass RF Filter, Highpass RF Filter, Bandpass RF Filter, and Bandstop RF Filter blocks.

Examples

Ports

Input

expand all

Time-dependent input signal, specified as a real scalar, real column, complex scalar, or complex column. A column represents consecutive points in time.

Data Types: double | single

Output

expand all

Time-dependent output signal, returned as a complex scalar or complex column. The output time-dependent signal is equal in size to the input time-dependent signal.

Data Types: double | single

Parameters

expand all

Main

Filter design method, specified as one of the following:

  • Butterworth

  • Chebyshev

  • Inverse Chebyshev

Filter response type, specified as one of the following:

  • Lowpass — Simulates a lowpass filter type with the design specified in Design method.

  • Highpass — Simulates a highpass filter type with the design specified in Design method.

  • Bandpass — Simulates a bandpass filter type with the design specified in Design method.

  • Bandstop — Simulates a bandstop filter type with the design specified in Design method.

Select this parameter to implement the filter order manually.

Filter order, specified as a integer greater than 2. If you set Filter design to Lowpass or Highpass, specify the number of lumped storage elements. If you set Filter design to Bandpass or Bandstop, specify twice the number of lumped storage elements.

Dependencies

To enable this parameter, select Implement using filter order.

Passband frequency for lowpass, highpass, and bandpass filter types, specified as a positive real scalar or positive ascending two-tuple vector in Hz. Based on the Filter Type, accepted value types and default values differ as follows.

Filter TypeValue TypeDefault Values (Hz)
LowpassPositive real scalar1e9
HighpassPositive real scalar2000000000
BandpassPositive ascending two-tuple vector[2000000000 3000000000]

Dependencies

To enable this parameter, set Filter type to Lowpass, Highpass, or Bandpass.

Passband attenuation of the filter, specified as a positive real scalar in dB. For bandpass filters, this value is applied equally to both edges of the passband.

Dependencies

To enable this parameter, set Filter type to Lowpass, Highpass, or Bandpass.

Stopband frequencies for bandstop filters, specified as either a positive real scalar or positive ascending two-tuple vector in Hz. Based on the Filter Type and Implement using filter order parameters, accepted value types and default values differ as follows.

Filter TypeValue TypeDefault Values (Hz)To enable this parameter
LowpassPositive real scalar2000000000Set Filter type to Lowpass and clear Implement using filter order.
HighpassPositive real scalar1000000000Set Filter type to Highpass and clear Implement using filter order.
BandpassPositive ascending two-tuple vector[1500000000 3500000000]Set Filter type to Bandpass and clear Implement using filter order.
BandstopPositive ascending two-tuple vector[2100000000 2900000000]Set Filter type to Bandstop and clear or select Implement using filter order.

Stopband attenuation, specified as a positive real scalar greater than the Passband attenuation (dB) value in dB.

Dependencies

To enable this parameter, you can either:

  • Set Filter type to Lowpass, Highpass, or Bandpass and clear Implement using filter order.

  • Set Filter type to Bandstop, select Implement using filter order.

Center of the signal bandwidth with respect to the filter transfer function, specified as a positive real scalar in Hz. The signal bandwidth is 1Simulink Step Size.

Type of simulation to run, specified as one of the following:

  • Interpreted execution — Simulate the model using the MATLAB® interpreter. This option shortens the startup time, but the speed of the subsequent simulations is slower than when you use the Code generation option. Use this mode to debug the source code of the block.

  • Code generation — Simulate the model using generated C code. The first time you run a simulation, Simulink® generates C code for the block. The C code is reused for subsequent simulations as long as the model does not change. This option requires additional startup time, but the speed of the subsequent simulations is faster than when you use the Interpreted execution option.

Modeling

Modeling domain, specified as one of the following:

  • Time (Fixed step) — Model using fixed-step solvers (NDF2, Trapezoidal, and Backward Euler)

  • Time(Continuous) — Model using continuous or stiff solvers (ode15s, ode23s, ode23t, and ode23tb)

  • Frequency (Digital filter) — model using a 1-D digital filter.

Fixed-step and continuous time-domain solvers, specified as one of the following:

Fixed-step Solvers

  • NDF2 — Balance narrowband and wideband accuracy. This solver is suitable for situations where the frequency content of the signals in the system is unknown relative to the Nyquist rate.

  • Trapezoidal — Perform narrowband simulations. Frequency warping and the lack of damping effects make this method inappropriate for most wideband simulations.

  • Backward Euler — Simulate the largest class of systems and signals. Damping effects make this solver suitable for wideband simulation, but overall accuracy is low.

Continuous Solvers

  • ode15s — Solve stiff differential equations and DAEs using a variable order method

  • ode23s — Solve stiff differential equations using a low-order method

  • ode23t (trap) — Solve moderately stiff ODEs and DAEs using a trapezoidal rule

  • ode23tb (trap+BE) — Solve stiff differential equations using a trapezoidal rule and backward differentiation formula

Dependencies

To enable:

  • Fixed-step time-domain solvers, set Modeling domain to Time (Fixed step).

  • Continuous time-domain solvers, set Modeling domain to Time (Continuous).

Filter length of the 1-D digital filter or impulse response duration, specified as a real positive integer.

Dependencies

To set this parameter, set Modeling domain to Frequency (Digital filter).

Visualization

Plot type of the first plot, specified as one of the following:

  • S21

  • Phase delay

  • Group delay

  • Impulse response

  • Step response

Input arguments to plot the impulse response, specified as a two-element vector. Plot the impulse response by specifying the sample time of the input signal and the number of samples in this parameter. For more information, see impulse.

Dependencies

To set this parameter, set First plot type or Second plot type to Impulse response.

Input arguments to plot the step response, specified as a three-element vector. Plot the step response by specifying the sample time of the input signal, the number of samples, and the amount of time required for the step signal to reach the maximum value in this parameter. For more information, see stepresp.

Dependencies

To set this parameter, set First plot type or Second plot type to Step response.

Y-axis units of the first plot, specified as one of the following:

  • Magnitude (dB)

  • Magnitude (linear)

  • Angle (degrees)

  • Real

  • Imaginary

Dependencies

To set this parameter, set First plot type to S21.

Plot type of the second plot, specified as one of the following:

  • None

  • S21

  • Phase delay

  • Group delay

  • Impulse response

  • Step response

Y-axis units of the second plot, specified as one of the following:

  • Magnitude (dB)

  • Magnitude (linear)

  • Angle (degrees)

  • Real

  • Imaginary

Dependencies

To set this parameter, set Second plot type to S21.

Frequency points to plot the S-parameter data, specified as a positive real vector in Hz.

Select this parameter to plot your data on a linear or logarithmic X-axis scale. Specify Linear or Logarithmic.

Select this parameter to plot your data in a linear or logarithmic Y-axis scale. Specify Linear or Logarithmic.

Select this button to plot the characteristics of the S-parameters data.

Algorithms

expand all

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.

Version History

Introduced in R2023a

expand all