# Resample (Rational Resample) (G Dataflow)

Resamples a signal by a rational resampling factor.  ## reset

A Boolean that specifies the initialization of the internal state of the node.

 True Initializes the internal state to zero. False Initializes the internal state to the final state from the previous call of this node.

The first time this node runs or when reset is True, this node uses start index to determine when the resampling starts. The next time this node runs and reset is False, the internal state of this node initializes to the final state from the previous call to this node.

Processing a Large Data Sequence Consisting of Smaller Blocks

To process a large data sequence that consists of smaller blocks, set reset to True for the first block and to False for all the remaining blocks in continuous resampling.

Default: False ## signal

Input real signal for resampling.

The sampling interval of signal is 1.

This input accepts the following data types:

• Waveform
• Waveform in complex double-precision, floating-point numbers
• 1D array of waveforms
• 1D array of waveforms in complex double-precision, floating-point numbers
• 1D array of double-precision, floating-point numbers
• 2D array of double-precision, floating-point numbers
• 1D array of complex double-precision, floating-point numbers
• 2D array of complex double-precision, floating-point numbers ## resampling factor

Interpolation factor and decimation factor for resampling. ### interpolation

Interpolation factor for resampling.

Default: 1 ### decimation

Decimation factor for resampling.

Default: 1 ## start index

Index of the sample from which the node starts to resample the signal or when reset is True.

Set start index according to the signal after signal is interpolated. start index must be greater than or equal to 0.

This input changes to resampled t0 when you wire a waveform or 1D array of waveforms to signal.

Default: 0 ## resampled t0

Start time value for the resampled signal.

This input changes to start index when you wire an array of numbers to signal. ## error in

Error conditions that occur before this node runs.

The node responds to this input according to standard error behavior.

Standard Error Behavior

Many nodes provide an error in input and an error out output so that the node can respond to and communicate errors that occur while code is running. The value of error in specifies whether an error occurred before the node runs. Most nodes respond to values of error in in a standard, predictable way.

error in does not contain an error error in contains an error  If no error occurred before the node runs, the node begins execution normally.

If no error occurs while the node runs, it returns no error. If an error does occur while the node runs, it returns that error information as error out.

If an error occurred before the node runs, the node does not execute. Instead, it returns the error in value as error out.

Default: No error ## FIR filter specifications

Minimum values this node needs to specify the FIR filter. ### alias rejection (dB)

Minimum attenuation level of signal components aliased after any resampling operation.

Default: 120 ### normalized bandwidth

Fraction of the new sampling rate that is not attenuated.

Default: 0.4536 ## anti-aliasing

A Boolean that determines whether the input signal undergoes lowpass filtering when this node downsamples the signal.

 True Applies lowpass filtering to the input signal when downsampling the signal. False Does not apply lowpass filtering to the input signal when downsampling the signal.

If anti-aliasing is True, this node protects the resampled signal from aliasing. However, the computation requirements increase during resampling.

Default: True ## resampled signal

Resampled signal.

The sampling interval of resampled signal is decimation/interpolation.

This output can return the following data types:

• Waveform
• Waveform in complex double-precision, floating-point numbers
• 1D array of waveforms
• 1D array of waveforms in complex double-precision, floating-point numbers
• 1D array of double-precision, floating-point numbers
• 2D array of double-precision, floating-point numbers
• 1D array of complex double-precision, floating-point numbers
• 2D array of complex double-precision, floating-point numbers ## t0

Time instance for the first sample of each signal in the resampled signal.

This output is available only if you wire one of the following data types to signal:

• 1D array of double-precision, floating-point numbers
• 2D array of double-precision, floating-point numbers
• 1D array of complex double-precision, floating-point numbers
• 2D array of complex double-precision, floating-point numbers ## error out

Error information.

The node produces this output according to standard error behavior.

Standard Error Behavior

Many nodes provide an error in input and an error out output so that the node can respond to and communicate errors that occur while code is running. The value of error in specifies whether an error occurred before the node runs. Most nodes respond to values of error in in a standard, predictable way.

error in does not contain an error error in contains an error  If no error occurred before the node runs, the node begins execution normally.

If no error occurs while the node runs, it returns no error. If an error does occur while the node runs, it returns that error information as error out.

If an error occurred before the node runs, the node does not execute. Instead, it returns the error in value as error out.

## Algorithm for Rational Resampling

The following steps describe how this node completes the rational resampling process. Each step corresponds to a numbered section of the following image. 1. X is the input array for resampling. The time interval between two adjacent samples is 1.
2. This node inserts zeros between every two adjacent samples to upsample X by the Interpolation factor. Let X 1 represent the interpolated signal.
3. Using a FIR filter, this node filters X 1 at the Start Index to obtain the first output sample. The elements outside the range of the interpolated signal equal zero.
4. This node moves the filter to the position Start Index + Decimation Factor and filters again to obtain the second output sample.
5. This node repeats step 4 by adding each new Decimation Factor value until there are not enough samples in X1 for filtering. This node stores the final samples to internal states and wait for the next signal block. The time interval between two adjacent samples in an output signal is equal to Decimation Factor/Interpolation. t 0 specifies the time of the first output sample.

Where This Node Can Run:

Desktop OS: Windows

FPGA: Not supported

Web Server: Not supported in VIs that run in a web application