Accelerating the pace of engineering and science

# Gaussian Filter

Filter input signal, possibly downsampling, using Gaussian FIR filter

Comm Filters

## Description

 Note:   The Gaussian Filter block is not recommended. Use the gaussdesign function and either the Discrete FIR Filter, FIR Interpolation, or FIR Decimation block instead.

The Gaussian Filter block filters the input signal using a Gaussian FIR filter. The block expects the input signal to be upsampled as its input, so that the Input samples per symbol parameter, N, is at least 2. The block's icon shows the filter's impulse response."

### Characteristics of the Filter

The impulse response of the Gaussian filter is

$h\left(t\right)=\frac{\mathrm{exp}\left(\frac{-{t}^{2}}{2{\delta }^{2}}\right)}{\sqrt{2\pi }\cdot \delta }$

where

$\delta =\frac{\sqrt{\mathrm{ln}\left(2\right)}}{2\pi BT}$

and B is the filter's 3-dB bandwidth. The BT product parameter is B times the input signal's symbol period. For a given BT product, the Signal Processing Toolbox™ gaussfir function generates a filter that is half the bandwidth of the filter generated by the Communications System Toolbox™ Gaussian Filter block.

The Group delay parameter is the number of symbol periods between the start of the filter's response and the peak of the filter's response. The group delay and N determine the length of the filter's impulse response, which is 2 * N * Group delay + 1.

The Filter coefficient normalization parameter indicates how the block scales the set of filter coefficients:

• Sum of coefficients means that the sum of the coefficients equals 1.

• Filter energy means that the sum of the squares of the coefficients equals 1.

• Peak amplitude means that the maximum coefficient equals 1.

After the block normalizes the set of filter coefficients as above, it multiplies all coefficients by the Linear amplitude filter gain parameter. As a result, the output is scaled by $\sqrt{N}$. If the output of this block feeds the input to the AWGN Channel block, specify the AWGN signal power parameter to be 1/N.

### Input and Output Signals

This block accepts scalar, column vector, and M-by-N matrix input signals. The block filters an M-by-N input matrix as follows:

• When you set the Input processing parameter to Columns as channels (frame based), the block treats each column as a separate channel. In this mode, the block creates N instances of the same filter, each with its own independent state buffer. Each of the N filters process M input samples at every Simulink® time step.

• When you set the Input processing parameter to Elements as channels (sample based), the block treats each element as a separate channel. In this mode, the block creates M*N instances of the same filter, each with its own independent state buffer. Each filter processes one input sample at every Simulink time step.

The output dimensions always equal those of the input signal. For information about the data types each block port supports, see the table on this page.

### Exporting Filter Coefficients to the MATLAB Workspace

To examine or manipulate the coefficients of the filter that this block designs, select Export filter coefficients to workspace. Then set the Coefficient variable name parameter to the name of a variable that you want the block to create in the MATLAB workspace. Running the simulation causes the block to create the variable, overwriting any previous contents in case the variable already exists.

## Dialog Box

Input samples per symbol

A positive integer representing the number of samples per symbol in the input signal.

BT product

The product of the filter's 3-dB bandwidth and the input signal's symbol period

Group delay

A positive integer that represents the number of symbol periods between the start of the filter response and its peak.

Filter coefficient normalization

The block scales the set of filter coefficients so that this quantity equals 1. Choices are Sum of coefficients, Filter energy, and Peak amplitude.

Input processing

Specify how the block processes the input signal. You can set this parameter to one of the following options:

• Columns as channels (frame based) — When you select this option, the block treats each column of the input as a separate channel.

• Elements as channels (sample based) — When you select this option, the block treats each element of the input as a separate channel.

 Note:   The Inherited (this choice will be removed - see release notes) option will be removed in a future release. See Frame-Based Processing in the Communications System Toolbox Release Notes for more information.

This parameter is available only when you set the Rate options parameter to Allow multirate processing.

Linear amplitude filter gain

A positive scalar used to scale the filter coefficients after the block uses the normalization specified in the Filter coefficient normalization parameter.

Export filter coefficients to workspace

If you check this box, then the block creates a variable in the MATLAB workspace that contains the filter coefficients.

Coefficient variable name

The name of the variable to create in the MATLAB workspace. This field appears only if Export filter coefficients to workspace is selected.

Visualize filter with FVTool

If you click this button, then MATLAB launches the Filter Visualization Tool, fvtool, to analyze the Gaussian filter whenever you apply any changes to the block's parameters. If you launch fvtool for the filter, and subsequently change parameters in the mask, fvtool will not update. You will need to launch a new fvtool in order to see the new filter characteristics. Also note that if you have launched fvtool, then it will remain open even after the model is closed.

Rounding mode

Select the rounding mode for fixed-point operations. The filter coefficients do not obey this parameter; they always round to Nearest. The block uses the Rounding selection if a number cannot be represented exactly by the specified data type and scaling, it is rounded to a representable number. For more information, see Rounding Modes in the DSP System Toolbox™ documentation or Rounding Mode: Simplest in the Fixed-Point Designer™ documentation.

Overflow mode

Select the overflow mode for fixed-point operations. The filter coefficients do not obey this parameter; they are always saturated.

Coefficients

The block implementation uses a Direct-Form FIR filter. The Coefficients parameter controls which data type represents the coefficients when the input data is a fixed-point signal.

Choose how you specify the word length and the fraction length of the filter coefficients (numerator and/or denominator). See Filter Structure Diagrams in the DSP System Toolbox Reference Guide for illustrations depicting the use of the coefficient data types in this block:

• When you select Same word length as input, the word length of the filter coefficients match that of the input to the block. In this mode, the fraction length of the coefficients is automatically set to the binary-point only scaling that provides you with the best precision possible given the value and word length of the coefficients.

• When you select Specify word length, you are able to enter the word length of the coefficients, in bits. In this mode, the fraction length of the coefficients is automatically set to the binary-point only scaling that provides you with the best precision possible given the value and word length of the coefficients.

• When you select Binary point scaling, you are able to enter the word length and the fraction length of the coefficients, in bits. If applicable, you are able to enter separate fraction lengths for the numerator and denominator coefficients.

• When you select Slope and bias scaling, you are able to enter the word length, in bits, and the slope of the coefficients. If applicable, you are able to enter separate slopes for the numerator and denominator coefficients. This block requires power-of-two slope and a bias of zero.

• The filter coefficients do not obey the Rounding mode and the Overflow mode parameters; they are always saturated and rounded to Nearest.

Product output

Use this parameter to specify how you would like to designate the product output word and fraction lengths. See Multiplication Data Types and Multiplication Data Types in the DSP System Toolbox Reference Guide for illustrations depicting the use of the product output data type in this block:

• When you select Same as input, these characteristics match those of the input to the block.

• When you select Binary point scaling, you are able to enter the word length and the fraction length of the product output, in bits.

• When you select Slope and bias scaling, you are able to enter the word length, in bits, and the slope of the product output. This block requires power-of-two slope and a bias of zero.

Accumulator

Use this parameter to specify how you would like to designate the accumulator word and fraction lengths. See Filter Structure Diagrams and Multiplication Data Types for illustrations depicting the use of the accumulator data type in this block:

• When you select Same as input, these characteristics match those of the input to the block.

• When you select Same as product output, these characteristics match those of the product output.

• When you select Binary point scaling, you are able to enter the word length and the fraction length of the accumulator, in bits.

• When you select Slope and bias scaling, you are able to enter the word length, in bits, and the slope of the accumulator. This block requires power-of-two slope and a bias of zero.

Output

Choose how you specify the output word length and fraction length:

• When you select Same as input, these characteristics match those of the input to the block.

• When you select Same as accumulator, these characteristics match those of the accumulator.

• When you select Binary point scaling, you are able to enter the word length and the fraction length of the output, in bits.

• When you select Slope and bias scaling, you are able to enter the word length, in bits, and the slope of the output. This block requires power-of-two slope and a bias of zero.

Lock scaling against changes by the autoscaling tool

Select this parameter to prevent any fixed-point scaling you specify in this block mask from being overridden by the autoscaling tool in the Fixed-Point Tool.

## Supported Data Type

PortSupported Data Types
In
• Double-precision floating point

• Single-precision floating point

• Signed fixed-point

Out
• Double-precision floating point

• Single-precision floating point

• Signed fixed-point