Skip to main content

Docs health: incomplete.

Learn more

Transfer Function

The Transfer Function operation determines the frequency response between two signals, revealing how a system transforms an input signal into an output signal in the frequency domain.

Usage

Cheatsheet

  • Input: Exactly two signals (input and output)
  • Settings: Assign the correct signals as input and output
  • Output: One or two new signals (magnitude and/or phase) in the frequency domain

Prerequisites

  • Select exactly two signals as input
    • Sufficient data length: At least 4 data points (perferably much more for meaningful results)
    • Both signals should be time-aligned (covering the same time period)
      • If not, alginment is performed automatically
    • Both signals should be uniformly sampled
      • If not, resampling is performed automatically

Settings

ParameterValuesDescription
Input SignalSignalsThe system’s input signal
Output SignalSignalsThe system’s output signal
Magnitudechecked / uncheckedIf checked, calculates the magnitude response (absolute value of the transfer function)
Phasechecked / uncheckedIf checked, calculates the phase response (angle of the transfer function)
Start Frequency0 - End FrequencyLower frequency limit for analysis; frequencies below this are excluded
End FrequencyStart Frequency - ∞Upper frequency limit for analysis; frequencies above this are excluded
MethodFFT / WelchFFT: Single transform. Welch: Averaged over segments (recommended for noisy or concatenated data)

Advanced

ParameterValuesDescription
Unitlinear / dBOutput unit for magnitude
Zero Padding0 - 10.000Number of zeros appended to improve frequency resolution (FFT method only)
Segment length0.1 - 1000 sLength of each segment for Welch method. Longer = better frequency resolution, shorter = more averaging
Overlap0 - 0.9Overlap between segments for Welch method. 0.5 (50%) is typical

Output

Depending on the selected Settings, this operation creates a magnitude and/ or a phase signal:

  • Magnitude Response

    • Name: {output_signal_name} - TF Magnitude
    • X-Axis: Frequency (Hz)
    • Y-Axis: Magnitude (linear or dB)
    • Interpretation: Shows how much the system amplifies or attenuates different frequencies
  • Phase Response

    • Name: {output_signal_name} - TF Phase
    • X-Axis: Frequency (Hz)
    • Y-Axis: Phase (radians)
    • Interpretation: Shows the phase delay introduced by the system at different frequencies

Info

The frequency resolution depends on the input signal length and sample rate. Zero Padding can slightly improve the resolution.

Example Workflow

When analyzing measurement data, a typical workflow might be:

  1. Apply a Lowpass Filter to both signals.

  2. Transfer Function

    Take both signals as input and calculate the magnitude.

  3. Moving Average

    Apply a Moving Average to the result.

  4. Repeat for multiple measurements of the same system.

  5. Average

    Use the Average operation to combine results.

  6. The result is one signal containing the system behaivor characteristics.

This approach allows you to compare the transfer behavior of different systems.

Technical Details

Methods

This operation supports two methods for computing the transfer function:

FFT Method (Default)

The classic single-FFT approach. Best for:

  • Clean signals with minimal noise
  • Single sweeps or continuous excitation
  • When maximum frequency resolution is needed

Welch Method

Divides the signal into overlapping segments, computes the transfer function for each, and averages them. Best for:

  • Noisy data - averaging reduces noise
  • Concatenated measurements - avoids phase artifacts from time offsets
  • Multiple sweeps in one recording - each sweep becomes a segment
  • More stable/reproducible results

The Welch method computes:

H(f)=Pxy(f)Pxx(f)H(f) = \frac{P_{xy}(f)}{P_{xx}(f)}

Where PxyP_{xy} is the Cross-Spectral Density and PxxP_{xx} is the Power-Spectral Density, both computed using Welch’s method with Hanning window and configurable overlap.

When to use Welch

Use the Welch method when:

  • You have concatenated multiple measurements
  • Your data contains gaps or pauses between sweeps
  • You want smoother, more robust results
  • Phase accuracy is important

Preprocessing

First, the operation preprocesses the selected signals using the following steps:

  1. Alignment
  2. NaN Handling
  3. Resample
  4. Zero Padding

Main Operations

FFT Method

The transfer function is computed in the frequency domain using the Fast Fourier Transform (FFT).

The FFT is calculated for both signals using numpy.fft.fft:

X(f)=FFT(x(t)),Y(f)=FFT(y(t))X(f) = \mathrm{FFT}(x(t)), \quad Y(f) = \mathrm{FFT}(y(t))

The corresponding frequency bins are computed with numpy.fft.fftfreq:

f=fftfreq(N,d=1/fs)f = \mathrm{fftfreq}(N, d=1/f_s)

where NN is the number of samples and fsf_s is the sample rate.

The transfer function is then calculated as:

H(f)=Y(f)X(f)H(f) = \frac{Y(f)}{X(f)}

Welch Method

The Welch method uses scipy.signal.csd for the Cross-Spectral Density and scipy.signal.welch for the Power-Spectral Density:

  1. The signal is divided into overlapping segments of length nperseg
  2. Each segment is multiplied by a Hanning window
  3. FFT is computed for each segment
  4. Cross-spectral density PxyP_{xy} and power-spectral density PxxP_{xx} are averaged over all segments
  5. The transfer function is computed as:
H(f)=Pxy(f)Pxx(f)H(f) = \frac{P_{xy}(f)}{P_{xx}(f)}

This averaging reduces variance and provides a more stable estimate, especially for noisy data.

Magnitude

The Magnitude is finally calculated by taking the absolute value H(f)|H(f)| of the transfer behavior using numpy.absolute:

H(f)=abs(H(f))|H(f)| = abs(H(f))
dB Conversion

If dB is selected, the result is converted to decibels:

H(f)dB=20log10(H(f))|H(f)|_{dB} = 20 * log10(|H(f)|)

Phase

The phase response is calculated as the angle (argument) of the transfer function using numpy.angle:

H(f)=angle(H(f))∠H(f) = angle(H(f))

Postprocessing

The result is filtered to the specified frequency range.

Common Use Cases

  • System Identification: Measure the transfer function of an unknown system by applying a known input and measuring the output.
  • Filter Charaterization: Analyze the frequency response of analog or digital filters.
  • Vibration Analysis: Study how mechanical systems respond to different frequency excitations.
  • Control System Design: Analyze plant dynamics for controller design.